[GRASS-user] Freetype fonts in gis.m

Glynn Clements glynn at gclements.plus.com
Sun Jun 11 02:38:40 EDT 2006


Michael Barton wrote:

> >>> 2. gis.m provides no guarantees as to the order in which layers are
> >>> rendered. If a command changes the font, whether other commands use
> >>> the default font or the changed font depends upon the order in which
> >>> the commands are executed.
> >> 
> >> The layers are always rendered and composited in bottom to top order in
> >> gis.m.
> >> 
> >> Between each layer rendering, it is necessary to run a d.font command or no
> >> text will render. Currently this defaults to d.font romans. It could be set
> >> to a variable which, in turn, could be set by d.font.text or
> >> d.font.freetype.
> > 
> > You're still restarting the driver for every layer?
> > 
> > Whilst inefficient, that does at least simplify the font issue.
> > 
> > For now, it's simpler to keep the font handling entirely within gis.m,
> > i.e. provide a user option to control the font used at startup
> > (ideally, also provide an option to use freetype fonts).

> We don't restart d.mon gism for each layer, but d.font romans and d.frame -e
> is run each time due to driver issues.

> I correct myself (had to check into how Cedric had changed it).
> 
> D.font romans is run once per rendering session, not once per layer
> D.erase -e is run once per layer.

So how much work is done in each session?

If you render multiple layers with a single driver process, and one of
the commands sets the font, that setting will affect subsequent
commands.

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. If you only execute
the second command, it will use the default font (romans).

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




More information about the grass-user mailing list