<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Apr 30, 2007, at 3:34 AM, Glynn Clements wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><BLOCKQUOTE type="cite"><DIV>Note that font names on OSX aren't required to follow any file  </DIV><DIV>extension conventions.  First the HFS+ file type/creator is used to  </DIV><DIV>determine if a file is a font, then the file extension if the type/ </DIV><DIV>creator are empty.  I think it's that order.</DIV><DIV><BR></DIV><DIV>So scanning automatically for fonts to create the freetypecap may  </DIV><DIV>miss many fonts, unless it knew how to check OSX type/creator info  </DIV><DIV>for a file.</DIV><DIV><BR></DIV><DIV>ie the MS fonts that come with the system have no extension.  Also,  </DIV><DIV>many TT fonts in OSX have been repackaged in the .dfont (a flattened  </DIV><DIV>resource-fork file).</DIV> </BLOCKQUOTE><DIV><BR></DIV><DIV>In which case, users will need to construct the freetypecap file</DIV><DIV>manually.</DIV><DIV><BR></DIV></BLOCKQUOTE><DIV>If you do that, there is not much point to the automatic scan - most of the useful TT fonts that are included with OSX are either dfonts or have no extension.  Most, if not all, of the included .ttf TT fonts are miscellaneous language fonts.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>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.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>A few more comments:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>- Add /System/Library/Fonts to the search paths (assuming some way to handle other file extensions, or lack of, is worked out, as well as multiple faces in a file).  Helvetica and Times are in here.  As well as Lucida Grande (with a fairly complete international character set) and a few other basic fonts.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>$HOME/Library/Fonts would be another good default dir to search.  And to do these in the proper OSX order of precedence would be: $HOME/Library/Fonts /Library/Fonts /System/Library/Fonts.  $HOME can have spaces if it's on a network driver, so that path at least should be quoted.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>- Maybe Michael's proposed font path env var could be used here?  For additional user font paths to search automatically.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>- 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?  Then it will destroy a user's manually created freetypecap, so it should be as thorough as possible.  Or add some sort of divider in the freetypecap between user entries and auto-generated entries, and mkftcap would not overwrite user edits.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>- 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. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This is a good candidate for my new G_find_etc() function.  Find the first writable freetypecap in the etc paths (G_find_etc() would need to be expanded to do that).</DIV></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-----</DIV><DIV>William Kyngesburye &lt;kyngchaos*at*kyngchaos*dot*com&gt;</DIV><DIV><A href="http://www.kyngchaos.com">http://www.kyngchaos.com</A>/</DIV><DIV><BR></DIV><DIV>Earth: "Mostly harmless"</DIV><DIV><BR></DIV><DIV>- revised entry in the HitchHiker's Guide to the Galaxy</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>