[GRASS-user] Freetype fonts in gis.m

Glynn Clements glynn at gclements.plus.com
Sun Jun 11 20:04:30 EDT 2006


Michael Barton wrote:

> > Rather than resetting the font after commands which might change it,
> > setting the font before commands which might draw text may be more
> > appropriate.
> > 
> > Except that driver-less rendering will make this point moot. There,
> > the issue is being able to set the default font (it's currently
> > hard-coded to romans).
> 
> Wouldn't it work to simply run d.font (or d.font.freetype) just before
> running a d.command in this situaion too?

With no driver, there is no persistent state. Each command is
self-contained; any changes which it makes to the state are lost when
the command terminates.

For something like gis.m, this should be an advantage, as you don't
have to worry about "accidental" state changes from previous commands
(i.e. commands changing the font, line width, text rotation etc).

If there are things which really should persist between commands, that
will need to be explicitly added, but then you need to be sure to
explicitly set any state which will affect a command and not assume
that it will be in its default state.

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




More information about the grass-user mailing list