2010-11-05 Alejandro G. Castro <alex@igalia.com>
authoralex@webkit.org <alex@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Nov 2010 11:10:15 +0000 (11:10 +0000)
committeralex@webkit.org <alex@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Nov 2010 11:10:15 +0000 (11:10 +0000)
        Reviewed by Martin Robinson.

        [GTK] Avoid font hinting in the DRT
        https://bugs.webkit.org/show_bug.cgi?id=48548

        Change the settings to avoid font hinting, it was causing
        different results depending on the distribution.

        * DumpRenderTree/gtk/DumpRenderTree.cpp:
        (initializeGtkFontSettings):
        * DumpRenderTree/gtk/fonts/fonts.conf:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@71403 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf

index d6a4e4f..44fb229 100644 (file)
@@ -1,3 +1,17 @@
+2010-11-05  Alejandro G. Castro  <alex@igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Avoid font hinting in the DRT
+        https://bugs.webkit.org/show_bug.cgi?id=48548
+
+        Change the settings to avoid font hinting, it was causing
+        different results depending on the distribution.
+
+        * DumpRenderTree/gtk/DumpRenderTree.cpp:
+        (initializeGtkFontSettings):
+        * DumpRenderTree/gtk/fonts/fonts.conf:
+
 2010-11-05  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Adam Barth.
index 1c851d7..54acc49 100644 (file)
@@ -137,10 +137,9 @@ static void initializeGtkFontSettings(const char* testURL)
     GtkSettings* settings = gtk_settings_get_default();
     if (!settings)
         return;
-    g_object_set(settings, "gtk-xft-antialias", 1, NULL);
-    g_object_set(settings, "gtk-xft-hinting", 1, NULL);
-    g_object_set(settings, "gtk-xft-hintstyle", "hintfull", NULL);
-    g_object_set(settings, "gtk-font-name", "Liberation Sans 16", NULL);
+    g_object_set(settings, "gtk-xft-antialias", 1,
+                 "gtk-xft-hinting", 0,
+                 "gtk-font-name", "Liberation Sans 16", NULL);
 
     // One test needs subpixel anti-aliasing turned on, but generally we
     // want all text in other tests to use to grayscale anti-aliasing.
index 6eb057e..2d9af17 100644 (file)
@@ -2,6 +2,19 @@
 <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
 <fontconfig>
 
+    <!-- Due to patent (http://freetype.sourceforge.net/patents.html)
+         issues hinting gives different results depending on the
+         freetype version of the linux distribution, avoiding hinting
+         gives more consistent results. When all the distributions
+         release freetype the 2.4, which enables by default the
+         hinting method that was patented, we could undo this change
+         and try the hinting again. -->
+    <match target="font">
+        <edit name="hinting" mode="assign">
+            <bool>false</bool>
+        </edit>
+    </match>
+
     <!-- The sans-serif font should be Liberation Serif -->
     <match target="pattern">
         <test qual="any" name="family">
         <edit name="family" mode="assign">
             <string>Liberation Serif</string>
         </edit>
+        <edit name="hinting" mode="assign">
+            <bool>true</bool>
+        </edit>
         <edit name="hintstyle" mode="assign">
             <const>hintslight</const>
         </edit>
         <edit name="hintstyle" mode="assign">
             <const>hintfull</const>
         </edit>
-     <edit name="hinting" mode="assign">
+        <edit name="hinting" mode="assign">
             <bool>false</bool>
         </edit>
     </match>
         <edit name="family" mode="assign">
             <string>Liberation Serif</string>
         </edit>
+        <edit name="hinting" mode="assign">
+            <bool>true</bool>
+        </edit>
         <edit name="autohint" mode="assign">
             <bool>true</bool>
         </edit>
         <edit name="family" mode="assign">
             <string>Liberation Serif</string>
         </edit>
+        <edit name="hinting" mode="assign">
+            <bool>true</bool>
+        </edit>
         <edit name="autohint" mode="assign">
             <bool>false</bool>
         </edit>
         <edit name="family" mode="assign">
             <string>Liberation Serif</string>
         </edit>
+        <edit name="hinting" mode="assign">
+            <bool>true</bool>
+        </edit>
         <edit name="autohint" mode="assign">
             <bool>true</bool>
         </edit>