Author: tkreuzer
Date: Sun May 22 17:36:34 2011
New Revision: 51850

URL: http://svn.reactos.org/svn/reactos?rev=51850&view=rev
Log:
[GDI FONT DRIVER]
- Calculate fxMaxAscender and fxMaxDescender for the FD_DEVICEMETRICS differenly

Modified:
    branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/ftfd.h
    branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/glyph.c

Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/ftfd.h
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/ftfd.h?rev=51850&r1=51849&r2=51850&view=diff
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/ftfd.h 
[iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/ftfd.h 
[iso-8859-1] Sun May 22 17:36:34 2011
@@ -114,19 +114,22 @@
     PFTFD_FACE apface[1];
 } FTFD_FILE, *PFTFD_FILE;
 
-typedef union _FTFD_DEVICEMETRICS
-{
-    POINTL aptl[10];
-    struct
+typedef struct _FTFD_DEVICEMETRICS
+{
+    union
     {
-        POINTFIX ptfxMaxAscender;
-        POINTFIX ptfxMaxDescender;
-        POINTL ptlUnderline1;
-        POINTL ptlStrikeout;
-        POINTL ptlULThickness;
-        POINTL ptlSOThickness;
-        POINTL aptlBBox[4];
+        POINTL aptl[8];
+        struct
+        {
+            POINTL ptlUnderline1;
+            POINTL ptlStrikeout;
+            POINTL ptlULThickness;
+            POINTL ptlSOThickness;
+            POINTL aptlBBox[4];
+        };
     };
+    FIX fxMaxAscender;
+    FIX fxMaxDescender;
 } FTFD_DEVICEMETRICS;
 
 typedef struct _POINTEF

Modified: branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/glyph.c
URL: 
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/glyph.c?rev=51850&r1=51849&r2=51850&view=diff
==============================================================================
--- branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/glyph.c 
[iso-8859-1] (original)
+++ branches/GSoC_2011/GdiFontDriver/drivers/video/font/ftfd/glyph.c 
[iso-8859-1] Sun May 22 17:36:34 2011
@@ -146,6 +146,14 @@
     /* Normalize the base vectors and get their length */
     efScaleX = FtfdNormalizeBaseVector(&pfont->ptefBase);
     efScaleY = FtfdNormalizeBaseVector(&pfont->ptefSide);
+
+    /* Calculate maximum ascender and descender */
+    efTemp = efScaleY;
+    FLOATOBJ_MulLong(&efTemp, pface->ifiex.ifi.fwdWinAscender << 4);
+    pfont->metrics.fxMaxAscender = FLOATOBJ_GetLong(&efTemp);
+    efTemp = efScaleY;
+    FLOATOBJ_MulLong(&efTemp, pface->ifiex.ifi.fwdWinDescender << 4);
+    pfont->metrics.fxMaxDescender = FLOATOBJ_GetLong(&efTemp);
 
     /* The coordinate transformation given by Windows transforms from font
      * space to device space. Since we use FT_Set_Char_Size, which allows
@@ -221,10 +229,6 @@
 
     /* Prepare required coordinates in font space */
     pmetrics = &pfont->metrics;
-    pmetrics->ptfxMaxAscender.x = 0;
-    pmetrics->ptfxMaxAscender.y = pface->ifiex.ifi.fwdWinAscender << 4;
-    pmetrics->ptfxMaxDescender.x = 0;
-    pmetrics->ptfxMaxDescender.y = pface->ifiex.ifi.fwdWinDescender << 4;
     pmetrics->ptlUnderline1.x = 0;
     pmetrics->ptlUnderline1.y = -pface->ifiex.ifi.fwdUnderscorePosition;
     pmetrics->ptlStrikeout.x = 0;
@@ -243,7 +247,7 @@
     pmetrics->aptlBBox[3].y = ftface->bbox.yMax;
 
     /* Transform all coordinates into device space */
-    if (!XFORMOBJ_bApplyXform(pxo, XF_LTOL, 10, pmetrics->aptl, 
pmetrics->aptl))
+    if (!XFORMOBJ_bApplyXform(pxo, XF_LTOL, 8, pmetrics->aptl, pmetrics->aptl))
     {
         WARN("Failed apply coordinate transformation.\n");
         EngFreeMem(pfont);
@@ -332,8 +336,8 @@
             pfddm->lD = 0;
 
         /* Copy some values from the font structure */
-        pfddm->fxMaxAscender = pfont->metrics.ptfxMaxAscender.y;
-        pfddm->fxMaxDescender = pfont->metrics.ptfxMaxDescender.y;
+        pfddm->fxMaxAscender = pfont->metrics.fxMaxAscender;
+        pfddm->fxMaxDescender = pfont->metrics.fxMaxDescender;
         pfddm->ptlUnderline1 = pfont->metrics.ptlUnderline1;
         pfddm->ptlStrikeout = pfont->metrics.ptlStrikeout;
         pfddm->ptlULThickness = pfont->metrics.ptlULThickness;


Reply via email to