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.