Author: tkreuzer
Date: Sun Mar 3 14:43:53 2013
New Revision: 58414
URL:
http://svn.reactos.org/svn/reactos?rev=58414&view=rev
Log:
[WIN32K]
Add support for arbitrary scaling matrices when rendering glyphs.
Partly fixes CORE-4657
Todo: handle glyph coordinates
Modified:
trunk/reactos/win32ss/drivers/font/ftfd/freetype.def
trunk/reactos/win32ss/drivers/font/ftfd/ftfd.spec
trunk/reactos/win32ss/gdi/ntgdi/freetype.c
Modified: trunk/reactos/win32ss/drivers/font/ftfd/freetype.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/font/ftfd/…
==============================================================================
--- trunk/reactos/win32ss/drivers/font/ftfd/freetype.def [iso-8859-1] (original)
+++ trunk/reactos/win32ss/drivers/font/ftfd/freetype.def [iso-8859-1] Sun Mar 3 14:43:53
2013
@@ -27,3 +27,4 @@
FT_Set_Pixel_Sizes
FT_Vector_Transform
FT_Vector_Unit
+ FT_Set_Transform
Modified: trunk/reactos/win32ss/drivers/font/ftfd/ftfd.spec
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/drivers/font/ftfd/…
==============================================================================
--- trunk/reactos/win32ss/drivers/font/ftfd/ftfd.spec [iso-8859-1] (original)
+++ trunk/reactos/win32ss/drivers/font/ftfd/ftfd.spec [iso-8859-1] Sun Mar 3 14:43:53
2013
@@ -26,3 +26,4 @@
@ cdecl FT_Set_Pixel_Sizes()
@ cdecl FT_Vector_Transform()
@ cdecl FT_Vector_Unit()
+ @ cdecl FT_Set_Transform()
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 Mar 3 14:43:53 2013
@@ -158,6 +158,39 @@
return TRUE;
}
+VOID
+FtSetCoordinateTransform(
+ FT_Face face,
+ PDC pdc)
+{
+ FT_Matrix ftmatrix;
+ PMATRIX pmx;
+ FLOATOBJ efTemp;
+
+ /* Get the DC's world-to-device transformation matrix */
+ pmx = DC_pmxWorldToDevice(pdc);
+
+ /* Create a freetype matrix, by converting to 16.16 fixpoint format */
+ efTemp = pmx->efM11;
+ FLOATOBJ_MulLong(&efTemp, 0x00010000);
+ ftmatrix.xx = FLOATOBJ_GetLong(&efTemp);
+
+ efTemp = pmx->efM12;
+ FLOATOBJ_MulLong(&efTemp, 0x00010000);
+ ftmatrix.xy = FLOATOBJ_GetLong(&efTemp);
+
+ efTemp = pmx->efM21;
+ FLOATOBJ_MulLong(&efTemp, 0x00010000);
+ ftmatrix.yx = FLOATOBJ_GetLong(&efTemp);
+
+ efTemp = pmx->efM22;
+ FLOATOBJ_MulLong(&efTemp, 0x00010000);
+ ftmatrix.yy = FLOATOBJ_GetLong(&efTemp);
+
+ /* Set the transformation matrix */
+ FT_Set_Transform(face, &ftmatrix, 0);
+}
+
/*
* IntLoadSystemFonts
*
@@ -1552,6 +1585,7 @@
/* FIXME: Should set character height if neg */
// (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
// dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
+// FtSetCoordinateTransform(face, dc);
TEXTOBJ_UnlockText(TextObj);
@@ -2152,6 +2186,8 @@
DPRINT1("Error in setting pixel sizes: %u\n", error);
}
+ FtSetCoordinateTransform(face, dc);
+
use_kerning = FT_HAS_KERNING(face);
previous = 0;
@@ -2434,6 +2470,7 @@
/* FIXME: Should set character height if neg */
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
+ FtSetCoordinateTransform(Face, dc);
IntUnLockFreeType;
if (0 != Error)
{
@@ -3291,6 +3328,8 @@
goto fail;
}
+ FtSetCoordinateTransform(face, dc);
+
/*
* Process the vertical alignment and determine the yoff.
*/
@@ -3827,6 +3866,7 @@
/* FIXME: Should set character height if neg */
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
+ FtSetCoordinateTransform(face, dc);
for (i = FirstChar; i < FirstChar+Count; i++)
{
@@ -3994,6 +4034,7 @@
/* FIXME: Should set character height if neg */
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
+ FtSetCoordinateTransform(face, dc);
for (i = FirstChar; i < FirstChar+Count; i++)
{