> Date: Tue, 08 Apr 2025 17:56:09 +0000 > Cc: "'Asmus Freytag'" <[email protected]>, [email protected] > From: NeatNit via Unicode <[email protected]> > > > If replacing "->" by an arrow character can change its direction, isn't it > > up to the autocorrect software to analyze the bidi context and select the > > correct arrow? The rule should be to select whatever substitution gives the > > same appearance (direction) as what the user would see for the string they > > typed. > > The problem is this replacement is done (as far as I know) outside of any > rendering context, when the text is just a sequence of character codes. It's > not reasonable to know which direction the text goes. Sometimes it's > completely impossible, if the text direction depends on context that isn't > available at the time of replacement.
The above is strictly speaking inaccurate. Any serious text rendering nowadays requires a shaping engine, such as HarfBuzz, and ligation of "->" into "→" would be done by such a shaper in cooperation with a font that supports ligatures. The shaping engine _is_ aware of the bidi context and the script of the text it shapes, so it could in principle mirror the arrow. The question is whether the cases where mirroring is the correct rendering by far outweigh the non-mirroring cases. If yes, the shaper could mirror and expect text which wants to avoid that use directional override controls. If not, mirroring will not make sense.
