From d4f283b67b36511fd894f6cc1a1d7a5c2ec53360 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Mon, 20 Jan 2025 22:09:16 +0900 Subject: [PATCH] [FREETYPE][NTGDI] Use Face->num_faces instead of ttc_header.count (#7646) Supporting raster fonts. Using num_faces is the generic way. JIRA issue: CORE-16165 - Use FT_FaceRec.num_faces instead of TT_Face.ttc_header.count in counting the font faces in IntGdiLoadFontsFromMemory function. --- win32ss/gdi/ntgdi/freetype.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 86e3c7a4106..86efc2e2c30 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -1986,17 +1986,10 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont, if (FontIndex == -1) { - if (FT_IS_SFNT(Face)) + FT_Long iFace, num_faces = Face->num_faces; + for (iFace = 1; iFace < num_faces; ++iFace) { - TT_Face TrueType = (TT_Face)Face; - if (TrueType->ttc_header.count > 1) - { - FT_Long i; - for (i = 1; i < TrueType->ttc_header.count; ++i) - { - FaceCount += IntGdiLoadFontsFromMemory(pLoadFont, NULL, i, -1); - } - } + FaceCount += IntGdiLoadFontsFromMemory(pLoadFont, NULL, iFace, -1); } FontIndex = 0; }