[HarfBuzz] Exposing attachment tree / Arabic joining to shaping clients

Ebrahim Byagowi ebraminio at gmail.com
Wed Nov 13 09:44:30 UTC 2019


> IranNastaliq had broken Kashida justification in IE6 but not in IE7, [..]

This is probably inaccurate as from IE6 to Microsoft Edge / Microsoft Word,
Kashida justification results in broken shaping like this,

[image: image.png]
Isn't it great…

> Interesting.  Can you provide test results for this?  Let's understand
what changed.

However there is still another some difference between IE versions,

Open this link https://ebraminio.github.io/extra/kashida.html in this tool
https://netrenderer.com/index.php

IE 9: (broken)
[image: image.png]

IE 11: (same page, Kashida justification is skipped for some reason)
[image: image.png]
Not sure how this can be explained, maybe someone has attempted to prevent
some fonts to get Kashida justification and maybe the detection was font
based, the reason it is still failing for IranNastaliq but not for Amiri,
but in any case it is imperfect.

On Wed, Nov 13, 2019 at 7:48 AM Behdad Esfahbod <behdad at behdad.org> wrote:

> On Tue, Nov 12, 2019 at 5:30 AM Ebrahim Byagowi <ebraminio at gmail.com>
> wrote:
>
>> This is very interesting Behdad. Can this have Kashida priority also,
>> like what harfbuzz-old
>> <https://github.com/harfbuzz/harfbuzz-old/blob/master/src/harfbuzz-arabic.c#L402>
>> had.
>>
>
> I'm hesitant to do that.  The reason I want to expose this is such that
> clients can do that while we figure out how to implement justification.
>
>
>> > [..] even the ones that do NOT use cursive joining.
>>
>> Guess this a property of a font rather than a buffer?
>>
>
> It's property of how font is designed.  Some glyphs in the font might, and
> others not.
>
>
>> IranNastaliq had broken Kashida justification in IE6 but not in IE7, so
>> Microsoft probably has some insight to this, how to detect a font (or a
>> buffer) is not useful for Kashida justification.
>>
>
> Interesting.  Can you provide test results for this?  Let's understand
> what changed.
>
>
>> > [,,] The latter definitely belongs to the pos buffer
>>
>> Guess can't provide much help here. Just about shape of the API, maybe
>> like the way unsafe to break, hb_buffer_get_glyph_flags, is exposed, would
>> be useful for Arabic joining info and guess exposing priority can be done
>> in the some way but we can just forget about it for now.
>>
>> Thanks!
>>
>> On Thu, Oct 31, 2019 at 11:12 PM Behdad Esfahbod <behdad at behdad.org>
>> wrote:
>>
>>> Hi,
>>>
>>> For reason that many of you know (letter-spacing, Arabic elongation,
>>> other postprocessing) I like to expose attachment data to the shaping
>>> clients.  There's two separate pieces so far:
>>>
>>> - The Arabic joining info, which is applicable to all Arabic-like fonts
>>> even the ones that do NOT use cursive joining.
>>>
>>> - Mark attachment and cursive attachment.  These form a tree with a
>>> attachment-type enum.
>>>
>>> I'm not sure which slots in the pos buffer to expose this in.  The
>>> latter definitely belongs to the pos buffer, whereas the former is more a
>>> property of the text.  So I feel like we should expose them separately.
>>>
>>> Ideas?
>>>
>>> --
>>> behdad
>>> http://behdad.org/
>>> _______________________________________________
>>> HarfBuzz mailing list
>>> HarfBuzz at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>>
>>
>
> --
> behdad
> http://behdad.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20191113/98fa6e1c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 28538 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20191113/98fa6e1c/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 78859 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20191113/98fa6e1c/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 75643 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20191113/98fa6e1c/attachment-0005.png>


More information about the HarfBuzz mailing list