<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Since the SVG -&gt; OTF Font Converter was enabled, some SVG layout tests are failing."
   href="https://bugs.webkit.org/show_bug.cgi?id=156148#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GTK] Since the SVG -&gt; OTF Font Converter was enabled, some SVG layout tests are failing."
   href="https://bugs.webkit.org/show_bug.cgi?id=156148">bug 156148</a>
              from <span class="vcard"><a class="email" href="mailto:clopez&#64;igalia.com" title="Carlos Alberto Lopez Perez &lt;clopez&#64;igalia.com&gt;"> <span class="fn">Carlos Alberto Lopez Perez</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=156148#c7">comment #7</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=156148#c6">comment #6</a>)
&gt; &gt; I don't understand the interaction between how we use FreeType and Harfbuzz,
&gt; &gt; but keep in mind that we do use and depend on both.
&gt; (In reply to <a href="show_bug.cgi?id=156148#c6">comment #6</a>)
&gt; &gt; I don't understand the interaction between how we use FreeType and Harfbuzz,
&gt; &gt; but keep in mind that we do use and depend on both.
&gt; 
&gt; We follow the specification in the Microsoft docs (meaning: we don't use any
&gt; Apple-specific extensions).
&gt; 
&gt; The best way to save the generated file is to modify convertSVGToOTFFont()
&gt; in SVGToOTFFontConversion.cpp. It returns an Optional&lt;Vector&lt;char&gt;&gt;. Just
&gt; before returning, that function could write out the vector to a file. (Keep
&gt; in mind you'll have to modify the WebKit2 sandbox rules to allow the Web
&gt; Process access to the disk)</span >

Not sure if the WebKit2 sandbox is not enabled/working on the GTK+ port
or if it is enabled but allowing write to /tmp, but I was able to dump the OTF
file generated to disk with just something like this
<a href="http://people.igalia.com/clopez/wkbug/156148/SVGToOTFFontConversion_todisk.diff">http://people.igalia.com/clopez/wkbug/156148/SVGToOTFFontConversion_todisk.diff</a>

I uploaded that generated OTF font to here <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans.otf">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans.otf</a>

I also converted the original SVG font to OTF using onlinefontconverter.com
and uploaded it to here <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_onlinefontconverter.com.otf">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_onlinefontconverter.com.otf</a>



And I have compared the two OTF fonts with some utilities and this are the main differences I can see:

 1) Difference in tables

- The OTF font generated by WebKit has a kern table. But the one generated by onlinefontconverter.com has instead a GPOS one.

- List of tables for OTF font generated by WebKit: <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_ttxtables.txt">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_ttxtables.txt</a>
- List of tables for OTF font generated by onlinefontconverter: <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_onlinefontconverter.com_ttxtables.txt">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_onlinefontconverter.com_ttxtables.txt</a>

2) Converting the OTF font to ttx format (a short of xml that the ttx utility from fonttools produces) causes errors with the WebKit otf font but not with the onlinefontconverter OTF one:

- The conversion from the OTF font generated by WebKit gives this errors: <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_ttxdetails_stderr.txt">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_ttxdetails_stderr.txt</a> and generated this XML <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_ttxdetails.xml">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_ttxdetails.xml</a>
- The conversion from the OTF font generated by onlinefontconverter gives no error: <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_onlinefontconverter.com_ttxdetails_stderr.txt">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_onlinefontconverter.com_ttxdetails_stderr.txt</a> and generates this XML <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_onlinefontconverter.com_ttxdetails.xml">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/SVGFreeSans_onlinefontconverter.com_ttxdetails.xml</a>

- Trying to convert the xml back to otf is only possible with the OTF font generated by onlinefontconverter, with the WebKit one the ttx utility aborts with an ugly backtrace.


3) To conclude my tests, I have also created this test page:

<a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/onlinefontconverter.com/test_svg_otf.html">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/onlinefontconverter.com/test_svg_otf.html</a>

 - And generated 3 screenshots at <a href="http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/screenshots/">http://people.igalia.com/clopez/wkbug/156148/SVGFreeSans/screenshots/</a>

As you can see there is a clear difference between the results rendered with the OTF font generated by WebKit and the one generated by onlinefontconverter.

This difference is also appreciable in  safari from current webkit trunk.

So.... I may be wrong, but I think there is something wrong with the OTF font that WebKit generates.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>