[GRASS-user] Freetype fonts in gis.m

Glynn Clements glynn at gclements.plus.com
Fri Jun 9 21:18:24 EDT 2006


Michael Barton wrote:

> I also was confusing d.text.freetype with d.font.freetype.
> 
> AFAIC, all such text should be rendered separately from the geospatial data
> itself. That is, fonts and decorations should be rendered as a separate
> layers (as they do now). Currently, the only way to have them produce
> high-quality output is to render them in the GUI (e.g., as TclTk postscript
> objects). Could the relevant d.* commands (e.g., d.legend, d.text, d.label)
> be changed to optionally output postscript some something that would scale
> and display well? Or does this need to be done in the GUI?

Regardless of any future changes to the display architecture, the
existing d.* modules need to work as well as possible with gis.m.

1. It should be possible to set the font used by d.legend etc. In
practice, this means running d.font[.freetype] before any command
which /might/ use R_text(). That means all command layers, plus any
other layers which run commands which are known to use R_text().

[For efficiency, it may be necessary to modify the driver library so
that the font is loaded the first time it is actually used, rather
than when it is selected. Freetype fonts are already handled this way;
I can make the changes for vector fonts if it is necessary.]

2. d.text[.freetype] should be usable in a command layer, which means
that it should be possible to pass arguments containing spaces. IOW,
the string obtained from the entry widget needs to be treated as a Tcl
list rather than a string.

Note that d.font[.freetype] currently won't work with driver-less
rendering, as no state is retained between d.* commands. The current
font probably needs to be stored in $GISRC for this case.

Ideally, we need to:

a) make a distinction between setting the font in a persistent manner
(for d.font[.freetype]) and setting the font internally for a single
client (e.g. "d.vect ... font=...", or the .F operator in d.text).

b) modify modules which use R_text() to accept font= and charset=
options to eliminate the need for d.font[.freetype] (which doesn't
work well with command layers).

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




More information about the grass-user mailing list