[webkit-dev] Why does Ahem have different vertical metrics in Qt?

Dan Bernstein mitz at apple.com
Tue Feb 8 11:42:48 PST 2011

In an attempt to give layout tests consistent results across platforms, I ofter use the Ahem font. However, I’ve noticed that Qt still requires platform-specific results when I do that. One recent example is fast/dynamic/unicode-bidi.html

$ diff -u LayoutTests/platform/qt/fast/dynamic/unicode-bidi-expected.txt  LayoutTests/fast/dynamic/unicode-bidi-expected.txt 
--- LayoutTests/platform/qt/fast/dynamic/unicode-bidi-expected.txt	2011-02-03 09:02:59.000000000 -0800
+++ LayoutTests/fast/dynamic/unicode-bidi-expected.txt	2011-01-28 10:46:32.000000000 -0800
@@ -3,14 +3,14 @@
 layer at (0,0) size 800x600 layerType: background only
 layer at (8,8) size 100x50
   RenderBlock (positioned) zI: -1 {DIV} at (8,8) size 100x50 [color=#FF0000]
-    RenderInline {SPAN} at (0,0) size 50x49 [color=#008000]
-      RenderText {#text} at (0,0) size 50x49
+    RenderInline {SPAN} at (0,0) size 50x50 [color=#008000]
+      RenderText {#text} at (0,0) size 50x50
         text run at (0,0) width 50: "x"
-    RenderText zI: -1 {#text} at (50,0) size 50x49
+    RenderText zI: -1 {#text} at (50,0) size 50x50
       text run at (50,0) width 50: "x"
 layer at (0,0) size 800x600 layerType: foreground only
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderBlock {DIV} at (0,0) size 784x50 [color=#008000]
-        RenderText {#text} at (0,0) size 100x49
+        RenderText {#text} at (0,0) size 100x50
           text run at (0,0) width 100 RTL override: "xp"

Here, all the 50px Ahem text has a height of 49 pixels on Qt. The pixel results, though, show it having the same height it does in Mac OS X (and presumably other platforms).

What is causing this difference? How does it affect other fonts and real websites? Is there a way to fix this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20110208/70dc17ee/attachment.html>

More information about the webkit-dev mailing list