From db8856e6485a5f8bab23869f49477aeb2a227328 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 7 Sep 2015 10:27:26 +0200 Subject: fontselect: call match_fonts for each alias In case a font provider actually uses more than one substitution. --- libass/ass_fontselect.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libass') diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c index 0c37bb5..fbdface 100644 --- a/libass/ass_fontselect.c +++ b/libass/ass_fontselect.c @@ -607,9 +607,12 @@ static char *select_font(ASS_FontSelector *priv, ASS_Library *library, // on demand, and retry the search for a match. if (result == NULL && name_match == false && default_provider && default_provider->funcs.match_fonts) { - // FIXME: what if substitution adds more than one alias? - default_provider->funcs.match_fonts(library, default_provider, - meta.fullnames[0]); + // TODO: consider changing the API to make more efficient + // implementations possible. + for (int i = 0; i < meta.n_fullname; i++) { + default_provider->funcs.match_fonts(library, default_provider, + meta.fullnames[i]); + } result = find_font(priv, library, meta, bold, italic, index, postscript_name, uid, stream, code, &name_match); } -- cgit v1.2.3