[FriBidi] fribidi_reorder_runs()

Behdad Esfahbod behdad at behdad.org
Wed Feb 8 21:33:47 UTC 2017


I'll try to put it back in FriBidi.  The rollback was necessary because the
original commit was exposing structs that we didn't want to.

On Wed, Feb 8, 2017 at 10:20 AM, Eduardo Castiñeyra <
eduardo at brainstorm3d.com> wrote:

>
>
> On 2/8/2017 7:02 PM, Eli Zaretskii wrote:
>
>> Cc: fribidi at lists.freedesktop.org
>>> From: Eduardo Castiñeyra <eduardo at brainstorm3d.com>
>>> Date: Wed, 8 Feb 2017 16:59:04 +0100
>>>
>>> On 2/7/2017 5:19 PM, Eli Zaretskii wrote:
>>>
>>>> From: Eduardo Castiñeyra <eduardo at brainstorm3d.com>
>>>>> Date: Tue, 7 Feb 2017 16:39:01 +0100
>>>>>
>>>>> It turned out that our incorrect way to integrate fribidi and harfbuzz
>>>>> (let fribidi reorder all the characters and shape as full LTR in
>>>>> harfbuzz) is "surprisingly" causing problems.
>>>>>
>>>>> The problem is mainly with the parenthesis. It looks like the shaper
>>>>> should flip the direction of the parenthesis when it belongs to a RTL
>>>>> run.
>>>>>
>>>> Shouldn't reordering mirror parentheses if their level is even?
>>>>
>>> AFAIK, parenthesis are neutral, they inherit the direction of the text
>>> surrounding them
>>>
>> Yes, and if the surrounding text is RTL, the parentheses should be
>> mirrored as part of reordering.  See L4 in the UBA (a.k.a. "UAX#9")
>> description.  It says:
>>
>>    A character is depicted by a mirrored glyph if and only if (a) the
>>    resolved directionality of that character is R, and (b) the
>>    Bidi_Mirrored property value of that character is Yes.
>>
>>
> That makes sense. Nevertheless the direction of the parenthesis is just an
> example of why we need that fribidi_reorder_runs function which was what my
> question was actually about.
>
> I think that, in a glyph based renderer, changing the direction of the
> parenthesis should be on harfbuzz's roof not fribidi. fribidi's
> responsibility would be limited to reordering the runs and labeling them
> with their level.
>
> Behdad proposed an algorithm to reorder the runs ourselves
>
> https://github.com/behdad/linear-reorder/blob/master/linear-reorder.c
>
> but he also implemented it in FriBiDi and then rolled it back.  Of course
> we'd rather use the one implemented in FriBiDi as soon as it is available.
> Hence my question.
>
>
> _______________________________________________
> fribidi mailing list
> fribidi at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/fribidi
>



-- 
behdad
http://behdad.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fribidi/attachments/20170208/637e27db/attachment.html>


More information about the fribidi mailing list