[GRASS-dev] font path question for Linux and Windows

William Kyngesburye woklist at kyngchaos.com
Mon Apr 30 16:11:22 EDT 2007

On Apr 30, 2007, at 1:45 PM, Glynn Clements wrote:

>> But, then there is another problem (and in general TT font usage) -
>> d.font.freetype doesn't handle multiple faces in a file.  Many dfonts
>> and resource fonts (the ones with no extension) have multiple faces
>> in a single file (ie regular, italic, bold..).  Without specifying
>> the face index or name, freetype defaults to the first face in a font
>> file. (I thought I made a feature request for this, but I don't see
>> it in either tracker)  There is no guarantee that plain/regular will
>> be the first face in a font file, so you may get italic or bold or
>> other unexpected style.
> Regarding both cases (mkftcap and R_font()), fixes are welcome. They
> will need to come from someone who can devise (and test) a solution,
> though (i.e. someone with a Mac).
I can poke around for an OSX prog that can return type/creator info.   
I know there is something in the Dev tools, but someone who installs  
a binary GRASS may not have that.  There should be something that is  
on all Macs that can give type/creator info...

I don't know about the C equivalents for R_font().  but it would  
probably involve tapping into some system frameworks, something that  
hasn't been done in GRASS yet, at least directly.

>> - Maybe Michael's proposed font path env var could be used here?  For
>> additional user font paths to search automatically.
> I can add "$@" to the list used by mkftcap, so other directories can
> be passed as arguments. Environment variables are problematic when
> directories contain spaces, but command-line arguments can be quoted.
If it uses a colon-separated list like other path env vars do, can't  
it be split that way, and then each item quoted in the loop?  My  
shell scripting isn't very good to know.

>> - since this is now in /tools and installed in etc/, that implies
>> that mkftcap will get run automatically somehow?  From GUI?  Or some
>> future script module?  On startup?
> At present, it gets run at build time; thereafter, it has to be run
> manually. It could be run from a post-install script used by the
> packaging system (.deb, .rpm, etc).
> It isn't intended to be run automatically during normal use.
What about at startup time?  Users may want to manage fonts in  
between runs of GRASS, so the available fonts can change often.

>> - regenerating the freetypecap at runtime in the GRASS application
>> folder is not a good thing on OSX (see my previous discussions about
>> OSX apps and user preference/config/addon files).  There should be
>> some way to have GRASS look for alternative external freetypecap
>> files, for both generating the freetypecap file, and reading it to
>> set the font.
> The code which reads the file already uses $GRASS_FT_CAP if that is
> set.
I missed GRASS_FT_CAP - how recent is this?

William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>

[Trillian]  What are you supposed to do WITH a maniacally depressed  

[Marvin]  You think you have problems?  What are you supposed to do  
if you ARE a maniacally depressed robot?  No, don't try and answer,  
I'm 50,000 times more intelligent than you and even I don't know the  

- HitchHiker's Guide to the Galaxy

More information about the grass-dev mailing list