[GRASS-dev] font path question for Linux and Windows
glynn at gclements.plus.com
Tue May 1 05:05:15 EDT 2007
Wolf Bergenheim wrote:
> > Some of these probably won't display with GRASS's TrueType drivers.
> > Trying to find all the potentially useable fonts on all kinds of systems is
> > indeed a laudable task--and clearly a complex one. My goal is somewhat more
> Trying to find all fonts (within a configured font path) on a Linux
> system is actually quite easy. Just run the command 'fc-list'
Part of fontconfig. Although that's a fairly common package, it isn't
guaranteed to be installed, particularly on servers.
It probably won't be present on Windows or MacOSX unless you have a
fair amount of Linux compatibility stuff installed. I have several
native GTK+ apps on my Windows box, but no native fc-list. I have a
Cygwin fc-list, although that fails to list the Windows TTF fonts.
But, given that we're trying for a best-guess, there's no harm in
using it if it's present, so long as we don't rely upon it to the
exclusion of all other options.
> If you
> want the filenames and the families, you could run 'fc-list : file
> family'. Note that this will list also fonts other then truetype fonts,
> but that should be ok since at least freetype lib should be able to
> display them. if you want to limit to truetype only you can grep for ttf
> ;) there is I think some way to specify it, but I haven't really
> researched it. Using this list one could easily construct a freetypecap
> file from this.
It appears that you can e.g. "fc-list :outline file" to only list
outline fonts. That eliminates the PCF fonts (X11 bitmap fonts),
although it still picks up the PFA/PFB files from my Ghostscript
Unfortunately, the "rasterizer" property cannot be used or output from
within fc-list; I'm guessing that this is only meaningful if you have
initialised the font for rendering.
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev