aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--libass/ass_fontconfig.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c
index 3c1ea61148..53dfd17335 100644
--- a/libass/ass_fontconfig.c
+++ b/libass/ass_fontconfig.c
@@ -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);