[GRASS-dev] iconv a required dependency for using Freetype?

Paul Kelly paul-grass at stjohnspoint.co.uk
Thu May 10 12:03:19 EDT 2007

I've committed a slightly changed version of this to CVS now as 
g.mkfontcap. It should be compiled by default, and create the new-format 
file $GISBASE/etc/fontcap automatically during the compile process.

On Wed, 9 May 2007, William Kyngesburye wrote:

> Strange - almost ALL the dfonts have tripled indexes for each style.  And 
> always alternating indexes.  I'm not sure what that's all about, but with the 
> dulicate names, only one of the triplet will be usable.  As a test I made the 
> names unique for the Times styles in my freetypecap file and drew each of 
> them - they all work.  So it appears that only the first one of each triplet 
> is needed.

No clue what to do about this yet. With the latest change to have separate 
long and short names (see below), the short names will now be different 
for each variant...

> One suggestion - make it useable outside of GRASS, or during the startup 
> process. (I tried it and got a segfault)

It calls G_no_gisinit(), i.e. it doesn't require a valid location or 
mapset to be present, just GISBASE and GISRC to be set, so should be fine 
for most purposes I think.

> This would be useful for a first-time run of GRASS when an alternate 
> $GRASS_FT_CAP is used, and that doesn't exist yet.  Maybe default to stdout 
> in this case, since GISBASE might not be set.
> I'm thinking of a binary install (especially OSX) that will build a user 
> freetypecap to use in place of the built copy in the GRASS binary, but not 
> overwrite the GRASS binary copy, since the user might not have admin 
> privileges.  Maybe run it in init.sh if GRASS_FT_CAP is set and the 
> referenced file does not exist yet.  I guess if run in init.sh, it could be 
> run at a point when the necessary env vars are set...
> Postscript fonts - no worries there, if FreeType supports them, they're 
> listed (I have a couple in my /Library/Fonts folder).
> Another possible option - write to $GRASS_FT_CAP, if set.  Or to a 
> user-supplied file path.

I've changed it so it will write to the file specified by $GRASS_FONT_CAP, 
if it's set. Or $GRASS_FT_CAP if the the -f flag is used to write an old 
freetypecap-compatible file. Normally it will write to 
$GISBASE/etc/fontcap or to stdout if the -s flag is specified.

I also changed the fontcap format to have a shortname and a long 
descriptive name. The short name is made up of the filename with any 
suffix stripped, and the index number added if it is greater than 0. For 
the GUI font selection box to be as pretty as possible then I guess it 
will need to use the short name internally as an index key to the list, 
but display the long name for the user to select.

Haven't done anything yet about specifying an encoding other than UTF-8, 
or removing duplicate fonts.


More information about the grass-dev mailing list