diff options
Diffstat (limited to 'fontconfig/src')
-rw-r--r-- | fontconfig/src/fccfg.c | 6 | ||||
-rw-r--r-- | fontconfig/src/fcdir.c | 4 | ||||
-rw-r--r-- | fontconfig/src/fcrange.c | 2 | ||||
-rw-r--r-- | fontconfig/src/fcxml.c | 23 |
4 files changed, 29 insertions, 6 deletions
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index b92270b64..cc2d9ee63 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -1843,6 +1843,7 @@ FcConfigSubstitute (FcConfig *config, #if defined (_WIN32) static FcChar8 fontconfig_path[1000] = ""; /* MT-dontcare */ +FcChar8 fontconfig_instprefix[1000] = ""; /* MT-dontcare */ # if (defined (PIC) || defined (DLL_EXPORT)) @@ -1877,6 +1878,7 @@ DllMain (HINSTANCE hinstDLL, if (p && (FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "bin") == 0 || FcStrCmpIgnoreCase (p + 1, (const FcChar8 *) "lib") == 0)) *p = '\0'; + strcat ((char *) fontconfig_instprefix, (char *) fontconfig_path); strcat ((char *) fontconfig_path, "\\etc\\fonts"); } else @@ -2227,7 +2229,9 @@ FcConfigAppFontAddFile (FcConfig *config, FcStrSetDestroy (subdirs); return FcFalse; } - if ((sublist = FcStrListCreate (subdirs))) + if (subdirs->num == 0) + ret = FcTrue; + else if ((sublist = FcStrListCreate (subdirs))) { while ((subdir = FcStrListNext (sublist))) { diff --git a/fontconfig/src/fcdir.c b/fontconfig/src/fcdir.c index 593382f43..2e7f0dc7c 100644 --- a/fontconfig/src/fcdir.c +++ b/fontconfig/src/fcdir.c @@ -136,8 +136,8 @@ FcFileScanFontConfig (FcFontSet *set, ret = FcFalse; } } - else if (font) - FcPatternDestroy (font); + else + ret = FcFalse; id++; } while (font && ret && id < count); return ret; diff --git a/fontconfig/src/fcrange.c b/fontconfig/src/fcrange.c index 37cf06755..9b1b67b82 100644 --- a/fontconfig/src/fcrange.c +++ b/fontconfig/src/fcrange.c @@ -204,7 +204,7 @@ FcRangeHash (const FcRange *r) { FcRange c = FcRangeCanonicalize (r); int b = (int) (c.u.d.begin * 100); - int e = (int) (c.u.d.end * 100); + int e = FcDoubleCmpEQ (c.u.d.end, DBL_MAX) ? INT_MAX : (int) (c.u.d.end * 100); return b ^ (b << 1) ^ (e << 9); } diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index e937c51fb..a483797ac 100644 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -54,6 +54,7 @@ #ifdef _WIN32 #include <mbstring.h> +extern FcChar8 fontconfig_instprefix[]; #endif static void @@ -2188,7 +2189,25 @@ FcParseCacheDir (FcConfigParse *parse) data = prefix; } #ifdef _WIN32 - if (strcmp ((const char *) data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0) + else if (data[0] == '/' && fontconfig_instprefix[0] != '\0') + { + size_t plen = strlen ((const char *)fontconfig_instprefix); + size_t dlen = strlen ((const char *)data); + + prefix = malloc (plen + 1 + dlen + 1); + if (!prefix) + { + FcConfigMessage (parse, FcSevereError, "out of memory"); + goto bail; + } + strcpy ((char *) prefix, (char *) fontconfig_instprefix); + prefix[plen] = FC_DIR_SEPARATOR; + memcpy (&prefix[plen + 1], data, dlen); + prefix[plen + 1 + dlen] = 0; + FcStrFree (data); + data = prefix; + } + else if (strcmp ((const char *) data, "WINDOWSTEMPDIR_FONTCONFIG_CACHE") == 0) { int rc; FcStrFree (data); @@ -2266,8 +2285,8 @@ FcParseInclude (FcConfigParse *parse) attr = FcConfigGetAttribute (parse, "ignore_missing"); if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue) ignore_missing = FcTrue; -#ifndef _WIN32 attr = FcConfigGetAttribute (parse, "deprecated"); +#ifndef _WIN32 if (attr && FcConfigLexBool (parse, (FcChar8 *) attr) == FcTrue) deprecated = FcTrue; #endif |