]> granicus.if.org Git - libass/commitdiff
Fix compilation with FontConfig <= 2.2.96.
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Thu, 22 May 2008 08:58:06 +0000 (08:58 +0000)
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Thu, 22 May 2008 08:58:06 +0000 (08:58 +0000)
It lacks FcPatternRemove function. The code will work fine, but produce an
incorrect "Selected font is not the requested one" warning in rare cases.

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

libass/ass_fontconfig.c

index b66dad7e604458b2dbd3e92e039d9ed7caeebe1b..34ffdb85195f4ca394711a67ae09f5a6c22da0e8 100644 (file)
@@ -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)