Fix fontconfig detection code in FLTK.

Either clang is stricter than the compiler the authors of that
code used, or fontconfig detection never worked.
This commit is contained in:
whitequark 2015-03-19 16:44:56 +03:00
parent 80046672ef
commit 13afcb310e

View File

@ -928,14 +928,14 @@ void LoadAllFontFiles(void)
FcFontSet *fs = FcFontList(0, pat, os); FcFontSet *fs = FcFontList(0, pat, os);
for(int i = 0; i < fs->nfont; i++) { for(int i = 0; i < fs->nfont; i++) {
char *s = FcPatternFormat(fs->fonts[i], "%{file}"); char *s = (char*)FcPatternFormat(fs->fonts[i], (FcChar8*) "%{file}");
if(strlen(s)+1 <= MAX_PATH && fl_filename_match(s, "*.{TTF,ttf}") { if(strlen(s)+1 <= MAX_PATH && fl_filename_match(s, "*.{TTF,ttf}")) {
TtfFont tf; TtfFont tf;
ZERO(&tf); ZERO(&tf);
strcpy(tf.fontFile, s); strcpy(tf.fontFile, s);
SS.fonts.l.Add(&tf); SS.fonts.l.Add(&tf);
} }
FcStrFree(s); FcStrFree((FcChar8*) s);
} }
FcFontSetDestroy(fs); FcFontSetDestroy(fs);