https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d4f283b67b36511fd894f…
commit d4f283b67b36511fd894f6cc1a1d7a5c2ec53360
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Jan 20 22:09:16 2025 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Jan 20 22:09:16 2025 +0900
[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;
}