On Sat, Aug 31, 2002 at 07:25:54PM +0200, Olivier Abad wrote:
> > (ethereal:31250): Gdk-CRITICAL **: file gdkfont.c: line 72
> > (gdk_string_width): assertion `font != NULL' failed
>
> I also had these messages until I changed the font in the GUI
> preferences. You can also specify it on the command line :
> ethereal -m "Monospace 8"
GTK+ 2's filter naming scheme is, I think, different from GTK+ 1.2's.
1.2 internally uses XLFD names (those hideous
-adobe-courier-bold-o-normal--12-120-75-75-m-70-iso8859-1
names that should never have been exposed in user interfaces); those are
the names Ethereal uses when built with GTK+ 1.2, including the default
font name.
2.0 has its own font naming scheme; I'm not sure if it's purely
Pango-based, or, for that matter, whether the Xft library (or Xft2, if
that's the current one - I haven't been following all the font stuff
Keith Packard's been doing) has a complete font naming scheme and
whether, on UNIX+X, Pango uses that scheme, or if it just uses a scheme
that's designed to work well with Xft.
So:
1) switching between GTK+ 1.2[.x] and GTK+ 2 will, if you have a
preferences file that has a font name (e.g., if you saved the
preferences from the GUI), give font warnings until you
select a new font and save preferences.
2) the code in "prefs.c" should, perhaps, choose, on UNIX,
a different default font name depending on whether you're using
GTK+ 1.2[.x] or GTK+ 2.x.
1) suggests that we should, perhaps, have separate preferences for GTK+
1.2[.x] and GTK+ 2 font names, or come up with a scheme for using a
single font name that could be transformed into XLFD names, GTK+ 2
names, Qt/KDE names, etc.. (However, for native non-X-based GUIs, e.g.
Windows and MacOS X Aqua, we might still want different font names; it
*might* be that we could have a single font name for all X-based GUIs,
but I wouldn't assume that we can.)
2) suggests that there should, perhaps, be a GUI-dependent routine
called by the "prefs.c" code to set "prefs.gui_font_name"; it could be
stubbed out on Tethereal, e.g. returning NULL (with any changes needed
to the code shared between Ethereal and Tethereal to make that work).
However, the assertion failure suggests that *Ethereal* isn't doing
enough of the right sort of error checking - it should have caught the
presumed failure to load a font and worked around it better.