Re: [gtk-list] Verifying fonts
- From: Havoc Pennington <hp redhat com>
- To: David Allen <opop erols com>
- cc: GTK+ List <gtk-list redhat com>
- Subject: Re: [gtk-list] Verifying fonts
- Date: Sun, 29 Aug 1999 01:04:44 -0400 (EDT)
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]