[GRASS-user] Freetype fonts in gis.m

Michael Barton michael.barton at asu.edu
Sun Jun 11 10:51:39 EDT 2006


Glynn,

This is the gist of it. See below.
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Glynn Clements <glynn at gclements.plus.com>
> Date: Sun, 11 Jun 2006 07:38:40 +0100
> To: Michael Barton <michael.barton at asu.edu>
> Cc: <grassuser at grass.itc.it>
> Subject: Re: [GRASS-user] Freetype fonts in gis.m
> 
> 
> 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.

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

Michael





More information about the grass-user mailing list