<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>102374</bug_id>
          
          <creation_ts>2012-11-15 05:53:42 -0800</creation_ts>
          <short_desc>[Cairo, FreeType] Incorrect baseline positioning &amp; line spacing due to rounding</short_desc>
          <delta_ts>2017-09-05 11:19:53 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit EFL</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=176351</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>103740</blocked>
    
    <blocked>89458</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dominik Röttsches (drott)">d-r</reporter>
          <assigned_to name="Dominik Röttsches (drott)">d-r</assigned_to>
          <cc>alex</cc>
    
    <cc>behdad</cc>
    
    <cc>eae</cc>
    
    <cc>gustavo</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>leviw</cc>
    
    <cc>lucas.de.marchi</cc>
    
    <cc>mrobinson</cc>
    
    <cc>ostap73</cc>
    
    <cc>rakuco</cc>
    
    <cc>sw0524.lee</cc>
    
    <cc>wl</cc>
    
    <cc>zan</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>767994</commentid>
    <comment_count>0</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-15 05:53:42 -0800</bug_when>
    <thetext>When enabling subpixel layout on EFL, many fast/css/* tests have enclosed elements positioned 1 pixel too high.

Example:

--- /fast/dominik/dev/WebKitGit_EFL/lt_sub/fast/css/background-image-with-baseurl-expected.txt
+++ /fast/dominik/dev/WebKitGit_EFL/lt_sub/fast/css/background-image-with-baseurl-actual.txt
@@ -3,5 +3,5 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderText {#text} at (0,0) size 196x19
-        text run at (0,0) width 196: &quot;red squares background image.&quot;
+      RenderText {#text} at (0,-1) size 196x19
+        text run at (0,-1) width 196: &quot;red squares background image.&quot;

Mac &amp; Chromium subpixel-enabled expectations have:

layer at (0,0) size 800x600
  RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
  RenderBlock {HTML} at (0,0) size 800x600
    RenderBody {BODY} at (8,8) size 784x584
      RenderText {#text} at (0,0) size 196x18
        text run at (0,0) width 196: &quot;red squares background image.&quot;

Levi, Emil, any suggestions what kind of platform-specific metrics input to the line layout calculations could lead to such an offset?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>770509</commentid>
    <comment_count>1</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-19 02:22:30 -0800</bug_when>
    <thetext>In 
void SimpleFontData::platformInit()

    float ascent = narrowPrecisionToFloat(font_extents.ascent);
    float descent = narrowPrecisionToFloat(font_extents.descent);
    float lineGap = narrowPrecisionToFloat(font_extents.height - font_extents.ascent - font_extents.descent);

lineGap results in -1. That seems wrong, since the cairo documentation days:

&quot;double height;

the recommended vertical distance between baselines when setting consecutive lines of text with the font. This is greater than ascent+descent by a quantity known as the line spacing or external leading. When space is at a premium, most fonts can be set with only a distance of ascent+descent between lines.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>770699</commentid>
    <comment_count>2</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-19 06:54:27 -0800</bug_when>
    <thetext>This is originally caused by freetype rounding when &quot;GRID_FIT_METRICS&quot; is on:

#ifdef GRID_FIT_METRICS
    metrics-&gt;ascender    = FT_PIX_CEIL( FT_MulFix( face-&gt;ascender,
                                                   metrics-&gt;y_scale ) );

    metrics-&gt;descender   = FT_PIX_FLOOR( FT_MulFix( face-&gt;descender,
                                                    metrics-&gt;y_scale ) );

    metrics-&gt;height      = FT_PIX_ROUND( FT_MulFix( face-&gt;height,
                                                    metrics-&gt;y_scale ) );

    metrics-&gt;max_advance = FT_PIX_ROUND( FT_MulFix( face-&gt;max_advance_width,
                                                    metrics-&gt;x_scale ) );
#else /* !GRID_FIT_METRICS */

Here, the CEIL + FLOOR of ascender and descender results in a non-uniform scaling - making the sum of ascender and descender larger than the height :-/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771758</commentid>
    <comment_count>3</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-20 04:56:01 -0800</bug_when>
    <thetext>Turns out, cairo is only using the Freetype clamping path if cairo_font_options_set_hint_metrics is set to CAIRO_HINT_METRICS_DEFAULT or CAIRO_HINT_METRICS_ON, see http://cgit.freedesktop.org/cairo/tree/src/cairo-ft-font.c?id=1.12.4#n1888

WebCore&apos;s Cairo backend does not modify the DEFAULT setting, which results in always receiving integer-clamped values SimpleFontData::platformInit().

As mentioned, the clamping in FreeType can lead to incorrect, negative line gap values which are exposed when enabling subpixel layout. 

Since WebCore maintains the font metrics in floats, there&apos;s no reason we should clamp early, allowing such bugs. I suggest to disable cairo&apos;s metrics hinting and receive correct, proportionally scaled values in SimpleFontDataFreetype.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771843</commentid>
    <comment_count>4</comment_count>
      <attachid>175215</attachid>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-20 07:13:21 -0800</bug_when>
    <thetext>Created attachment 175215
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771846</commentid>
    <comment_count>5</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-20 07:14:24 -0800</bug_when>
    <thetext>If we wanted to keep the old letter-spacing behavior, we can round as follows:

--- a/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
+++ b/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
@@ -146,7 +146,7 @@ float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
 
     float w = (float)m_spaceWidth;
     if (cairo_scaled_font_status(m_platformData.scaledFont()) == CAIRO_STATUS_SUCCESS &amp;&amp; extents.x_advance)
-        w = (float)extents.x_advance;
+        w = (float)lroundf(extents.x_advance);
 
     return w;    
 }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771848</commentid>
    <comment_count>6</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-20 07:19:21 -0800</bug_when>
    <thetext>CC&apos;ing GTK+ people with the hope of supporting this change, agreeing on the big rebaseline that this would require. 

On EFL, we&apos;d like to do this at the same time with enabling subpixel-layout. How do the GTK people feel about doing the same?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771893</commentid>
    <comment_count>7</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-20 08:29:02 -0800</bug_when>
    <thetext>We did something like this once and then undid it, which was terribly labor intensive. If this is necessary perhaps we can only do it when subpixel layout is turned on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771903</commentid>
    <comment_count>8</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-20 08:47:32 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; We did something like this once and then undid it, which was terribly labor intensive. If this is necessary perhaps we can only do it when subpixel layout is turned on.

Yes, I would like to land this and activate subpixel on EFL hopefully this week - if you think the patch is okay?

Ideally without a platform or subpixel specific ifdef. That&apos;s why i am asking whether you would be up for  activating subpixel now as well. Mac has recently switched.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771918</commentid>
    <comment_count>9</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-20 09:16:43 -0800</bug_when>
    <thetext>(In reply to comment #8)

&gt; Ideally without a platform or subpixel specific ifdef. That&apos;s why i am asking whether you would be up for  activating subpixel now as well. Mac has recently switched.

I think an #ifdef makes sense, as it will allow us to switch to subpixel positioning for the right reason (it&apos;s ready and we&apos;ve tested it). We&apos;re in the middle of a development cycle and spending a lot of time updating baselines for a feature we may disable later is a bit risky. Since we have a responsibility to ship stable software on a schedule that we cannot control entirely, we need to be pretty cautious.

Can you elaborate on the problems that you think an #ifdef poses. Perhaps there is some middle ground here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>771996</commentid>
    <comment_count>10</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-20 10:44:58 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; (In reply to comment #8)
&gt; 
&gt; &gt; Ideally without a platform or subpixel specific ifdef. That&apos;s why i am asking whether you would be up for  activating subpixel now as well. Mac has recently switched.

&gt; Can you elaborate on the problems that you think an #ifdef poses. Perhaps there is some middle ground here.

Well, as in this case there would not be a technical reason for the #ifdef since we&apos;re sharing the backends, I was hesitant to put one in the patch. Of course, it&apos;s possible, with a comment explaining why.

&gt; We did something like this once and then undid it, which was terribly labor intensive.

Can you tell a bit more how similar this attempt was? I am positive that there is actually a bug here. I&apos;d like to know a bit more why you reverted a similar change.

Gyuyoung, what do you think about the letter spacing change implication?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775534</commentid>
    <comment_count>11</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-26 09:08:06 -0800</bug_when>
    <thetext>(In reply to comment #10)

&gt; &gt; Can you elaborate on the problems that you think an #ifdef poses. Perhaps there is some middle ground here.

&gt; Well, as in this case there would not be a technical reason for the #ifdef since we&apos;re sharing the backends, I was hesitant to put one in the patch. Of course, it&apos;s possible, with a comment explaining why.

I think a comment and an #ifdef are a bit safer. We can always remove an #ifdef, but changing hundreds of baselines is a bigger task.

&gt; Can you tell a bit more how similar this attempt was? I am positive that there is actually a bug here. I&apos;d like to know a bit more why you reverted a similar change.

Wildfox made the original change, I believe. I tried searching for it but the relevant patches continue to elude me. If I recall correctly it had to do with enabling and disabling cairo_font_options_set_hint_metrics and the reason we reverted it is that it seemed to introduce flakiness into many tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>775624</commentid>
    <comment_count>12</comment_count>
      <attachid>175215</attachid>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-26 10:28:26 -0800</bug_when>
    <thetext>Comment on attachment 175215
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=175215&amp;action=review

&gt; Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp:115
&gt; +    cairo_font_options_t* defaultFontOptions = cairo_font_options_create();
&gt; +    // Set to off in order to receive non-rounded floating point values for font metrics in SimpleFontDataFreeType instead
&gt; +    // of integer-clamped values that may cause negative values for line-gap.
&gt; +    cairo_font_options_set_hint_metrics(defaultFontOptions, CAIRO_HINT_METRICS_OFF);

If we turn this off globally we probably want to force it off for the GDK font options as well above.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>776488</commentid>
    <comment_count>13</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-27 01:48:33 -0800</bug_when>
    <thetext>Martin, thanks for the details, I think I found the changes you refer to:

&gt; Wildfox made the original change, I believe. 

http://trac.webkit.org/changeset/101343

&gt; [...] If I recall correctly it had to do with enabling and disabling cairo_font_options_set_hint_metrics and the reason we reverted it is that it seemed to introduce flakiness into many tests.

And the revert came in two steps,
http://trac.webkit.org/changeset/102748 +
http://trac.webkit.org/changeset/114796

There&apos;s some magic there in the ChangeLog. &quot;Re-enable Cairo metrics hinting, which seems to ensure consistent results in reference and pixel test results.&quot;

From the other way &apos;round: Can you recall how the results were inconsistent? Were they inconsistent between runs on the same machine? Or were they inconsistent between different hosts? In the latter case, the reason might be in different fontconfig and gnome-settings-daemon configurations for hinting?

I&apos;d like to really resolve this issue and later hopefully land a patch that doesn&apos;t have the word &quot;seems&quot; in the Changelog :-).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>776748</commentid>
    <comment_count>14</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-27 07:58:17 -0800</bug_when>
    <thetext>(In reply to comment #13)

&gt; From the other way &apos;round: Can you recall how the results were inconsistent? Were they inconsistent between runs on the same machine? Or were they inconsistent between different hosts? In the latter case, the reason might be in different fontconfig and gnome-settings-daemon configurations for hinting?

Tests started to flake after the change. If I recall correctly we had reftest failures that we didn&apos;t have before.

&gt; I&apos;d like to really resolve this issue and later hopefully land a patch that doesn&apos;t have the word &quot;seems&quot; in the Changelog :-).

Well, that&apos;s mostly just my poor style of writing, but I fully support this work. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>778089</commentid>
    <comment_count>15</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-28 11:10:39 -0800</bug_when>
    <thetext>I&apos;ve been doing a little research [1] and it seems that Behdad suggests that metrics hinting should be on if subpixel layout is disabled.

&quot;If you don’t have subpixel text positioning (ie. your graphics system knows only how to rasterize one image for a glyph and blit that onto the screen), then you really want to enable metrics hinting.&quot;

This is the first bullet point in the &quot;Constraints&quot; section.

1. https://docs.google.com/document/d/1wpzgGMqXgit6FBVaO76epnnFC_rQPdVKswrDQWyqO1M</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>778091</commentid>
    <comment_count>16</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-28 11:11:56 -0800</bug_when>
    <thetext>CCing Behdad, who probably has some insightful input.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>778266</commentid>
    <comment_count>17</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2012-11-28 13:23:11 -0800</bug_when>
    <thetext>(In reply to comment #16)

&gt; 1. https://docs.google.com/document/d/1wpzgGMqXgit6FBVaO76epnnFC_rQPdVKswrDQWyqO1M

Sorry. This link should be: https://docs.google.com/document/d/1wpzgGMqXgit6FBVaO76epnnFC_rQPdVKswrDQWyqO1M/edit</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>778923</commentid>
    <comment_count>18</comment_count>
    <who name="Behdad Esfahbod">behdad</who>
    <bug_when>2012-11-29 04:53:43 -0800</bug_when>
    <thetext>Hi,

Martin is correct: cairo does not know how to render subpixel positioned text, and as such it will be a disaster IMO to turn metrics hinting off.  There is an example in the document of the kind of wrong effects one would get doing that.  What I suggest is to do something different only for getting the line metrics perhaps.  For the actual measurement and layout of glyphs, don&apos;t disable metrics hinting with cairo.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>778925</commentid>
    <comment_count>19</comment_count>
    <who name="Behdad Esfahbod">behdad</who>
    <bug_when>2012-11-29 04:56:45 -0800</bug_when>
    <thetext>Another reason why you can&apos;t disable metrics hinting is that you are not disabling hinting.  Same document explains why that is a problem also.  Second bullet in the &quot;constraints&quot; section.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>778930</commentid>
    <comment_count>20</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-29 05:15:46 -0800</bug_when>
    <thetext>(In reply to comment #18)
&gt; What I suggest is to do something different only for getting the line metrics perhaps.  For the actual measurement and layout of glyphs, don&apos;t disable metrics hinting with cairo.

Thanks, Behdad. I&apos;ll see what I can do to just get the right height info. Maybe I can temporarily disable metrics hinting just to retrieve these.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>779014</commentid>
    <comment_count>21</comment_count>
      <attachid>176736</attachid>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-29 07:44:45 -0800</bug_when>
    <thetext>Created attachment 176736
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>779015</commentid>
    <comment_count>22</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-29 07:46:37 -0800</bug_when>
    <thetext>This new patch works for fixing the line height, line gap issue and leaves  hinting (and metrics hinting) enabled. This way, we give non-rounded height information to WebCore for use in layout. Any other comments on this Behdad? What do you think, Martin?

Thanks for your help.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>780094</commentid>
    <comment_count>23</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-11-30 07:14:52 -0800</bug_when>
    <thetext>Btw, this is also fixing bug 103740.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>782782</commentid>
    <comment_count>24</comment_count>
    <who name="Behdad Esfahbod">behdad</who>
    <bug_when>2012-12-04 12:12:28 -0800</bug_when>
    <thetext>LGTM.  I wonder whether there&apos;s something to be done in FreeType itself.  Would help knowing what Windows does in this case.  If you can get those numbers, I can do the upstreaming work in FreeType.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>782826</commentid>
    <comment_count>25</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-12-04 12:55:00 -0800</bug_when>
    <thetext>(In reply to comment #24)

Behdad, thanks for your feedback, much appreciated. 

&gt; LGTM.  I wonder whether there&apos;s something to be done in FreeType itself.  

You mean, with regards to the issue I mentioned in comment 2?

&gt; Would help knowing what Windows does in this case.  If you can get those numbers, I can do the upstreaming work in FreeType.

What numbers would you need? Just the line height, ascent &amp; descent of the same font? And would just retrieving the font details from a small test app be enough, or do you mean, dumping this from the same execution path in Safari/Win?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>782951</commentid>
    <comment_count>26</comment_count>
    <who name="Behdad Esfahbod">behdad</who>
    <bug_when>2012-12-04 14:35:20 -0800</bug_when>
    <thetext>Thanks.  I&apos;m mostly interested to know what would Windows APIs returns for ascent / descent / linegap for that font at that size . Because I&apos;m sure FreeType / others would insist that the lineheight should match what Windows returns...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>783582</commentid>
    <comment_count>27</comment_count>
      <attachid>176736</attachid>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2012-12-05 03:07:11 -0800</bug_when>
    <thetext>Comment on attachment 176736
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=176736&amp;action=review

&gt; Source/WebCore/ChangeLog:12
&gt; +        than the line height. To work around this without globally disabling font metrics
&gt; +        hinting, I am temporarily creating a new cairo scaled font with metrics hinting
&gt; +        off and retrieving the height values from this one.

isnt metrics hinting bad anyway for scaling? like it might affect layout at different scales.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>783588</commentid>
    <comment_count>28</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-12-05 03:16:48 -0800</bug_when>
    <thetext>(In reply to comment #27)

&gt; isnt metrics hinting bad anyway for scaling? like it might affect layout at different scales.

See comment 15, metrics hinting is useful if you don&apos;t have subpixel positioning. When scaling, a new font with the right font size is instantiated.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>783679</commentid>
    <comment_count>29</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-12-05 05:40:24 -0800</bug_when>
    <thetext>(In reply to comment #26)
&gt; Thanks.  I&apos;m mostly interested to know what would Windows APIs returns for ascent / descent / linegap for that font at that size . Because I&apos;m sure FreeType / others would insist that the lineheight should match what Windows returns...

So, using a quick and dirty C# app [1], I got this:
&quot;Liberation Sans, 16 (fontSize: 16) - lineSpacingPixel: 18.39844, ascentPixel 14.48438, descent 3.390625, ascent+descent: 17.875&quot;

Very very close to what I get from Cairo/Freetype (after my temporary-hinting-off patch):
ascent: 14.484375
descent: 3.390625
height: 18.3984375

[1] https://gist.github.com/4215546

That means, we&apos;re good to proceed with this patch, right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>786111</commentid>
    <comment_count>30</comment_count>
    <who name="Behdad Esfahbod">behdad</who>
    <bug_when>2012-12-07 13:49:04 -0800</bug_when>
    <thetext>(In reply to comment #29)
&gt; (In reply to comment #26)
&gt; &gt; Thanks.  I&apos;m mostly interested to know what would Windows APIs returns for ascent / descent / linegap for that font at that size . Because I&apos;m sure FreeType / others would insist that the lineheight should match what Windows returns...
&gt; 
&gt; So, using a quick and dirty C# app [1], I got this:
&gt; &quot;Liberation Sans, 16 (fontSize: 16) - lineSpacingPixel: 18.39844, ascentPixel 14.48438, descent 3.390625, ascent+descent: 17.875&quot;
&gt; 
&gt; Very very close to what I get from Cairo/Freetype (after my temporary-hinting-off patch):
&gt; ascent: 14.484375
&gt; descent: 3.390625
&gt; height: 18.3984375
&gt; 
&gt; [1] https://gist.github.com/4215546
&gt; 
&gt; That means, we&apos;re good to proceed with this patch, right?

Thanks for testing.  I think the patch is fine to go in.  That said, for Windows. I was more interested in the hinted integer metrics, since that&apos;s where the current bug in FreeType is.  If you can get those number I will followup with FreeType upstream to fix it properly.  I don&apos;t have access to Windows myself.  Thanks again!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>788399</commentid>
    <comment_count>31</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-12-11 06:39:57 -0800</bug_when>
    <thetext>(In reply to comment #30)
&gt; Thanks for testing.  I think the patch is fine to go in.  That said, for Windows. I was more interested in the hinted integer metrics, since that&apos;s where the current bug in FreeType is.  If you can get those number I will followup with FreeType upstream to fix it properly.  I don&apos;t have access to Windows myself.  Thanks again!

More lovely Win programming [1] using GDI GetTextMetrics on a device context handle optained from .net gives me (Liberation Sans, 16 pixel):
ascent: 14
descent: 3
height: 17

whereas the freetype code here gives me:
ascent: 15
descent: 4
height: 18

Good luck fixing this on Freetype.

[1] https://gist.github.com/d4169b1068c203432846</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>788407</commentid>
    <comment_count>32</comment_count>
    <who name="Behdad Esfahbod">behdad</who>
    <bug_when>2012-12-11 06:58:03 -0800</bug_when>
    <thetext>Thanks Dominik.  I&apos;ll see what I can do.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>789074</commentid>
    <comment_count>33</comment_count>
    <who name="Viatcheslav Ostapenko">ostap73</who>
    <bug_when>2012-12-11 18:07:06 -0800</bug_when>
    <thetext>(In reply to comment #31)
&gt; (In reply to comment #30)
&gt; &gt; Thanks for testing.  I think the patch is fine to go in.  That said, for Windows. I was more interested in the hinted integer metrics, since that&apos;s where the current bug in FreeType is.  If you can get those number I will followup with FreeType upstream to fix it properly.  I don&apos;t have access to Windows myself.  Thanks again!
&gt; 
&gt; More lovely Win programming [1] using GDI GetTextMetrics on a device context handle optained from .net gives me (Liberation Sans, 16 pixel):
&gt; ascent: 14
&gt; descent: 3
&gt; height: 17
&gt; 
&gt; whereas the freetype code here gives me:
&gt; ascent: 15
&gt; descent: 4
&gt; height: 18
&gt; 
&gt; Good luck fixing this on Freetype.
&gt; 
&gt; [1] https://gist.github.com/d4169b1068c203432846

Win GDI uses simple truncate instead of rounding?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>789396</commentid>
    <comment_count>34</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2012-12-12 02:46:15 -0800</bug_when>
    <thetext>(In reply to comment #33)
&gt; Win GDI uses simple truncate instead of rounding?

It looks as if it&apos;s flooring all values, yes. But let&apos;s say I haven&apos;t looked at the GDI code :-). As per comment 2, at least a combination of ceiling some values and rounding others is an unholy combination.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>798295</commentid>
    <comment_count>35</comment_count>
    <who name="Viatcheslav Ostapenko">ostap73</who>
    <bug_when>2012-12-30 22:26:36 -0800</bug_when>
    <thetext>*** Bug 104573 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804320</commentid>
    <comment_count>36</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2013-01-10 06:27:51 -0800</bug_when>
    <thetext>(In reply to comment #32)
&gt; Thanks Dominik.  I&apos;ll see what I can do.

Any update on the FreeType front here, Behdad? Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>804540</commentid>
    <comment_count>37</comment_count>
    <who name="Behdad Esfahbod">behdad</who>
    <bug_when>2013-01-10 10:55:16 -0800</bug_when>
    <thetext>I wasn&apos;t sure what to suggest to FreeType, so I put it off.  Went ahead and sent a mail right now bringing it to others&apos; attention.  We&apos;ll see what people have to offer.  It doesn&apos;t show up in the list archives yet, but it will be here:

  http://lists.nongnu.org/archive/html/freetype-devel/2013-01/index.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>805211</commentid>
    <comment_count>38</comment_count>
    <who name="Werner Lemberg">wl</who>
    <bug_when>2013-01-11 05:56:28 -0800</bug_when>
    <thetext>There is definitely a bug in FreeType.  Thanks for the report.  It seems that the rounded ascender and descender values must be added to get the height.  Instead, we currently add the ascender and descender values, then do rounding.

For verifying this assumption I ask you to run your program from comment #31 for a whole range of sizes, say, 8ppem to 30ppem (I don&apos;t use Windows :-).  Please tell me exactly the used version (and size) of LiberationSans-Regular.otf to avoid any ambiguities.  Maybe it also helps to repeat this with other MS core fonts, just to be sure.

Additionally, I would like to know which FreeType function Webkit was calling to get the incorrect results (in comment #31).  Theoretically, this shouldn&apos;t happen at all because there is already code in `sfobjs.c&apos; which uses ROUND only (as requested by TrueType), overriding the CEIL and FLOOR results FreeType is using for other font formats.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>805333</commentid>
    <comment_count>39</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2013-01-11 09:44:27 -0800</bug_when>
    <thetext>(In reply to comment #38)

Thanks for taking a look, Werner. I&apos;ll try to get you the data you requested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>806189</commentid>
    <comment_count>40</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2013-01-14 02:33:24 -0800</bug_when>
    <thetext>I was relying on our jhbuild freetype version being somewhat up to date - turns out this was an incorrect assumption. I should have done the bisecting earlier. In any event, freetype commit b0962ac34e660 
&quot;[truetype] Fix metrics on size request for scalable fonts.&quot; by Steven Chu changes my initial failure example to the better looking:

@@ -3,5 +3,5 @@
 layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
-      RenderText {#text} at (0,0) size 196x19
+      RenderText {#text} at (0,0) size 196x17
         text run at (0,0) width 196: &quot;red squares background image.&quot;

So, we&apos;re actually hitting the same problem that Steven has been describing in
http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00029.html

He&apos;s commenting there that 
FT_Request_Size - actually computes incorrect values for Ahem - similar for my case of Liberation Sans here. If for TrueType - the ascent and descent metrics are reset afterwards anyway - why are we calling it for scalable fonts?

Werner, regarding your original question: How is the incorrect rounding code reached? It is reached from FT_Request_Size -&gt; tt_size_request -&gt; ft_recompute_scaled_metrics (for details, I attached the stacktrace with freetype 2.4.11). But then, after Steven&apos;s patch - as far as I understand his patch - these incorrectly rounded values are discarded and replaced.

Would you still need the values from Windows after this finding?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>806190</commentid>
    <comment_count>41</comment_count>
      <attachid>182532</attachid>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2013-01-14 02:33:54 -0800</bug_when>
    <thetext>Created attachment 182532
Stacktrace leading to incorrect rounding</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>806203</commentid>
    <comment_count>42</comment_count>
    <who name="Werner Lemberg">wl</who>
    <bug_when>2013-01-14 02:54:45 -0800</bug_when>
    <thetext>Yes, please, just to be sure.

And sorry, I don&apos;t fully understand the rest of your last comment: Is there still a problem left?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>806208</commentid>
    <comment_count>43</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2013-01-14 03:02:47 -0800</bug_when>
    <thetext>(In reply to comment #42)
&gt; Yes, please, just to be sure.
&gt; 
&gt; And sorry, I don&apos;t fully understand the rest of your last comment: Is there still a problem left?

Well, it seems that the (incorrect) rounding code in question is still run, but then these preliminary values are replaced - do I understand that right? (Same as in Steven&apos;s analysis: http://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00029.html )

[...]
&quot;    FT_Request_Metrics( size-&gt;face, req ); /* Calculates new metrics,
incorrect for Ahem */

    if ( FT_IS_SCALABLE( size-&gt;face ) ) /* Ahem is scalable */
      error = tt_size_reset( ttsize ); /* Calculates proper metrics
stored in ttsize */
[...]

Shouldn&apos;t this code be changed so that FT_Request_Metrics is not called for SCALABLE fonts in order to avoid unnecessary computation?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>807347</commentid>
    <comment_count>44</comment_count>
      <attachid>176736</attachid>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2013-01-15 08:50:31 -0800</bug_when>
    <thetext>Comment on attachment 176736
Patch

Obsoleting patch - solved in Freetype &gt;= 2.4.6, see bug 106774.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>812877</commentid>
    <comment_count>45</comment_count>
    <who name="Dominik Röttsches (drott)">d-r</who>
    <bug_when>2013-01-22 03:39:09 -0800</bug_when>
    <thetext>Werner informed me that there has been indeed a fix/change in FreeType after our discussion here:
http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=e0469372be3870a5ad60b2c4586e9c281357bd28</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>175215</attachid>
            <date>2012-11-20 07:13:21 -0800</date>
            <delta_ts>2012-11-29 07:44:37 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-102374-20121120171109.patch</filename>
            <type>text/plain</type>
            <size>4129</size>
            <attacher name="Dominik Röttsches (drott)">d-r</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTM0OTQxCmRpZmYgLS1naXQgYS9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E1ldHJpY3Muc2V0TGluZUdhcChsaW5lR2FwKTsKIAogICAg
IGNhaXJvX3NjYWxlZF9mb250X3RleHRfZXh0ZW50cyhtX3BsYXRmb3JtRGF0YS5zY2FsZWRGb250
KCksICJ4IiwgJnRleHRfZXh0ZW50cyk7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>176736</attachid>
            <date>2012-11-29 07:44:45 -0800</date>
            <delta_ts>2013-01-15 08:50:31 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-102374-20121129174217.patch</filename>
            <type>text/plain</type>
            <size>4358</size>
            <attacher name="Dominik Röttsches (drott)">d-r</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTM2MTI1CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggYWZhNzUyM2ZkZjVlNjMw
MGQ0ZGQ0ODlkYjBkODNiYzk1OTg3MWYwMS4uNjllNjQzY2ExNDI3YzMyZmRmOTAzYzYzYjc2ZWRh
M2UxZGNkOTA5NiAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDI2IEBACisyMDEyLTExLTI5ICBEb21p
bmlrIFLDtnR0c2NoZXMgIDxkb21pbmlrLnJvdHRzY2hlc0BpbnRlbC5jb20+CisKKyAgICAgICAg
W0NhaXJvLCBGcmVlVHlwZV0gSW5jb3JyZWN0IGJhc2VsaW5lIHBvc2l0aW9uaW5nICYgbGluZSBz
cGFjaW5nIGR1ZSB0byByb3VuZGluZworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9z
aG93X2J1Zy5jZ2k/aWQ9MTAyMzc0CisKKyAgICAgICAgUmV2aWV3ZWQgY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KICAgICBm
bG9hdCBkZXNjZW50ID0gbmFycm93UHJlY2lzaW9uVG9GbG9hdChmb250X2V4dGVudHMuZGVzY2Vu
dCk7CkBAIC02NSwxMCArODQsMTEgQEAgdm9pZCBTaW1wbGVGb250RGF0YTo6cGxhdGZvcm1Jbml0
KCkKICAgICBtX2ZvbnRNZXRyaWNzLnNldEFzY2VudChhc2NlbnQpOwogICAgIG1fZm9udE1ldHJp
Y3Muc2V0RGVzY2VudChkZXNjZW50KTsKIAotICAgIC8vIE1hdGNoIENvcmVHcmFwaGljcyBtZXRy
aWNzLgotICAgIG1fZm9udE1ldHJpY3Muc2V0TGluZVNwYWNpbmcobHJvdW5kZihhc2NlbnQpICsg
bHJvdW5kZihkZXNjZW50KSArIGxyb3VuZGYobGluZUdhcCkpOworICAgIG1fZm9udE1ldHJpY3Mu
c2V0TGluZVNwYWNpbmcoYXNjZW50ICsgZGVzY2VudCArIGxpbmVHYXApOwogICAgIG1fZm9udE1l
dHJpY3Muc2V0TGluZUdhcChsaW5lR2FwKTsKIAorICAgIGNhaXJvX3NjYWxlZF9mb250X2Rlc3Ry
b3koZm9udFdpdGhvdXRNZXRyaWNzSGludGluZyk7CisKICAgICBjYWlyb19zY2FsZWRfZm9udF90
ZXh0X2V4dGVudHMobV9wbGF0Zm9ybURhdGEuc2NhbGVkRm9udCgpLCAieCIsICZ0ZXh0X2V4dGVu
dHMpOwogICAgIG1fZm9udE1ldHJpY3Muc2V0WEhlaWdodChuYXJyb3dQcmVjaXNpb25Ub0Zsb2F0
KHRleHRfZXh0ZW50cy5oZWlnaHQpKTsKIAo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>182532</attachid>
            <date>2013-01-14 02:33:54 -0800</date>
            <delta_ts>2013-01-14 02:33:54 -0800</delta_ts>
            <desc>Stacktrace leading to incorrect rounding</desc>
            <filename>stacktrace_leading_to_ft_recompute_scaled_metrics.txt</filename>
            <type>text/plain</type>
            <size>1602</size>
            <attacher name="Dominik Röttsches (drott)">d-r</attacher>
            
              <data encoding="base64">IzAgIGZ0X3JlY29tcHV0ZV9zY2FsZWRfbWV0cmljcyAoZmFjZT0weDExNTUwMTAsIG1ldHJpY3M9
MHgxMTViZWM4KSBhdCAvZmFzdC9kb21pbmlrL2Rldi9XZWJLaXRHaXRfRUZML1dlYktpdEJ1aWxk
L0RlcGVuZGVuY2llcy9Tb3VyY2UvZnJlZXR5cGUtMi40LjExL3NyYy9iYXNlL2Z0b2Jqcy5jOjI1
NjAKIzEgIDB4MDAwMDdmZmZmMDVmYzU1OSBpbiB0dF9zaXplX3JlcXVlc3QgKHNpemU9MHgxMTVi
ZWIwLCByZXE9MHg3ZmZmZmZmZjdlZjApIGF0IC9mYXN0L2RvbWluaWsvZGV2L1dlYktpdEdpdF9F
RkwvV2ViS2l0QnVpbGQvRGVwZW5kZW5jaWVzL1NvdXJjZS9mcmVldHlwZS0yLjQuMTEvc3JjL3Ry
dWV0eXBlL3R0ZHJpdmVyLmM6MjQ2CiMyICAweDAwMDA3ZmZmZjA1ZWI5YWMgaW4gRlRfUmVxdWVz
dF9TaXplIChmYWNlPTB4MTE1NTAxMCwgcmVxPTxvcHRpbWl6ZWQgb3V0PikgYXQgL2Zhc3QvZG9t
aW5pay9kZXYvV2ViS2l0R2l0X0VGTC9XZWJLaXRCdWlsZC9EZXBlbmRlbmNpZXMvU291cmNlL2Zy
ZWV0eXBlLTIuNC4xMS9zcmMvYmFzZS9mdG9ianMuYzoyODM0CiMzICAweDAwMDA3ZmZmZjA1ZWJh
NWUgaW4gRlRfU2V0X0NoYXJfU2l6ZSAoZmFjZT08b3B0aW1pemVkIG91dD4sIGNoYXJfd2lkdGg9
PG9wdGltaXplZCBvdXQ+LCBjaGFyX2hlaWdodD08b3B0aW1pemVkIG91dD4sIGhvcnpfcmVzb2x1
dGlvbj08b3B0aW1pemVkIG91dD4sIHZlcnRfcmVzb2x1dGlvbj08b3B0aW1pemVkIG91dD4pIGF0
IC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