summaryrefslogtreecommitdiffstats
path: root/libass/ass_fontconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'libass/ass_fontconfig.c')
-rw-r--r--libass/ass_fontconfig.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c
index d0042dcdfd..a54bc8c4af 100644
--- a/libass/ass_fontconfig.c
+++ b/libass/ass_fontconfig.c
@@ -160,11 +160,13 @@ static char* _select_font(fc_instance_t* priv, const char* family, int treat_fam
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);
+ if (!treat_family_as_pattern) {
+ // 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]);