Re: [gtk-list] Verifying fonts




On Sun, 29 Aug 1999, David Allen wrote:
> 
> The problem is that one of the users of my package has complained that 
> sometimes he will pick a font, and click ok, and the program will segfault.
> The font handling code that I have written seems to be ok, and maybe I was
> being naive, but I assumed that the font selection box would only make 
> available options that were useable, but I guess not.
> 
> Is there a way to verify that the font is loadable/useable using GTK+?
> In the interim, I've been using XQueryFont and a few other xlib calls, but
> I'd rather do it in GTK+ to keep things consistant.
> 
> Any suggestions?
> 

How do you know the bug is caused by failure to load fonts?

The font selection shows fonts that the X server reports, via
XListFonts(). Of course it's possible that the server gets confused and
loading one of these could fail, so your app should always check the
gdk_font_load() return value and recover gracefully. 

However, I'm not convinced this is the problem - do you have a backtrace
from gdb?

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]