Author: ilardig
Date: Tue May 3 14:55:52 2011
New Revision: 51566
URL:
http://svn.reactos.org/svn/reactos?rev=51566&view=rev
Log:
[win32k]
- Handle font height == 0 also in TextIntGetTextExtentPoint (bug 5305)
- Remove hardcoded font height (11) and replace it with
the default font height from the device context by Timo.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/freetype.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Tue May 3
14:55:52 2011
@@ -1569,8 +1569,8 @@
// FT_Set_Pixel_Sizes(ft_face,
// TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */
-// (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ?
- TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
-// TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
+// (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
+// dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
TEXTOBJ_UnlockText(TextObj);
@@ -2165,9 +2165,8 @@
error = FT_Set_Pixel_Sizes(face,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */
- (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight
< 0 ?
- -
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
- TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight
== 0 ? 11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
+ (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight
== 0 ?
+ dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
if (error)
{
DPRINT1("Error in setting pixel sizes: %u\n", error);
@@ -2228,7 +2227,8 @@
IntUnLockFreeType;
Size->cx = (TotalWidth + 32) >> 6;
- Size->cy = (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ? -
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight);
+ Size->cy = (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
+ dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
Size->cy = EngMulDiv(Size->cy, dc->ppdev->gdiinfo.ulLogPixelsY, 72);
return TRUE;
@@ -2452,9 +2452,8 @@
Error = FT_Set_Pixel_Sizes(Face,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */
-
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ?
- -
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
-
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 :
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
+
(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
+ dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
IntUnLockFreeType;
if (0 != Error)
{
@@ -3304,9 +3303,8 @@
face,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */
- (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ?
- - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
- TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ? 11 :
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
+ (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
+ dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
if (error)
{
DPRINT1("Error in setting pixel sizes: %u\n", error);
@@ -3843,8 +3841,8 @@
FT_Set_Pixel_Sizes(face,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */
- (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0 ?
- TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
- TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
+ (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
+ dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
for (i = FirstChar; i < FirstChar+Count; i++)
{
@@ -4010,9 +4008,8 @@
FT_Set_Pixel_Sizes(face,
TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfWidth,
/* FIXME should set character height if neg */
- (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight < 0
?
- - TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight :
- TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
11 : TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight));
+ (TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight == 0 ?
+ dc->ppdev->devinfo.lfDefaultFont.lfHeight :
abs(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfHeight)));
for (i = FirstChar; i < FirstChar+Count; i++)
{