Author: mjansen Date: Fri Apr 14 18:24:44 2017 New Revision: 74310
URL: http://svn.reactos.org/svn/reactos?rev=74310&view=rev Log: [WIN32SS] Count number of faces added instead of fonts in IntGdiLoadFontsFromMemory. This fixes displaying embedded fonts in firefox. CORE-13046 CORE-13056
Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype.... ============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Fri Apr 14 18:24:44 2017 @@ -771,7 +771,7 @@ FT_Face Face; ANSI_STRING AnsiFaceName; FT_WinFNT_HeaderRec WinFNT; - INT FontCount = 0, CharSetCount = 0; + INT FaceCount = 0, CharSetCount = 0; PUNICODE_STRING pFileName = pLoadFont->pFileName; DWORD Characteristics = pLoadFont->Characteristics; PUNICODE_STRING pValueName = &pLoadFont->RegValueName; @@ -971,7 +971,7 @@ FontGDI->CharSet = SYMBOL_CHARSET; }
- ++FontCount; + ++FaceCount; DPRINT("Font loaded: %s (%s)\n", Face->family_name, Face->style_name); DPRINT("Num glyphs: %d\n", Face->num_glyphs); DPRINT("CharSet: %d\n", FontGDI->CharSet); @@ -1006,7 +1006,7 @@ FT_Long i; for (i = 1; i < TrueType->ttc_header.count; ++i) { - FontCount += IntGdiLoadFontsFromMemory(pLoadFont, NULL, i, -1); + FaceCount += IntGdiLoadFontsFromMemory(pLoadFont, NULL, i, -1); } } } @@ -1042,11 +1042,12 @@
for (i = 1; i < CharSetCount; ++i) { - FontCount += IntGdiLoadFontsFromMemory(pLoadFont, SharedFace, FontIndex, i); - } - } - - return FontCount; /* number of loaded fonts */ + /* Do not count charsets towards 'faces' loaded */ + IntGdiLoadFontsFromMemory(pLoadFont, SharedFace, FontIndex, i); + } + } + + return FaceCount; /* number of loaded faces */ }
/* @@ -1172,7 +1173,7 @@ { GDI_LOAD_FONT LoadFont; FONT_ENTRY_COLL_MEM* EntryCollection; - INT FontCount; + INT FaceCount; HANDLE Ret = 0;
PVOID BufferCopy = ExAllocatePoolWithTag(PagedPool, dwSize, TAG_FONT); @@ -1190,7 +1191,7 @@ RtlInitUnicodeString(&LoadFont.RegValueName, NULL); LoadFont.IsTrueType = FALSE; LoadFont.PrivateEntry = NULL; - FontCount = IntGdiLoadFontsFromMemory(&LoadFont, NULL, -1, -1); + FaceCount = IntGdiLoadFontsFromMemory(&LoadFont, NULL, -1, -1);
RtlFreeUnicodeString(&LoadFont.RegValueName);
@@ -1199,7 +1200,7 @@ SharedMem_Release(LoadFont.Memory); IntUnLockFreeType;
- if (FontCount > 0) + if (FaceCount > 0) { EntryCollection = ExAllocatePoolWithTag(PagedPool, sizeof(FONT_ENTRY_COLL_MEM), TAG_FONT); if (EntryCollection) @@ -1213,7 +1214,7 @@ Ret = (HANDLE)EntryCollection->Handle; } } - *pNumAdded = FontCount; + *pNumAdded = FaceCount;
return Ret; }