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

Glynn Clements glynn at gclements.plus.com
Mon May 7 12:29:58 EDT 2007

Paul Kelly wrote:

> > Here's my proposal: don't bother maintaining compatibility with the
> > current freetypecap format or the ability to select fonts by absolute
> > path. Both of those were made up on the spot without any real
> > consideration.
> So what about having a totally new file, let's call it fontcap - different 
> name to make it clear there is no backwards compatiblity. It could include 
> the stroke fonts as well as freetype-compatible fonts, with a field to 
> indicate whether the font is stroke or freetype, also absolute filename, 
> index within the file, perhaps a field for a descriptive/long name too.

Sounds reasonable.

Also, built-in PostScript fonts (for the PS driver) might also be
added at some point (although R_get_text_box() will have to be fudged
in that case).

> I wonder if something like this is what Michael had in mind when we 
> started this whole discussion - a simple list of all the avaiable fonts 
> that could be offered to the user to choose from through the GUI?

You can get that from "d.font -l".

Although, ultimately the raster API should be extended with e.g. 
R_list_fonts(); that would eliminate the possibility of mismatch
between the driver's view of which fonts are available and the
client's. In particular, built-in PostScript fonts would only be
available through the PS driver.

Regarding that last point, it should be possible to have multiple
fonts with the same name but different types, e.g. both FreeType and
PostScript versions of Helvetica. The X/PNG drivers would use the
libfreetype rasteriser with the TTF/Type1 file, while the PS driver
would just use "/Helvetica findfont ...".

> It would be generated automatically on compilation/installation and then 
> the user could further edit it to add to / strip it down if required.
> Wolf said he was interested in writing something to automatically extract 
> information from font files on the system - maybe what he comes up with 
> can be used to generate this fontcap file. And then once we're finished 
> GRASS_FONT can only contain a font id string from this file - nothing else 
> is accepted. Does that sound like it might be workable?


Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list