[GRASS-dev] iconv a required dependency for using Freetype?
Paul Kelly
paul-grass at stjohnspoint.co.uk
Wed May 9 22:10:21 EDT 2007
On Tue, 8 May 2007, Paul Kelly wrote:
> Maybe writing it in C, linking it against the Freetype library and using the
> Freetype API to query information about the font files it finds would be a
> good idea. Presumably it would be possible to determine if two fonts are
> identical, also the information about more that one font in each file and
> perhaps more descriptive names for the font that just the filename would be
> available. But I don't know for sure; haven't looked at the Freetype API.
I've done that now. See attached for the prototype in case anybody would
like to try it. What it does is search through all the files in the list
of directories we gathered (hard-coded in main.c). Rather than checking
the file extension it examines each file using Freetype functions to see
if it is a font or not. This should work for font files with no extension
if they exist. It should also get the multiple fonts in one file OK -
would be especially interested to see what it comes up with when run on a
Mac system.
I haven't done anything yet about finding duplicate fonts - I don't have
any on either the Windows or Linux systems I tested this on. The list is
sorted first by font type (stroke or freetype) and secondly name. I've
just gone with a fully descriptive name, including spaces for the names.
The elegant simplicity of that approach for the GUI font selection box
seems to work quite well.
The version of the program (called g.mkfontcap for now) attached can write
a file in either the current freetypecap format, or the proposed new
fontcap format, which (in order to be Windows-compatible) separates all
the fields with a vertical bar - and includes the index within each font
file and the type of font (stroke or freetype) as fields also. Hopefully
this format should be easily extendible to include PostScript fonts too?
I'm still not very sure at all about the meaning of the encoding field or
if it should be included, or even if it depends on the fonts in any way at
all and if there's any way it should be derived from freetype?
If we can decide on a name - maybe g.mkfontcap is all right? - I can
submit it to CVS for further improvements.
Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: g.mkfontcap.tar.gz
Type: application/octet-stream
Size: 4012 bytes
Desc:
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20070510/b894fa20/g.mkfontcap.tar.obj
More information about the grass-dev
mailing list