mirror of https://github.com/mpv-player/mpv
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:
parent
4680beb6dc
commit
b711624ef3
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue