Incorrect ligatures in RTL/bidi text
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 82k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
Issue originally from https://github.com/harfbuzz/harfbuzz/discussions/5278
Was noticed back in 2022 but not acted upon: https://github.com/tonsky/FiraCode/issues/1355#issuecomment-1015525626
Hi! Fira Code ligatures render incorrectly when used in RTL text. According to @behdad, this is because the ligatures use calt, which is not bidi-aware, and they should instead use ltra and rtla. Please read his fantastic explanation: https://github.com/harfbuzz/harfbuzz/discussions/5278#discussioncomment-12789803
I won't pretend to understand this issue well enough to comment further, so I'll just provide an example:
https://fonts.google.com/specimen/Fira+Code?preview.text=A%20-%3E%20B,%20%D7%90%20-%3E%20%D7%91
After opening that link, you will most likely see this:
If you try to interact with the text in any way, it will most likely turn into this:
Clearly, both results are wrong. More context can be found in the discussion linked at the top of this issue.
Thank you!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked HarfBuzz discussion and the Fira Code issue context to understand the bidi and ligature behavior described. Reproduce the examples in the linked Google Fonts preview, then verify that RTL text renders consistently before and after interaction, with the incorrect shaping no longer present.
Written by the indexing model from the issue text.
Assessment
- Domain
- design
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100