subs: only use "subfont.ttf" as libass fallback if it exists

Libass was set to use the file "subfont.ttf" in the user configuration
directory as a default/fallback font. This triggered "Error opening
font" errors from libass if it tried to use the fallback font for some
glyph and the user had not copied/linked any font there (and there is
generally little reason to do that nowadays when using fontconfig).
Check whether the path exists and only set it in ass_set_fonts() if it
does.
This commit is contained in:
Uoti Urpala 2012-04-14 03:51:19 +03:00
parent 4680beb6dc
commit b711624ef3
1 changed files with 6 additions and 1 deletions

View File

@ -266,8 +266,13 @@ void mp_ass_configure_fonts(ASS_Renderer *priv)
path = strdup(sub_font_name);
else if (font_fontconfig < 0 && font_name)
path = strdup(font_name);
else
else {
path = get_path("subfont.ttf");
if (!mp_path_exists(path)) {
free(path);
path = NULL;
}
}
if (font_fontconfig >= 0 && sub_font_name)
family = strdup(sub_font_name);
else if (font_fontconfig >= 0 && font_name)