diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c index b66dad7e60..34ffdb8519 100644 --- a/libass/ass_fontconfig.c +++ b/libass/ass_fontconfig.c @@ -150,11 +150,13 @@ static char* _select_font(fc_instance_t* priv, const char* family, unsigned bold if (curf >= fset->nfont) goto error; +#if (FC_VERSION >= 20297) // Remove all extra family names from original pattern. // After this, FcFontRenderPrepare will select the most relevant family // name in case there are more than one of them. for (; family_cnt > 1; --family_cnt) FcPatternRemove(pat, FC_FAMILY, family_cnt - 1); +#endif rpat = FcFontRenderPrepare(priv->config, pat, fset->fonts[curf]); if (!rpat)