]> granicus.if.org Git - libass/commitdiff
Support multiple faces per attachment correctly
authorGrigori Goronzy <greg@blackbox>
Sat, 17 Apr 2010 20:59:47 +0000 (22:59 +0200)
committerGrigori Goronzy <greg@blackbox>
Sat, 17 Apr 2010 20:59:47 +0000 (22:59 +0200)
Store the real font face id instead of using 0 all the time and use the
real font face id for font lookup as well. This makes font attachments
with multiple faces work correctly.

Thanks to ubitux and uau!

libass/ass_font.c
libass/ass_fontconfig.c

index c8e84c540984156620cf2fa26bcf1339a4253404..5ac2a3101cc999f4c5b0a13457d791dc54f70b24 100644 (file)
@@ -130,7 +130,7 @@ static int add_face(void *fc_priv, ASS_Font *font, uint32_t ch)
             FT_New_Memory_Face(font->ftlibrary,
                                (unsigned char *) font->library->
                                fontdata[mem_idx].data,
-                               font->library->fontdata[mem_idx].size, 0,
+                               font->library->fontdata[mem_idx].size, index,
                                &face);
         if (error) {
             ass_msg(font->library, MSGL_WARN,
index 0150b2e955c6a3a4ef85e44b52b656d5db8117d9..b1686ff45702d85ecaa1fd7516b91e305f1c5058 100644 (file)
@@ -369,7 +369,7 @@ static void process_fontdata(FCInstance *priv, ASS_Library *library,
         num_faces = face->num_faces;
 
         pattern =
-            FcFreeTypeQueryFace(face, (unsigned char *) name, 0,
+            FcFreeTypeQueryFace(face, (unsigned char *) name, face_index,
                                 FcConfigGetBlanks(priv->config));
         if (!pattern) {
             ass_msg(library, MSGL_WARN, "%s failed", "FcFreeTypeQueryFace");