Don't call FcDirScan/FcDirSave with FontConfig >= 2.4.

Font cache is updated automatically in FcConfigAppFontAddDir.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19907 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2006-09-19 13:06:44 +00:00
parent a9a72d676a
commit 61d45a940d
1 changed files with 4 additions and 1 deletions

View 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);