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

Huidae Cho grass4u at gmail.com
Fri Sep 1 19:25:21 EDT 2006


On Fri, Sep 01, 2006 at 11:57:19PM +0100, Glynn Clements wrote:
> 
> 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.

Then we may need a flag like -l to see font aliases since no one can
remember all the font names.

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

Do we really need the charset field in freetypecap?  AFAIK, TrueType
font itself is not tied to any specific encoding.  Charset has to do
with the terminal or input method in use and the display driver converts
to Unicode for TrueType fonts.  For example, I can use one TrueType font
for UTF-8 and EUC-KR charsets.  iso-8859-1 fonts cannot be used with
CJK fonts, of course, but this is because the font files do not have
corresponding glyphs not because of their native encoding.

Huidae




More information about the grass-dev mailing list