From e8184dc502d0669b897aa5867af1489fc37c2e5a Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Fri, 3 Nov 2017 18:44:31 +0900 Subject: [PATCH] diag helper v2 --- win32ss/gdi/ntgdi/freetype.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 5fb58cf3e4..025e22b64d 100644 --- a/win32ss/gdi/ntgdi/freetype.c +++ b/win32ss/gdi/ntgdi/freetype.c @@ -33,7 +33,7 @@ #include #include "font.h" -#define NDEBUG +//#define NDEBUG #include /* TPMF_FIXED_PITCH is confusing; brain-dead api */ @@ -3742,7 +3742,7 @@ ftGdiGetTextCharsetInfo( fs.fsCsb[0] |= FS_SYMBOL; } } - DPRINT("Csb 1=%x 0=%x\n", fs.fsCsb[1],fs.fsCsb[0]); + //DPRINT("Csb 1=%x 0=%x\n", fs.fsCsb[1],fs.fsCsb[0]); if (fs.fsCsb[0] == 0) { /* Let's see if we can find any interesting cmaps */ for (i = 0; i < Face->num_charmaps; i++) @@ -3772,7 +3772,7 @@ ftGdiGetTextCharsetInfo( if (IntTranslateCharsetInfo(&cp, &csi, TCI_SRCCODEPAGE)) if (csi.fs.fsCsb[0] & fs.fsCsb[0]) { - DPRINT("Hit 1\n"); + //DPRINT("Hit 1\n"); Ret = csi.ciCharset; goto Exit; } @@ -3785,7 +3785,7 @@ ftGdiGetTextCharsetInfo( if (IntTranslateCharsetInfo(&fs0, &csi, TCI_SRCFONTSIG)) { // *cp = csi.ciACP; - DPRINT("Hit 2\n"); + //DPRINT("Hit 2\n"); Ret = csi.ciCharset; goto Exit; } @@ -3794,7 +3794,7 @@ ftGdiGetTextCharsetInfo( } } Exit: - DPRINT("CharSet %u CodePage %u\n", csi.ciCharset, csi.ciACP); + //DPRINT("CharSet %u CodePage %u\n", csi.ciCharset, csi.ciACP); return (MAKELONG(csi.ciACP, csi.ciCharset)); } @@ -4396,6 +4396,12 @@ FindBestFontFromList(FONTOBJ **FontObj, ULONG *MatchPenalty, OldOtmSize = OtmSize; Penalty = GetFontPenalty(LogFont, Otm, Face->style_name); + if (memcmp(LogFont->lfFaceName, L"Sun Sans", 16) == 0 && + memcmp(Face->family_name, "Libre Franklin", 14) == 0) + { + DPRINT("Libre Franklin's style_name: %s, Penalty: %lu, lfWeight: %ld, tmWeight: %ld\n", + Face->style_name, Penalty, LogFont->lfWeight, Otm->otmTextMetrics.tmWeight); + } if (*MatchPenalty == 0xFFFFFFFF || Penalty < *MatchPenalty) { *FontObj = GDIToObj(FontGDI, FONT); @@ -5452,9 +5458,9 @@ GreExtTextOutW( FT_Get_Kerning(face, previous, glyph_index, 0, &delta); TextLeft += delta.x; } - DPRINT("TextLeft: %I64d\n", TextLeft); - DPRINT("TextTop: %lu\n", TextTop); - DPRINT("Advance: %d\n", realglyph->root.advance.x); + //DPRINT("TextLeft: %I64d\n", TextLeft); + //DPRINT("TextTop: %lu\n", TextTop); + //DPRINT("Advance: %d\n", realglyph->root.advance.x); DestRect.left = BackgroundLeft; DestRect.right = (TextLeft + (realglyph->root.advance.x >> 10) + 32) >> 6; @@ -5493,7 +5499,7 @@ GreExtTextOutW( if (NULL == Dx) { TextLeft += realglyph->root.advance.x >> 10; - DPRINT("New TextLeft: %I64d\n", TextLeft); + //DPRINT("New TextLeft: %I64d\n", TextLeft); } else { @@ -5505,7 +5511,7 @@ GreExtTextOutW( /* do the shift before multiplying to preserve precision */ FLOATOBJ_MulLong(&Scale, Dx[i<root.advance.x); + //DPRINT("TextLeft: %I64d\n", TextLeft); + //DPRINT("TextTop: %lu\n", TextTop); + //DPRINT("Advance: %d\n", realglyph->root.advance.x); if ((fuOptions & ETO_OPAQUE) && !plf->lfItalic) { @@ -5757,7 +5763,7 @@ GreExtTextOutW( if (NULL == Dx) { TextLeft += realglyph->root.advance.x >> 10; - DPRINT("New TextLeft: %I64d\n", TextLeft); + //DPRINT("New TextLeft: %I64d\n", TextLeft); } else { @@ -5769,7 +5775,7 @@ GreExtTextOutW( /* do the shift before multiplying to preserve precision */ FLOATOBJ_MulLong(&Scale, Dx[i<