[GRASS-dev] using system fonts?

Glynn Clements glynn at gclements.plus.com
Mon Apr 23 21:37:44 EDT 2007


Michael Barton wrote:

> I guess, I'm thinking of my Mac-centric world (thought similar for Windows
> too), where bringing up a font selection dialog lets me access the fonts
> installed on my system and send their specifications to a display app. I
> don't have to go searching for them. These are the bitmapped fonts, in
> general I guess. 

That would surprise me; TrueType fonts seem to be the norm nowadays. 
Bear in mind that TTF files can contain pre-rendered bitmaps for
common sizes; the FreeType library will use these automatically if
they are found.

> It would simply be nice to be able to make a consistent font selection
> interface across GRASS. I don't use Linux enough to know where a
> font-selection dialog created by wxPython, for example, gets its fonts.

That depends upon the toolkit which wx uses, and the options it was
built with (e.g. whether it uses Xft).

> Maybe it's more a matter of specifying fonts. Currently, we have to give a
> TT font file path. Could it accept a bitmapped font description too (font
> name, style, color, size)?

In general, no.

X applications can tell the X server to use a font by name. The X
server knows where to get the fonts from via the FontPath settings in
the xorg.conf file (previously XF86Config).

Non-X applications won't easily be able to find whatever fonts X is
using; they may not even be available from the system on which the
client is running (other than by "dumping" them, i.e. drawing text
into a pixmap then grabbing the pixmap contents from the server; for
TrueType fonts, this will get you pre-rendered bitmaps rather than the
outlines).

Every application which wants to do something with fonts other than
render them via X has the same issues; even X applications which need
to get at the actual fonts to e.g. embed them in a PDF file.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list