[GRASS-dev] [bug #5489] (grass) d.font error in GRASS6.2/6.3

Glynn Clements glynn at gclements.plus.com
Fri Feb 9 12:55:01 EST 2007


Michael Barton wrote:

> Question to those who may know...
> 
> Is d.font simply unusable without an x11 display monitor?

It's unusable without a *monitor*. It works with any driver (XDRIVER,
PNG driver), but it isn't meaningful when using direct rendering.

> If so, I'll just
> take it off the GUI menu. Or is the warning that you need to run d.mon
> another example of an old (and a little misleading) message that is now
> getting properly parsed and displayed in the output window?
> 
> I tried setting some fonts and I couldn't find any text affected. I checked
> d.grid, d.histogram, and d.text.
> 
> I think I remember that the font setting doesn't persist or something like
> that. 

Yep. When using direct rendering, the driver state is essentially
re-initialised for each command, as if you had run e.g.:

	d.mon start=PNG
	d.foo yadda yadda
	d.mon stop=PNG

Programs whose sole purpose is to modify driver state (e.g. d.font,
d.frame) are meaningless when direct rendering is used. In a technical
sense, they still "work", but they're pointless.

This is why direct rendering has GRASS_FONT, GRASS_FT_FONT and
GRASS_FT_ENCODING; there isn't any other way to set this state.

Ideally, the GUI needs to allow you to set these variables globally,
and to override them for individual "layers".

Even when gis.m used a standalone PNGdriver monitor, setting the font
was problematic, as individual commands can change the font for their
own purposes, and any changes would then persist for subsequent
commands. Consequently, the font that was used for a particular layer
could change depending upon the order in which layers were rendered.

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




More information about the grass-dev mailing list