diff options
author | msizanoen1 <msizanoen@qtmlabs.xyz> | 2023-02-22 21:53:17 +0700 |
---|---|---|
committer | msizanoen1 <msizanoen@qtmlabs.xyz> | 2023-02-22 21:57:44 +0700 |
commit | a6a169572204dd86f4ab462ef505d98fdfd82d76 (patch) | |
tree | 91e6b83cd3bbe1ff59a12e6cc29e06a762095726 | |
parent | 89af138176855891d8cf3582253e511e5705c3be (diff) | |
download | fontconfig-a6a169572204dd86f4ab462ef505d98fdfd82d76.tar.gz |
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.
-rw-r--r-- | src/fcfreetype.c | 14 |
1 files changed, 14 insertions, 0 deletions
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); |