olefont size conversions

Walt Ogburn reuben at ugcs.caltech.edu
Sun Aug 21 12:02:26 CDT 2005


See previous olefont size test patch for validation of this patch.  This
should fix a lot of VB apps that have badly sized text on buttons and edit
boxes, and in many cases unreadable fonts with size -1.


Changelog:
- When applying logical / himetric ratio to olefont sizes, must divide by
the standard ratio 72 / 2540.

-------------- next part --------------
Index: dlls/oleaut32/olefont.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/olefont.c,v
retrieving revision 1.45
diff -u -p -r1.45 olefont.c
--- dlls/oleaut32/olefont.c	27 Jul 2005 15:14:18 -0000	1.45
+++ dlls/oleaut32/olefont.c	21 Aug 2005 16:46:24 -0000
@@ -953,7 +953,9 @@ static HRESULT WINAPI OLEFontImpl_get_hF
      */
     IFont_get_Size(iface, &cySize);
 
-    fontHeight = MulDiv( cySize.s.Lo, this->cyLogical, this->cyHimetric );
+    /* Standard ratio is 72 / 2540, or 18 / 635 in lowest terms. */
+    /* Ratio is applied here relative to the standard. */
+    fontHeight = MulDiv( cySize.s.Lo, this->cyLogical*635, this->cyHimetric*18 );
 
     memset(&logFont, 0, sizeof(LOGFONTW));
 
@@ -1020,7 +1022,7 @@ static HRESULT WINAPI OLEFontImpl_Clone(
   /* We need to clone the HFONT too. This is just cut & paste from above */
   IFont_get_Size(iface, &cySize);
 
-  fontHeight = MulDiv(cySize.s.Lo, this->cyLogical,this->cyHimetric);
+  fontHeight = MulDiv(cySize.s.Lo, this->cyLogical*635,this->cyHimetric*18);
 
   memset(&logFont, 0, sizeof(LOGFONTW));


More information about the wine-patches mailing list