diff --git a/src/fonts.c b/src/fonts.c index 189617240..7ca5e10dc 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -31,6 +31,12 @@ #ifdef __APPLE__ #include "wrapperdata.h" extern WrapperData macosx; + +/* system fonts that cause TTF_OpenFont to crash */ +static const char* problemFonts[] = { + "/Library/Fonts//AppleMyungjo.ttf", + NULL +}; #endif #ifdef FORKED_FONTS @@ -284,9 +290,19 @@ TuxPaint_Font * TuxPaint_Font_OpenFont(const char * pangodesc, const char * ttff if (ttffilename != NULL && ttffilename[0] != '\0') { + int i; #ifdef DEBUG printf("Opening TTF\n"); fflush(stdout); #endif + +#ifdef __APPLE__ + i = 0; + while (problemFonts[i] != NULL) + { + if (!strcmp(ttffilename, problemFonts[i++])) + return NULL; /* bail on known problematic fonts that cause TTF_OpenFont to crash */ + } +#endif tpf = (TuxPaint_Font *) malloc(sizeof(TuxPaint_Font)); tpf->typ = FONT_TYPE_TTF;