Title: [221724] trunk/Source/WebCore
Revision
221724
Author
[email protected]
Date
2017-09-07 01:52:39 -0700 (Thu, 07 Sep 2017)

Log Message

[GTK] Bring back line height rounding when computing font metrics
https://bugs.webkit.org/show_bug.cgi?id=176497

Reviewed by Žan Doberšek.

In r221670 we changed the way we get the metrics to avoid rounding that was causing a negative line gap to be
computed. Since the font metrics value is indeed a float value, we also removed the rounding when setting the
line height. However, this caused some test failures because now we report non integer line heights.

* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (221723 => 221724)


--- trunk/Source/WebCore/ChangeLog	2017-09-07 08:14:30 UTC (rev 221723)
+++ trunk/Source/WebCore/ChangeLog	2017-09-07 08:52:39 UTC (rev 221724)
@@ -1,3 +1,17 @@
+2017-09-07  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Bring back line height rounding when computing font metrics
+        https://bugs.webkit.org/show_bug.cgi?id=176497
+
+        Reviewed by Žan Doberšek.
+
+        In r221670 we changed the way we get the metrics to avoid rounding that was causing a negative line gap to be
+        computed. Since the font metrics value is indeed a float value, we also removed the rounding when setting the
+        line height. However, this caused some test failures because now we report non integer line heights.
+
+        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
+        (WebCore::Font::platformInit):
+
 2017-09-06  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Temporary disable the changes introduced in r221670 for WPE.

Modified: trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp (221723 => 221724)


--- trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp	2017-09-07 08:14:30 UTC (rev 221723)
+++ trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp	2017-09-07 08:52:39 UTC (rev 221724)
@@ -54,7 +54,7 @@
 
 namespace WebCore {
 
-// FIXME: Remove this ifdef once WPE upgrqades to Freetype 2.8 and removes the patch for 2.4.11.
+// FIXME: Remove this ifdef once WPE upgrades to Freetype 2.8 and removes the patch for 2.4.11.
 #if !PLATFORM(WPE)
 static RefPtr<cairo_scaled_font_t> scaledFontWithoutMetricsHinting(cairo_scaled_font_t* scaledFont)
 {
@@ -75,7 +75,7 @@
         return;
 
     ASSERT(m_platformData.scaledFont());
-    // FIXME: Remove this ifdef once WPE upgrqades to Freetype 2.8 and removes the patch for 2.4.11.
+    // FIXME: Remove this ifdef once WPE upgrades to Freetype 2.8 and removes the patch for 2.4.11.
 #if PLATFORM(WPE)
     cairo_font_extents_t fontExtents;
     cairo_scaled_font_extents(m_platformData.scaledFont(), &fontExtents);
@@ -115,12 +115,7 @@
     m_fontMetrics.setAscent(ascent);
     m_fontMetrics.setDescent(descent);
     m_fontMetrics.setCapHeight(capHeight);
-    // FIXME: Remove this ifdef once WPE upgrqades to Freetype 2.8 and removes the patch for 2.4.11.
-#if PLATFORM(WPE)
     m_fontMetrics.setLineSpacing(lroundf(ascent) + lroundf(descent) + lroundf(lineGap));
-#else
-    m_fontMetrics.setLineSpacing(ascent + descent + lineGap);
-#endif
     m_fontMetrics.setLineGap(lineGap);
 
     cairo_text_extents_t textExtents;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to