<div dir="ltr"><div class="gmail_extra">Hi behdad,<br><br><div class="gmail_quote">On Thu, Aug 6, 2015 at 7:05 PM, Behdad Esfahbod <span dir="ltr"><<a href="mailto:behdad.esfahbod@gmail.com" target="_blank">behdad.esfahbod@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Tom,<br>
<span><br>
On 15-08-07 01:15 AM, Tom Hindle wrote:<br>
> Hello,<br>
><br>
> Recently I created a experimental patch for Firefox to allow use of harfbuz's<br>
> uniscribe backend, selectable via a about:config option.<br>
><br>
> The patch can be seen here:<br>
> <a href="https://hg.mozilla.org/try/rev/08eef5e76a40" rel="noreferrer" target="_blank">https://hg.mozilla.org/try/rev/08eef5e76a40</a><br>
<br>
</span>I'm curious. Why did you do this?<br></blockquote><div><br></div><div>I will try and be as concise as I can :)<br></div><div><br></div><div>In general, our application used to use uniscribe (via IE) now it uses halfbuzz (via Firefox), for the most part this is a very good thing, <br>however if users use fonts which may not be modified and they prefer how uniscribe shaped these fonts, then having a optional uniscribe fallback<br></div><div>is a good, quick and safe solution.<br><br></div><div>The specific case is that harfbuzz + uniscribe behave differently for the font "Noori Nastaliq MT" when handling GPOS Mark to Ligature attachments. (I believe due to NULL entry in the LigatureAnchor table for class 0)<br></div><div>Although I couldn't determine if this was a bug in uniscribe or a bug in Harfbuzz. (Plus I was informed that OT shaping implementation behavior differences was just reality - which due to the complexity of some of the tables didn't seem unsurprising.) <br></div><div><br></div><div>If I was allowed to share the font then, I would describe the problem something like this:<br><br>hb-view Noori-Thorn-v20a2-sb3-pr1.ttf
"دینا" --output-format=png --output-file=uniscribe.png
--shaper=uniscribe<br>
hb-view Noori-Thorn-v20a2-sb3-pr1.ttf "دینا" --output-format=png --output-file=ot.png --shaper=ot<br><br></div><div>Now even if, dispute not being able to file a proper bug report, this was determined to be a halfbuz bug and was fixed, a uniscribe fallback option would still be useful for:<br><br></div><div>1. Similar use cases where it's a uniscribe bug.<br></div><div>2. A quicker and lower risk solution while, either halfbuz gets updated in firefox, and then the firefox version is updated in our app, or I build a custom firefox, with a updated halfbuz.<br></div><div>(I could justify the lower risk if required - but trying to be concise)<br><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
<br>
> In order to get it work I had to make a couple of changes to hb-uniscribe.cc<br>
><br>
> This was because when Firefox code calls<br>
><br>
> hb_font_set_scale(mHBFont, scale, scale);<br>
><br>
> Its scale values are "16.16 fixed point" format (floats converted to int by<br>
> multiplying by 65536) and so it expects values returns by<br>
> hb_buffer_get_glyph_positions to be the same format.<br>
<br>
</span>Yes, I had become aware of this, and that's why I stopped building the Win32<br>
binaries with uniscribe backend enabled, until I fix it.<br>
<span><br>
<br>
> I made hb-uniscribe.cc comply with this by scaling by ratio between<br>
> font->(x|y)_ppem and font->(x|y)_scale.<br>
><br>
> Is this something hb-uniscribe.cc should already be doing or is the Firefox<br>
> code making unsafe assumptions?<br>
<br>
</span>The uniscribe backend should do this indeed. I did this in the CoreText<br>
backend. Will check your code and fix it eventually.<br></blockquote><div><br></div><div>Thank you appreciate the feedback!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Thanks,<br>
behdad<br>
<span><br>
> The latest gfxHarfBuzzShaper.cpp source code can be seen here:<br>
> <a href="https://hg.mozilla.org/mozilla-central/file/03e3d77d1b6b/gfx/thebes/gfxHarfBuzzShaper.cpp" rel="noreferrer" target="_blank">https://hg.mozilla.org/mozilla-central/file/03e3d77d1b6b/gfx/thebes/gfxHarfBuzzShaper.cpp</a><br>
><br>
><br>
><br>
> Thanks<br>
> Tom<br>
><br>
><br>
><br>
><br>
><br>
><br>
</span>> _______________________________________________<br>
> HarfBuzz mailing list<br>
> <a href="mailto:HarfBuzz@lists.freedesktop.org" target="_blank">HarfBuzz@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/harfbuzz" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/harfbuzz</a><br>
</blockquote></div><br></div></div>