[GRASS-dev] Re: [bug #4905] (grass) gis.m: d.text.freetype does not allow spaces in text

Glynn Clements glynn at gclements.plus.com
Fri Sep 1 18:57:19 EDT 2006


Huidae Cho wrote:

> > > Removing the font_hold variable from lib/driver affects the behaviour of
> > > freetype fonts.  All modules with font= option still assume "romans" as
> > > default font and it keeps the user from using freetype fonts with them.
> > > 
> > > d.font font=luximr
> > > d.vect map=vector_map
> > > 
> > > will use "romans" not "luximr". Maybe we need to use GRASS_FT_*
> > > GRASS_FONT varibles to let d.* modules know the default font the user
> > > wants.
> > 
> > That's a bug in the module. If the user doesn't explicitly specify a
> > font, the module should use the current font, not some arbitrary
> > default. Especially as any setting which the module makes will persist
> > for subsequent modules.
> > 
> > If you can identify specific modules which behave this way, I'll fix
> > them (starting with d.vect).
> > 
> > > Adding R_get_font_list() would be great. Its code can be simply cut and
> > > pasted from d.font.
> > 
> > I'm not sure that's a good idea. If we were to replace freetype with a
> > font path, the list could become huge (my WinXP system has 120 .ttf
> > files in C:/WINDOWS/Fonts, and that's just what comes with the OS or
> > with other packages which I've installed; I haven't explicitly
> > installed any additional fonts).
> 
> I didn't mean to list all fonts in the system. Instead, showing the list
> of freetypecap fonts and stroke fonts will be enough like d.font does.

If we eliminate the need to explicitly specify individual fonts in the
freetypecap file (which is desirable, IMHO) in favour of e.g. a font
path, then the list of available fonts will typically be all of the
FreeType fonts on the system.

Or, to look at it from a different perspective, I don't want to make
it so that we can't do:

	for dir in $fontdirs ; do \
	ls "$dir" | \
	fgrep .ttf | \
	awk -vdir=$dir '{sub("\\.ttf$","") ; print $0":"dir"/"$0".ttf:iso-8859-1:" }' ; \
	done > $GISBASE/etc/freetypecap

I don't particularly want to add an R_font_list(), change all of the
relevant modules to use it, then have to remove it because it's
causing huge option lists (or, alternatively, create a situation where
we cannot remove the freetypecap requirement solely because of the
effect upon the size of option lists).

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




More information about the grass-dev mailing list