[GRASS-dev] using system fonts?

Michael Barton michael.barton at asu.edu
Mon Apr 23 21:02:28 EDT 2007


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. 

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.

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)?

Michael


On 4/23/07 11:44 AM, "Glynn Clements" <glynn at gclements.plus.com> wrote:

> 
> Michael Barton wrote:
> 
>> Perhaps this is a silly question, but is there any way to use system fonts
>> in GRASS. Currently, we either need to use a stroke font (the default, ugly)
>> or specify a path to a Truetype font.
>> 
>> It is quite easy to get system font information (family, name, style, size,
>> color, etc) from a standard system font dialog in wxPython (and in TclTk
>> too). Is there some way to pass that information to GRASS so that it will be
>> the display font. Or could there be a flag/GRASS environmental variable, to
>> make the default system font the default GRASS font? Then the default could
>> be changed as desired. Imagine Helvetica/Lucida Grand/Arial as the default
>> font for legends, bar scales, and the like...
> 
> Adding support for bitmap fonts would be reasonably straightforward,
> but getting those fonts without using X might be a different matter
> (bear in mind that there might not be any font files on the local
> system. X can get its fonts from a font server).
> 
> Personally, I would have thought that the Freetype support would be
> sufficient. If it isn't, I can look into either stealing the
> PCF-reading code from X, or writing an X-based font-dumping utility.
> Obviously, I don't want to make the PNG/PS drivers link directly
> against Xlib.
> 
> BTW, the term "default system font" isn't clear-cut. Different
> toolkits may have different ideas as to the default font. Xt uses X
> resources. Tcl/Tk manually parses certain X resource files (but not in
> the same that Xt does), so it might use the same font as Xt-based
> applications or it might not. GTK and Qt have their own mechanisms,
> and can vary depending upon whether they are being used under Gnome or
> KDE.

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton 




More information about the grass-dev mailing list