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

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

On Thu, 10 May 2007, Glynn Clements wrote:

> Glynn Clements wrote:
>>> 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.
> I've added R_font_list().
> This currently returns the list of fonts from the freetypecap file;
> I'm not sure whether to extend it to include the stroke fonts, or
> whether those will get added to freetypecap file soon.

They're there now in the new fontcap file.

> I've also changed "d.font -l" to use this function, so we don't have
> to re-write multiple freetypecap parsers if the format changes.

I added a structure to hold the information in the fontcap file to 
general/g.mkfontcap/local_proto.h - perhaps it should go somewhere more 
general to be shared with d.font. Currently it is:

struct GFONT_CAP
     char *name;     /**< Short name for this font face */
     char *longname; /**< Descriptive name for the font face */
     char *path;     /**< Full path to the file containing this font face */
     int index;      /**< Index within the file of this font face */
     int type;       /**< Type of this font face (currently stroke or freeype) */
     char *encoding; /**< Encoding to be used with this font face. */

#define GFONT_STROKE 0

> Future enhancement: add an option to return complete information
> rather than just the name (e.g. "d.font -L"). But I'll leave that
> until things have settled down a bit.

Yes. I suppose the GUI will need it to produce pretty output (long names) 
and populate the encoding text box with a default value etc.

More information about the grass-dev mailing list