[GRASS-dev] How to change fonts in gis manager?
Glynn Clements
glynn at gclements.plus.com
Thu Nov 23 22:42:37 EST 2006
Michael Barton wrote:
> >> Disregard my last email, I found out that I needed to place the
> >> GRASS_FT_FONT definition in .grass.bashrc, not grassrc6.
> >
> > GRASS_FT_FONT etc aren't intended for the user, but for applications
> > which direct rendering (currently gis.m).
> >
> > Presumably you are setting it as a workaround for gis.m not providing
> > a mechanism to set the default font?
>
> Thanks for noting this. Currently, there are menu entries for d.font and
> d.font.freetype. But these don't work anymore in this context.
>
> So I guess there needs to be a little TclTk dialog written that replaces
> these. It would work kind of like the font selection part of the text layer
> panel to set GRASS_FONT.
Ideally, it should be possible to set the font/encoding globally, for
a specific display, and for a specific command.
If want to allow the user to choose fonts from a list, you can list
the FreeType fonts with "d.font.freetype -l"[1], and the stroke fonts
by enumerating the $GISBASE/fonts directory. Also, $GRASS_FONT can be
the absolute path to a .ttf file, so a "Browse" option might be
useful.
[1] With the -l switch, d.font.freetype never gets as far as calling
R_open_driver(), so it doesn't require a driver or for any of the
PNG-driver environment variables to be set
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list