]> granicus.if.org Git - libass/commitdiff
font: fix broken charmap fallback handling
authorwm4 <wm4@nowhere>
Fri, 28 Aug 2015 15:39:08 +0000 (17:39 +0200)
committerwm4 <wm4@nowhere>
Fri, 28 Aug 2015 15:39:08 +0000 (17:39 +0200)
An earlier commit added this code to avoid adding font faces multiple
times. In this form, it breaks the "Trying all charmaps" fallback case,
which can lead to text being rendered as boxes.

Return the font that is going to contain the missing glyph instead. The
calling code will check again, and run the fallback if necessary.

libass/ass_font.c

index 9a81dca7cd6429bf5b7a3959be69d224d61f5122..0ba79ad2d491114c6f54d4c199c155dce46acf42 100644 (file)
@@ -154,7 +154,7 @@ static int add_face(ASS_FontSelector *fontsel, ASS_Font *font, uint32_t ch)
             ass_msg(font->library, MSGL_INFO,
                     "Got a font face that already is available! Skipping.");
             free(path);
-            return -1;
+            return i;
         }
     }