# Wrong -\> arrow direction in RTL text contexts

**URL:** <https://meta.discourse.org/t/wrong-arrow-direction-in-rtl-text-contexts/360760>\
**Category:** Feature\
**Tags:** rtl\
**Created:** [April 7, 2025, 2:39pm UTC](https://meta.discourse.org/t/wrong-arrow-direction-in-rtl-text-contexts/360760 "2025-04-07T14:39:09Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![NeatNit](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neatnit/32/497918_2.png) [@NeatNit](https://meta.discourse.org/u/NeatNit)\
**Post date:** [April 9, 2025, 12:10pm UTC](https://meta.discourse.org/t/wrong-arrow-direction-in-rtl-text-contexts/360760/11 "2025-04-09T12:10:03Z")

</div>

I have joined the Unicode mailing list to propose an addition to Unicode that would be a solution in cases like this. One of the responses I got was this:

> > (Me:) 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.

They are talking about something like this: [GitHub - tonsky/FiraCode: Free monospaced font with programming ligatures · GitHub](https://github.com/tonsky/FiraCode)

Consider switching to the ligature approach instead of blind character replacement. Another arguable advantage would be that when copy-pasted, the text would still be “-\>” instead of an arrow.

I haven’t looked into the technical details of how to implement this, I’ll leave that to you if you choose to use this solution.

Edit: well, unsurprisingly, Fira Text in particular isn’t designed with RTL in mind, so the rendering is off - but at least it’s pointing the right way! [https://fonts.google.com/specimen/Fira+Code?preview.text=A%20-\>%20B,%20א%20-\>%20ב](https://fonts.google.com/specimen/Fira+Code?preview.text=A%20-%3E%20B,%20%D7%90%20-%3E%20%D7%91)  
Firefox:

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/0/e/a0e640b6030636f6dd3312497fd26e0446980cd5.png)

I’m not sure if there exists a font today that does this correctly and explicitly supports RTL/bidi.

---

_[View the full topic](https://meta.discourse.org/t/wrong-arrow-direction-in-rtl-text-contexts/360760)._
