[GRASS-dev] using system fonts?

Glynn Clements glynn at gclements.plus.com
Tue Apr 24 00:54:18 EDT 2007


William Kyngesburye wrote:

> Ah, I was thinking of font rendering with Python, not directly in a  
> GRASS display module or driver.  Even so, the Python font API  
> (whatever it may be) might have some method of obtaining the font  
> file path?

Nope; that information simply isn't available.

The way that fonts work in a GUI is that the GUI (usually) provides
some way to obtain a list of names, and (invariably) provides some way
to select a font using a name.

As for paths: there may not be any paths. The X server can get its
fonts from a font server; as for where the font server gets those
fonts from, not even the X server knows. And even if it did, that
doesn't help if it can't access the filesystem on the box which is
running the font server.

And even if the X server gets those fonts from files, those files may
not be accessible to the X client.

I do all of my GRASS development on my Linux box. When I say "on", I
mean that's where the shell is running, that's where make, gcc etc
run, that's where GRASS programs are run.

The Linux box doesn't have a monitor. The Windows box has a monitor,
and that's where the X server runs, and that's where all of my windows
(XEmacs, xterm, XDRIVER, gis.m etc) show up. The X server is using the
fonts on the Windows box (i.e. /usr/X11R6/lib/X11/fonts/* in Cygwin,
or C:\cygwin\usr\X11R6\lib\X11\fonts in Windows). Those paths simply
aren't accessible to gis.m or other programs running on the Linux box.

Now, I do have a reasonable set of fonts available on the Linux box,
in /usr/share/fonts/*. But there is absolutely no standard API
function (whether in C or Tk or Python or anything else) which is
going to reveal this fact to the PNG driver. It *has* to be told.

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




More information about the grass-dev mailing list