https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7c9755b47dc8b193ea6d3d...
commit 7c9755b47dc8b193ea6d3dfc91a4767b4b559c4f Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Tue Jul 30 18:15:56 2019 +0900 Commit: GitHub noreply@github.com CommitDate: Tue Jul 30 18:15:56 2019 +0900
[WIN32SS][NTGDI] Fix and improve font dumping (#1768)
Fix and improve font dumping. CORE-16245 - FontGDI->FontObj is not a pointer. - "%s" does null check, so we remove redundant null checks. - Add FaceName and StyleName dumping. --- win32ss/gdi/ntgdi/freetype.c | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 3d94d788681..37ff3fbf5a7 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -382,11 +382,12 @@ static __inline FT_Fixed FT_FixedFromFIXED(FIXED f)
#if DBG -VOID DumpFontGDI(PFONTGDI FontGDI) +VOID DumpFontEntry(PFONT_ENTRY FontEntry) { const char *family_name; const char *style_name; FT_Face Face; + PFONTGDI FontGDI = FontEntry->Font;
if (!FontGDI) { @@ -398,12 +399,7 @@ VOID DumpFontGDI(PFONTGDI FontGDI) if (Face) { family_name = Face->family_name; - if (!family_name) - family_name = "<NULL>"; - style_name = Face->style_name; - if (!style_name) - style_name = "<NULL>"; } else { @@ -411,32 +407,32 @@ VOID DumpFontGDI(PFONTGDI FontGDI) style_name = "<invalid>"; }
- DPRINT("family_name '%s', style_name '%s', FontGDI %p, FontObj %p, iUnique %lu, SharedFace %p, Face %p, CharSet %u, Filename '%S'\n", - family_name, - style_name, - FontGDI, - FontGDI->FontObj, - FontGDI->iUnique, - FontGDI->SharedFace, - Face, - FontGDI->CharSet, - FontGDI->Filename); + DPRINT("family_name '%s', style_name '%s', FaceName '%wZ', StyleName '%wZ', FontGDI %p, " + "FontObj %p, iUnique %lu, SharedFace %p, Face %p, CharSet %u, Filename '%S'\n", + family_name, + style_name, + &FontEntry->FaceName, + &FontEntry->StyleName, + FontGDI, + &FontGDI->FontObj, + FontGDI->iUnique, + FontGDI->SharedFace, + Face, + FontGDI->CharSet, + FontGDI->Filename); }
VOID DumpFontList(PLIST_ENTRY Head) { PLIST_ENTRY Entry; PFONT_ENTRY CurrentEntry; - PFONTGDI FontGDI;
DPRINT("## DumpFontList(%p)\n", Head);
for (Entry = Head->Flink; Entry != Head; Entry = Entry->Flink) { CurrentEntry = CONTAINING_RECORD(Entry, FONT_ENTRY, ListEntry); - FontGDI = CurrentEntry->Font; - - DumpFontGDI(FontGDI); + DumpFontEntry(CurrentEntry); } }
@@ -1365,11 +1361,8 @@ IntGdiLoadFontsFromMemory(PGDI_LOAD_FONT pLoadFont) Entry->NotEnum = (Characteristics & FR_NOT_ENUM); InsertTailList(&LoadedFontList, &Entry->ListEntry);
- DPRINT("Font loaded: %s (%s)\n", - Face->family_name ? Face->family_name : "<NULL>", - Face->style_name ? Face->style_name : "<NULL>"); - DPRINT("Num glyphs: %d\n", Face->num_glyphs); - DPRINT("CharSet: %d\n", FontGDI->CharSet); + DPRINT("Font loaded: %s (%s), CharSet %u, Num glyphs %d\n", + Face->family_name, Face->style_name, FontGDI->CharSet, Face->num_glyphs); }
IntLockFreeType();