]> granicus.if.org Git - libass/commitdiff
Don't call FcDirScan/FcDirSave with FontConfig >= 2.4.
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Tue, 19 Sep 2006 13:06:44 +0000 (13:06 +0000)
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Tue, 19 Sep 2006 13:06:44 +0000 (13:06 +0000)
Font cache is updated automatically in FcConfigAppFontAddDir.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19907 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass_fontconfig.c

index 3c1ea61148e18c16d416e21dcf6c135920e05378..53dfd17335d3ff5139490a2e72508e7e7097f758 100644 (file)
@@ -154,9 +154,11 @@ fc_instance_t* fontconfig_init(const char* dir, const char* family, const char*
 
        if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse)
        {
+               mp_msg(MSGT_GLOBAL, MSGL_INFO, "[ass] Updating font cache\n");
+               // FontConfig >= 2.4.0 updates cache automatically in FcConfigAppFontAddDir()
+               if (FcGetVersion() < 20400) {
                FcFontSet* fcs;
                FcStrSet* fss;
-               mp_msg(MSGT_GLOBAL, MSGL_INFO, "[ass] Updating font cache\n");
                fcs = FcFontSetCreate();
                fss = FcStrSetCreate();
                rc = FcStrSetAdd(fss, (const FcChar8*)dir);
@@ -178,6 +180,7 @@ fc_instance_t* fontconfig_init(const char* dir, const char* family, const char*
                }
        ErrorFontCache:
                ;
+               }
        }
 
        rc = FcConfigAppFontAddDir(priv->config, (const FcChar8*)dir);