From 9eddb5e9065c7106110b23826e38f159d1f764c0 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 1 Nov 2015 23:40:31 +0000 Subject: [PATCH] [WIN32K] Only scale characters with the world-to-device transform, when the graphics mode is GM_ADVANCED. Fixes Petzold's WhatSize testapp. CORE-7154 #resolve svn path=/trunk/; revision=69782 --- reactos/win32ss/gdi/ntgdi/dclife.c | 6 +++--- reactos/win32ss/gdi/ntgdi/freetype.c | 27 ++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/dclife.c b/reactos/win32ss/gdi/ntgdi/dclife.c index d18fec4510e..24ea0498e77 100644 --- a/reactos/win32ss/gdi/ntgdi/dclife.c +++ b/reactos/win32ss/gdi/ntgdi/dclife.c @@ -17,7 +17,7 @@ PSURFACE psurfDefaultBitmap = NULL; PBRUSH pbrDefaultBrush = NULL; -static const MATRIX gmxWorldToDeviceDefault = +const MATRIX gmxWorldToDeviceDefault = { FLOATOBJ_16, FLOATOBJ_0, FLOATOBJ_0, FLOATOBJ_16, @@ -25,7 +25,7 @@ static const MATRIX gmxWorldToDeviceDefault = 0, 0, 0x4b }; -static const MATRIX gmxDeviceToWorldDefault = +const MATRIX gmxDeviceToWorldDefault = { FLOATOBJ_1_16, FLOATOBJ_0, FLOATOBJ_0, FLOATOBJ_1_16, @@ -33,7 +33,7 @@ static const MATRIX gmxDeviceToWorldDefault = 0, 0, 0x53 }; -static const MATRIX gmxWorldToPageDefault = +const MATRIX gmxWorldToPageDefault = { FLOATOBJ_1, FLOATOBJ_0, FLOATOBJ_0, FLOATOBJ_1, diff --git a/reactos/win32ss/gdi/ntgdi/freetype.c b/reactos/win32ss/gdi/ntgdi/freetype.c index 6fc34bbccde..58b4e4be613 100644 --- a/reactos/win32ss/gdi/ntgdi/freetype.c +++ b/reactos/win32ss/gdi/ntgdi/freetype.c @@ -30,6 +30,12 @@ ((DWORD)(BYTE)(ch2) << 8) | (DWORD)(BYTE)(ch3) ) #endif +extern const MATRIX gmxWorldToDeviceDefault; +extern const MATRIX gmxWorldToPageDefault; + +// HACK!! Fix XFORMOBJ then use 1:16 / 16:1 +#define gmxWorldToDeviceDefault gmxWorldToPageDefault + FT_Library library; typedef struct _FONT_ENTRY @@ -3520,16 +3526,27 @@ GreExtTextOutW( goto fail; } - pmxWorldToDevice = DC_pmxWorldToDevice(dc); - FtSetCoordinateTransform(face, pmxWorldToDevice); + if (dc->dcattr.iGraphicsMode == GM_ADVANCED) + { + pmxWorldToDevice = DC_pmxWorldToDevice(dc); + FtSetCoordinateTransform(face, pmxWorldToDevice); + + fixAscender = ScaleLong(face->size->metrics.ascender, &pmxWorldToDevice->efM22); + fixDescender = ScaleLong(face->size->metrics.descender, &pmxWorldToDevice->efM22); + } + else + { + pmxWorldToDevice = (PMATRIX)&gmxWorldToDeviceDefault; + FtSetCoordinateTransform(face, pmxWorldToDevice); + + fixAscender = face->size->metrics.ascender; + fixDescender = face->size->metrics.descender; + } /* * Process the vertical alignment and determine the yoff. */ - fixAscender = ScaleLong(face->size->metrics.ascender, &pmxWorldToDevice->efM22); - fixDescender = ScaleLong(face->size->metrics.descender, &pmxWorldToDevice->efM22); - if (pdcattr->lTextAlign & TA_BASELINE) yoff = 0; else if (pdcattr->lTextAlign & TA_BOTTOM)