From 0a01f37eb874821a8a1bc281fd16d75609ebe133 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Fri, 28 Apr 2006 12:51:36 +0100 Subject: [PATCH] gdi32: FcPatternGet( FC_FILE ) only returns the basename as of fontconfig 2.3.92 . FcPatternGetString( FC_FILE ) returns the whole path. Go figure. --- dlls/gdi/freetype.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dlls/gdi/freetype.c b/dlls/gdi/freetype.c index 1c923ecabef..4edac76060c 100644 --- a/dlls/gdi/freetype.c +++ b/dlls/gdi/freetype.c @@ -150,7 +150,7 @@ MAKE_FUNCPTR(FcObjectSetCreate); MAKE_FUNCPTR(FcObjectSetDestroy); MAKE_FUNCPTR(FcPatternCreate); MAKE_FUNCPTR(FcPatternDestroy); -MAKE_FUNCPTR(FcPatternGet); +MAKE_FUNCPTR(FcPatternGetString); #ifndef SONAME_LIBFONTCONFIG #define SONAME_LIBFONTCONFIG "libfontconfig.so" #endif @@ -1173,7 +1173,6 @@ static void load_fontconfig_fonts(void) FcPattern *pat; FcObjectSet *os; FcFontSet *fontset; - FcValue v; int i, len; const char *file, *ext; @@ -1193,7 +1192,7 @@ LOAD_FUNCPTR(FcObjectSetCreate); LOAD_FUNCPTR(FcObjectSetDestroy); LOAD_FUNCPTR(FcPatternCreate); LOAD_FUNCPTR(FcPatternDestroy); -LOAD_FUNCPTR(FcPatternGet); +LOAD_FUNCPTR(FcPatternGetString); #undef LOAD_FUNCPTR if(!pFcInit()) return; @@ -1205,10 +1204,8 @@ LOAD_FUNCPTR(FcPatternGet); fontset = pFcFontList(config, pat, os); if(!fontset) return; for(i = 0; i < fontset->nfont; i++) { - if(pFcPatternGet(fontset->fonts[i], FC_FILE, 0, &v) != FcResultMatch) + if(pFcPatternGetString(fontset->fonts[i], FC_FILE, 0, (FcChar8**)&file) != FcResultMatch) continue; - if(v.type != FcTypeString) continue; - file = (LPCSTR) v.u.s; TRACE("fontconfig: %s\n", file); /* We're just interested in OT/TT fonts for now, so this hack just