[ros-diffs] [tkreuzer] 33955: MSDB KB 145994 (http://support.microsoft.com/?scid=kb%3Ben-us%3B145994): yBaseUnit is textmetric->tmHeight not average text extent. Testing confirms that GdiGetCharDimension returns this as height. This makes dialog boxes less stretched in height. Still not identical to XP. calx.exe: On XP yBaseUnit == 13, on ROS == 14 (was 16 before)

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Fri Jun 13 15:33:53 CEST 2008


Author: tkreuzer
Date: Fri Jun 13 08:33:53 2008
New Revision: 33955

URL: http://svn.reactos.org/svn/reactos?rev=33955&view=rev
Log:
MSDB KB 145994 (http://support.microsoft.com/?scid=kb%3Ben-us%3B145994): yBaseUnit is textmetric->tmHeight not average text extent. Testing confirms that GdiGetCharDimension returns this as height. This makes dialog boxes less stretched in height. Still not identical to XP. calx.exe: On XP yBaseUnit == 13, on ROS == 14 (was 16 before)

Modified:
    trunk/reactos/dll/win32/gdi32/objects/font.c

Modified: trunk/reactos/dll/win32/gdi32/objects/font.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/font.c?rev=33955&r1=33954&r2=33955&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] Fri Jun 13 08:33:53 2008
@@ -1615,16 +1615,19 @@
 GdiGetCharDimensions(HDC hdc, LPTEXTMETRICW lptm, LONG *height)
 {
     SIZE sz;
+    TEXTMETRICW tm;
     static const WCHAR alphabet[] = {
         'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
         'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
         'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
 
-    if(lptm && !GetTextMetricsW(hdc, lptm)) return 0;
+    if(!GetTextMetricsW(hdc, &tm)) return 0;
 
     if(!GetTextExtentPointW(hdc, alphabet, 52, &sz)) return 0;
 
-    if (height) *height = sz.cy;
+    if (lptm) *lptm = tm;
+    if (height) *height = tm.tmHeight;
+
     return (sz.cx / 26 + 1) / 2;
 }
 



More information about the Ros-diffs mailing list