[GRASS-dev] iconv a required dependency for using Freetype?

Glynn Clements glynn at gclements.plus.com
Mon May 7 13:26:01 EDT 2007


Michael Barton wrote:

> >> OK well it doesn't work on Windows anyway. The device number corresponds
> >> to the drive letter but it appears the inode number is always 0. So I
> >> suppose we can just keep the string comparison of the directory names. Or
> >> remove the option of specifying the full path to a GRASS stroke font - I
> >> generally feel unhappy with the idea of removing functionality but maybe
> >> it is the best option here?
> > 
> > I think so.
> > 
> > Allowing a full path is exposing an implementation detail, it isn't
> > sufficient for files containing multiple faces, and it may cause
> > problems with future development.
> > 
> > I would rather just have fonts selected by an abstract identifier.
> 
> Could this be the kind of font specification used in native font selection
> dialogs for wxPython and TclTk? They *appear* to be quite similar in the way
> they specify fonts. But I still have found no way to get back to original
> font files from these specifications, suggesting that it happens somewhere
> at the system level. If we could somehow tap into that, it could ultimately
> make life easier for cross-platform font selection.

It cannot be done.

Just because a program can get a list of fonts, get information about
those fonts, and even draw text using those fonts, that doesn't mean
that it can actually access the underlying files (if there are any).

An X application can ask the X server for a list of fonts (XListFonts,
XListFontsWithInfo), can obtain information about a font (XQueryFont,
XGetFontProperty), and can tell the X server to use a specific font
for drawing text (XSetFont, XChangeGC).

It cannot, however, obtain either the raw contents of the underlying
file or it's path (not that it would be much use, given that it may
not have access to the filesystem of the system on which the X server
is running). Even the X server may not have that access if it's
getting its fonts from a font server.

There may not even *be* any underlying files. A font server can
manufacture glyphs on the fly, e.g. automatically generating bold
and/or oblique versions of a font, generating outlines from strokes,
bitmaps from outlines, etc.

IOW, any list of fonts which you can get from X is only useful insofar
as you can pass the name to XLoadFont() etc.

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




More information about the grass-dev mailing list