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
This commit is contained in:
Timo Kreuzer 2015-11-01 23:40:31 +00:00
parent ee7e189a4e
commit 9eddb5e906
2 changed files with 25 additions and 8 deletions

View file

@ -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,

View file

@ -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)