Author: tkreuzer
Date: Sun Nov 1 23:40:31 2015
New Revision: 69782
URL:
http://svn.reactos.org/svn/reactos?rev=69782&view=rev
Log:
[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
Modified:
trunk/reactos/win32ss/gdi/ntgdi/dclife.c
trunk/reactos/win32ss/gdi/ntgdi/freetype.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/dclife.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dclife.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] Sun Nov 1 23:40:31 2015
@@ -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 @@
0, 0, 0x4b
};
-static const MATRIX gmxDeviceToWorldDefault =
+const MATRIX gmxDeviceToWorldDefault =
{
FLOATOBJ_1_16, FLOATOBJ_0,
FLOATOBJ_0, FLOATOBJ_1_16,
@@ -33,7 +33,7 @@
0, 0, 0x53
};
-static const MATRIX gmxWorldToPageDefault =
+const MATRIX gmxWorldToPageDefault =
{
FLOATOBJ_1, FLOATOBJ_0,
FLOATOBJ_0, FLOATOBJ_1,
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] Sun Nov 1 23:40:31 2015
@@ -29,6 +29,12 @@
( ((DWORD)(BYTE)(ch0) << 24) | ((DWORD)(BYTE)(ch1) << 16) | \
((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;
@@ -3520,15 +3526,26 @@
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;