After some quick research, I believe that TextLayout
is kind of modern approach to font rendering as it uses direct engines from OS. Using GlyphArrangement
instead eliminates problems with ligatures (because one glyph = one char) but there are problems with some languages and fonts. I am referring now to this old discussion:
But if I stay with text rendering and edition using TextLayout
, then the problem mentioned above arises: how to get a correct caret position within a set of glyphs with ligatures? From what I see on macOS there is a function just for that: CTFontGetLigatureCaretPositions
, but it means forking JUCE and adding extra methods to TextLayout::Glyph
etc. And I feel it can be even more complicated. Please correct me if I am wrong?
@stephenk
Have you figured out how to disable ligatures? I see an old topic where your asked about it. I investigated CTFontGetLigatureCaretPositions
and it doesn’t give any results. According to the docs: “This function might not be able to produce positions if the font does not have the appropriate data, in which case it will return 0.” Apparently, this is the case , so my idea is to disable ligatures and still use native font renderings.