-
|
Reproduced in both Firefox 137.0 and Chromium 135.0.7049.52 on Linux Mint 22. The screenshots are from Firefox. Chromium results differ slightly in irrelevant ways. Open this URL and look at the rendered result: https://fonts.google.com/specimen/Fira+Code?preview.text=A%20-%3E%20B,%20%D7%90%20-%3E%20%D7%91 Now cut the text out of the input box (leaving it blank), then paste it back in: There are two issues here:
|
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 19 replies
-
|
It's a shortcoming of the font. The font does NOT support right-to-left features like |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the report though. Sorry for the terse reply. |
Beta Was this translation helpful? Give feedback.
-
|
It's much more tolerable when you apologize :) Are you aware of any font that supports this ligature and works correctly in RTL and in LTR? If not, are you certain that HarfBuzz will produce correct results if someone crafts such a font? I don't have the know-how to test any of this beyond what I've already found. |
Beta Was this translation helpful? Give feedback.
-
There is no |
Beta Was this translation helpful? Give feedback.
-
I'll elaborate a bit later. :) |
Beta Was this translation helpful? Give feedback.
-
I see! Thanks for the patience. I'm clearly out of my depth, so if you're certain this is not an issue, I'm happy to accept that. |
Beta Was this translation helpful? Give feedback.
-
|
The question about fonts which support |
Beta Was this translation helpful? Give feedback.
-
|
This is what happens in OpenType text shaping for this case: The text has "->", and the bidi algorithm converts it to "-<" logically but to be rendered right-to-left. So far so good. The font however, has features that see the text "-<" in that order, not knowing that the text is right-to-left, and they produce the shape you see. OpenType lookups in general don't know which direction they are operating on. It's a shortcoming of OpenType: harfbuzz/boring-expansion-spec#57 In the 2000s, to work around this limitation, four feature tags were standardized: https://learn.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-rtla In my previous comment I said So. Currently, Fira Code, I suppose, uses the feature tag I still intend to fix properly by way of the first issue linked above, to make the lookup data in the font tell the shaper which direction it expects the text in, such that the shaper and the font designer agree on the direction. That is how, AAT fonts work for example. But that is not in OpenType and not in the pipeline yet. So, for now, what I said about Please file an issue with Fira Code and link here. @khaledhosny and I can adviseon how to do it. |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
@behdad Do you know if Google Fonts is using harfbuzz to power their font subsetter? It could be argued this is a subsetter bug, or at least should be an optional subsetter feature: because it cannot know what directionality will be applied when rendering, it should extend the requested character coverage to include codepoints reachable by Unicode bidi mirroring. |
Beta Was this translation helpful? Give feedback.
-
|
Here's what OpenType has to say on the issue: |
Beta Was this translation helpful? Give feedback.
-
|
And for the curious, this is the Fira Code https://github.com/tonsky/FiraCode/blob/master/features/calt/hyphen_arrows.fea |
Beta Was this translation helpful? Give feedback.


It's a shortcoming of the font. The font does NOT support right-to-left features like
rtlm, etc. There's nothing in HarfBuzz to fix over a font shortcoming like that.