[GRASS-user] Freetype fonts in gis.m

Glynn Clements glynn at gclements.plus.com
Sun Jun 11 17:51:14 EDT 2006


Michael Barton wrote:

> > If you only render "changed" layers, then commands which draw text
> > will produce different results depending upon whether a command which
> > sets the font is run previously in the same session.
> > 
> > E.g. suppose you have two command layers:
> > 
> > 1. d.vect ... font=...
> > 2. d.legend ...
> > 
> > If you execute both commands in the above order with the same driver
> > process, d.legend will use the font set by d.vect.
> 
> ... Snip...
> 
> If you redisplay and nothing has changed, d.vect and d.legend will not run.
> The existing PPM images from previous rendering will be used instead. It
> doesn't matter that d.font romans runs, because it doesn't affect images
> already stored on disk.
> 
> If the legend changes and the vector does not, then the d.font romans
> command WILL affect the legend.
> 
> So the font command ought to go with the d.* command where it is meant to
> apply.

Yep; hence my earlier comment:

> There should be an option to set the default font. You would need to
> reset the font after calling anything which might change it (which
> includes all command layers, as there's no reliable way to determine
> whether a particular command will change the font).

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

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




More information about the grass-user mailing list