Skip to content

Commit d4f283b

Browse files
authored
[FREETYPE][NTGDI] Use Face->num_faces instead of ttc_header.count (reactos#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.
1 parent d72864d commit d4f283b

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

win32ss/gdi/ntgdi/freetype.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,17 +1986,10 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont,
19861986

19871987
if (FontIndex == -1)
19881988
{
1989-
if (FT_IS_SFNT(Face))
1989+
FT_Long iFace, num_faces = Face->num_faces;
1990+
for (iFace = 1; iFace < num_faces; ++iFace)
19901991
{
1991-
TT_Face TrueType = (TT_Face)Face;
1992-
if (TrueType->ttc_header.count > 1)
1993-
{
1994-
FT_Long i;
1995-
for (i = 1; i < TrueType->ttc_header.count; ++i)
1996-
{
1997-
FaceCount += IntGdiLoadFontsFromMemory(pLoadFont, NULL, i, -1);
1998-
}
1999-
}
1992+
FaceCount += IntGdiLoadFontsFromMemory(pLoadFont, NULL, iFace, -1);
20001993
}
20011994
FontIndex = 0;
20021995
}

0 commit comments

Comments
 (0)