From 946e1645c53265715d3fc62410f00b76e178bc76 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Fri, 3 Nov 2017 16:46:44 +0900 Subject: [PATCH] font weight diag helper --- win32ss/gdi/ntgdi/freetype.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c index 5fb58cf3e4..07fab83594 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; } @@ -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)); } @@ -4505,6 +4505,11 @@ TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj) else { PFONTGDI FontGdi = ObjToGDI(TextObj->Font, FONT); + + DPRINT("%s: OriginalWeight: %ld, RequestWeight: %ld\n", + FontGdi->SharedFace->Face->family_name, + FontGdi->OriginalWeight, FontGdi->RequestWeight); + // Need hdev, when freetype is loaded need to create DEVOBJ for // Consumer and Producer. TextObj->Font->iUniq = 1; // Now it can be cached. @@ -5452,9 +5457,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 +5498,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 +5510,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) { -- 2.14.2