On 8-Jan-05, at 1:18 PM, Albert Cahalan wrote:
On Sat, 2005-01-08 at 14:53, Martin Fuhrer wrote:On 8-Jan-05, at 2:38 AM, Albert Cahalan wrote:
I have this now:
#elif defined(__APPLE__) loadfonts("/System/Library/Fonts", 0); loadfonts("/Library/Fonts", 0); loadfonts("/usr/share/fonts", 0); loadfonts("/usr/X11R6/lib/X11/fonts", 0);
I've added the path to the User's fonts directory to CVS, via a Cocoa API call.
You can't just use getenv("HOME") for that?
Ah, yes, I almost forgot about getenv! The following works - feel free to use it instead:
loadfonts(strcat(getenv("HOME"), "/Library/Fonts"), 0);
Would /Network/Library/Fonts also be good? Mozilla uses or used this one. (saw it in a prefs.js patch)
Yes, you're right, that would also be a good path to include. This is probably useful when booting Mac OS X off a network server.
Most fonts are being ignored, but a few are loading fine (primarly .ttf
fonts). Here is a sampling of the errors I get from the other fonts:
Bummer. Is there a newer version of FreeType that you could be using?
I'm actually not sure which version of FreeType is being used. IIRC, a vanilla installation of Mac OS X does not include FreeType (font rendering is handled by OS X's Quartz and PDF libraries). There are two versions of SDL for Mac OS X - the X11 version (which requires a FreeType installation) and the native Mac version which is bundled as a framework (and does not require a Freetype installation). I'm using the native version, and have always assumed that FreeType is statically linked into the SDL library, though I may be totally wrong.
If that won't do, TTF_OpenFontIndexRW can take care of the problem. Append "/rsrc" to the Mac name to get at the resource fork if needed. Then, for both types of troublesome files, parse the structure to find a normal file file embedded inside.
I can look into this in a couple weeks' time; I'm currently a bit tied up with some paper submissions.
This'll work with the Linux hfs filesystem driver too.
As well, the following line in tuxpaint.c is producing a compile error:
const char *restrict const suffixes[] = {"ttf", "otf", "pfa", "pfb", "dfont", "ttc",};
/Users/mfuhrer/Projects/TuxPaint/tuxpaint-cvs/tuxpaint/src/tuxpaint.c: In function `loadfonts': /Users/mfuhrer/Projects/TuxPaint/tuxpaint-cvs/tuxpaint/src/tuxpaint.c: 14226: error: invalid use of `restrict' /Users/mfuhrer/Projects/TuxPaint/tuxpaint-cvs/tuxpaint/src/tuxpaint.c: 14226: error: invalid use of `restrict'
I can get around it by removing "restrict".
What compiler are you using? What options did you give it? Note that src/tuxpaint.c contains the following:
#if !defined(restrict) && __STDC_VERSION__ < 199901 #if __GNUC__ > 2 || __GNUC_MINOR__ >= 92 #define restrict __restrict__ #else #warning No restrict keyword? #define restrict #endif #endif
I'm using the Apple-modified version of gcc 3.3. It compiles previous instances of the restrict keywords, just not the one I mentioned.
Martin
_______________________________________________ Tuxpaint-dev mailing list [email protected] http://tux4kids.net/mailman/listinfo/tuxpaint-dev
