ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: Re: [Ethereal-dev] GTK+ 2.2.3 Ethereal 0.9.15

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 18 Sep 2003 11:44:21 -0700

On Sep 18, 2003, at 7:26 AM, Greg Morris wrote:

The reason for the font error is because you are going from GTK+1.3 to GTK+2.x. The font specified in your preference files is not recognized by pango so the error message is displayed when it tries to read and load the font. By defining a new GTK+ 2.x font you elliminate the problem.

Perhaps the font preference should be a set of font preferences, one for each font naming scheme.

GTK+ 1.2[.x] (and, presumably, 1.3[.x] as of when the Win32 version was made) uses XLFD font names (with some scheme for mapping those to Windows fonts in the Win32 version)

GTK+ 2.x uses Pango:

	http://www.pango.org/

font names.

Qt's Font class, if we were to build a Qt front end, lets you get the "raw name" of a font with the rawName method:

	http://doc.trolltech.com/3.2/qfont.html#rawName

"Returns the name of the font within the underlying window system.

On Windows, this is usually just the family name of a TrueType font.

On X11, it is an XLFD (X Logical Font Description). When Qt is build with Xft support on X11, the return value can be an Xft pattern or an XLFD.

Using the return value of this function is usually not portable."

and you can use the setRawName method to set a font by its raw name. You can also create a font from a family name, point size, weight, and italic flag:

	http://doc.trolltech.com/3.2/qfont.html#QFont-2

which would be what I'd be inclined to use.

If we wanted to do "native" Windows and Mac OS X versions, I don't remember offhand what the font names would be.

It might be possible to use a family name/point size combination, at least for everything other than GTK+ 1.x - we don't want the weight wired in anyway, given that we want both regular and "emboldened" versions of that font (with XLFD, we have to do the "boldify()" hack to get that, i.e. to abstract away the fact that XLFD names are *too* specific), nor do we want the italic flag wired in (we don't use italic - yeah, that'd mean you can't choose an italic font as the main GUI font, but that's life). It might be interesting to see whether we could even make that work with GTK+ 1.x, by doing our own font matching, rather than having two different types of font name.