[Fontconfig] fontconfig: Branch 'main'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Feb 27 07:17:57 UTC 2023


 src/fcfreetype.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit a6a169572204dd86f4ab462ef505d98fdfd82d76
Author: msizanoen1 <msizanoen at qtmlabs.xyz>
Date:   Wed Feb 22 21:53:17 2023 +0700

    Reload MM/VF metadata for each font face in font collection
    
    This ensures that the MM/VF metadata is the correct metadata for each
    font face instead of whatever happens to be in the first one in the
    collection.

diff --git a/src/fcfreetype.c b/src/fcfreetype.c
index 8ae88bd..636ee4f 100644
--- a/src/fcfreetype.c
+++ b/src/fcfreetype.c
@@ -2350,12 +2350,26 @@ skip:
 	    cs = NULL;
 	    FT_Done_Face (face);
 	    face = NULL;
+#ifdef HAVE_FT_DONE_MM_VAR
+	    FT_Done_MM_Var (ftLibrary, mm_var);
+#else
+	    free (mm_var);
+#endif
+	    mm_var = NULL;
 
 	    face_num++;
 	    instance_num = set_instance_num;
 
 	    if (FT_New_Face (ftLibrary, (const char *) file, face_num, &face))
 	      break;
+
+	    num_instances = face->style_flags >> 16;
+	    if (num_instances && (!index_set || instance_num))
+	    {
+		FT_Get_MM_Var (face, &mm_var);
+		if (!mm_var)
+		    num_instances = 0;
+	    }
 	}
     } while (!err && (!index_set || face_num == set_face_num) && face_num < num_faces);
 


More information about the Fontconfig mailing list