[GRASS-dev] figureing out fonts - part 3 correction

Glynn Clements glynn at gclements.plus.com
Mon Apr 30 14:25:11 EDT 2007


Michael Barton wrote:

> if uname -s can differentiate Debian from other systems, it's easy enough to
> make /usr/share/fonts/freetype as the initial directory for those systems.

I suggest parsing etc/freetypecap, and either using the directory part
of the path for the first font in that file, or the directory used by
most fonts (the former is easier, the latter is probably more useful).

E.g.

cat $GISBASE/etc/freetypecap | awk -F: '{print $2}' | sed 's!/[^/]*$!!' | uniq -c | sort -nr | head -n 1 | cut -c 9-

Alternatively, you could replicate the logic of mkftcap (formerly
d.freetypecap), i.e. scan a list of candidate directories and settle
for the first one which exists.

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




More information about the grass-dev mailing list