]> granicus.if.org Git - libass/commitdiff
fontselect: call match_fonts for each alias
authorGrigori Goronzy <greg@chown.ath.cx>
Mon, 7 Sep 2015 08:27:26 +0000 (10:27 +0200)
committerGrigori Goronzy <greg@chown.ath.cx>
Mon, 7 Sep 2015 08:27:26 +0000 (10:27 +0200)
In case a font provider actually uses more than one substitution.

libass/ass_fontselect.c

index 0c37bb5eccad102dcfabae6ff8256602e7af4e64..fbdfacedd335f3b5a4e586098221442ba313eff1 100644 (file)
@@ -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);
     }