[HarfBuzz] mirroring support in hb_shape

Behdad Esfahbod behdad at behdad.org
Fri Apr 2 09:14:55 PDT 2010

On 04/02/2010 05:53 AM, Jonathan Kew wrote:
> Hi Behdad,
> I think there's an issue with how (or rather *where*) mirroring is implemented -- currently hb_mirror_chars is called from hb_substitute_default, right before hb_map_glyphs. The problem with this is that by the time hb_substitute_default is called, the buffer has been forced to "native" direction, but AFAICS we need the mirroring to be based on the original direction instead.
> This causes problems if we have text such as <RLO>Hello (world)<PDF>, which will form a RTL run; hb_ensure_native_direction will reverse it, in order that OT lookups can work properly, but this will prevent the parens being mirrored because hb_mirror_chars will see the run as being LTR.
> To resolve this, I've moved the call to hb_mirror_chars out of hb_substitute_default, and put it before hb_ensure_native_direction, as shown below. Please see if you think this is a reasonable thing to do.

You are indeed correct.  Very good point.  Will keep that in mind when adding
rtlm/ltrm features.


> JK

More information about the HarfBuzz mailing list