[HarfBuzz] How to solve shaping after BiDi

Eduardo Castineyra eduardo at brainstorm.es
Mon Oct 28 04:48:09 PDT 2013


Hi,

I have an unicode string with the bidi already solved, but I don't know 
exactly how to feed harfbuzz with the result. There is a list of things 
I don't know and finally my guess on how this should be solved:

1) Given the friBiDi already switched the order of the glyhs, do I still 
need to set the buffer direction to RTL ?
2) Do I have to shape each unidirectional segment separately? How do I 
manage the clusters?
3) How do I combine the L_to_V output from friBiDi with the hb clusters?

Could you please correct me if I got something wrong with this algorithm?

from friBiDi, I'm using only the l2v, v2l and RTL props, and completely 
discarding the glyhps:

1) friBiDi pass
2) Using the l2v list identify the direction of every character
3) Split the original text into monodirectional runs.
4) For each run, we save the lowest visual position (LVP) and the lowest 
logical position (LLP)
5) Shape every segment separately (setting the appropriate buffer 
direction).
6) Sort the segments based on their LVP
7) Add the LLP to the cluster of every glyph.

Isn't there an easier way to do this?

Thanks!



More information about the HarfBuzz mailing list