[GRASS-dev] thinking about font variables
hamish_nospam at yahoo.com
Wed Apr 25 01:16:35 EDT 2007
Michael Barton wrote:
> After sleeping on it, I¹d like to propose 2 new kinds of font variables for
> GRASS_FONTPATH would be an environmental variable like GRASS_PROJSHARE. It
> is a convenience to help users get to their fonts easily without a lot of
> browsing around. Like GRASS_PROJSHARE, this could be set manually (e.g., in
> a user¹s .profile) or Init.sh will make some reasonable guesses as to a
> logical path on each platform (e.g., /Library/Fonts on a Mac OS X). It could
> be used from the command line or in the GUI to get to the font directory for
> easy font selectione.g., the default font path shown in the autogenerated
> dialog for d.text could be initially set to $GRASS_FONTPATH.
> GRASS_DEFAULTFONT would be a GRASS environmental variable, optionally set in
> .grassrc6. It would take any value accepted by d.font. The purpose of this
> variable would be to allow for a default font to be set by the user and
> persist from session to session. If GRASS_DEFAULTFONT is not set, GRASS
> would simply default to it current stroke font setting. Explicitly setting
> d.font or specifying a font in something like d.text would temporarily
> override GRASS_DEFAULTFONT. I can see how I can use it in the rendering part
> of the GUI to use this font for every rendering operation. It would be nice,
> however, if this could be used automatically for any display command that
> renders fonts (e.g., d.legend).
> Implementing this in the GUI is fairly trivial. I don¹t know what kind of
> work would be needed to make d.* commands automatically respect
> GRASS_DEFAULTFONT, however.
FWIW, I simply have this line in my .grass.bashrc file: (GRASS 6.3)
alias d.font.vera='d.font path=/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf'
or for GRASS 6.2:
alias d.font.vera='d.font.freetype /usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf'
then I run d.font.vera whenever I want that.
More information about the grass-dev