diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2013-05-06 17:35:17 +0300 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2013-05-14 00:07:56 +0200 |
commit | b634305c6740dc056bbe994d6250abd2572e8c31 (patch) | |
tree | 174ece1272044f4e1166b60ab838ce89f22ee71b | |
parent | ed55e32911166173011be36f03ebb24ce08efdae (diff) | |
download | libass-b634305c6740dc056bbe994d6250abd2572e8c31.tar.bz2 libass-b634305c6740dc056bbe994d6250abd2572e8c31.tar.xz |
fontconfig: remove default "lang" setting from patterns
Fontconfig defaults set the "lang" value in patterns, and it then
prefers fonts which are listed as supporting this language. The
default value may not match actual script language, and even a setting
of "en" for English subtitle can cause problems. Remove the "lang"
setting from patterns used to find fonts.
A file had a normal and an oblique version of the same font attached,
with different character set coverage: the normal version lacked some
non-ascii characters that fontconfig includes in its list of
characters required for English support. As a result, the oblique
version was picked for what was supposed to be normal text.
-rw-r--r-- | libass/ass_fontconfig.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libass/ass_fontconfig.c b/libass/ass_fontconfig.c index 33ef976..d3dddea 100644 --- a/libass/ass_fontconfig.c +++ b/libass/ass_fontconfig.c @@ -179,6 +179,14 @@ static char *select_font(ASS_Library *library, FCInstance *priv, rc = FcConfigSubstitute(priv->config, pat, FcMatchPattern); if (!rc) goto error; + /* Fontconfig defaults include a language setting, which it sets based on + * some environment variables or defaults to "en". Unset this as we don't + * know the real language, and because some some attached fonts lack + * non-ascii characters included in fontconfig's list of characters + * required for English support and therefore don't match the lang=en + * criterion. + */ + FcPatternDel(pat, "lang"); fsorted = FcFontSort(priv->config, pat, FcTrue, NULL, &result); ffullname = match_fullname(library, priv, family, bold, italic); |