Please note that both f’s are joined graphically together, then it is a small gap and next two coupled f’s appear. The typeface name reported for the font is Sans-Serif in sharp brackets. If I change font for something else like standard Arial etc. then it is ok:
That’s a great question. On the Mac, you can use FontBook to look at the character sets, or to try out some sample text with various fonts. Common ligatures are “fi”, “fl”, “ff”, “ffi”, “ffl” “->”, “<-” etc.
Yes, I have to look into this… Basically, I just want to click on some glyph to put a caret in a correct position - and it is simple when number of glyphs corresponds to stringRange of glyph-runs, which is the case for texts without ligatures.
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?
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.
I have not. In my case, the only solution was to edit my embedded font to remove the ligatures that I didn’t want. There are other posts on here asking similar things and no one has ever figured out how to disable ligatures or if it is even possible.
I’m not sure what you are trying to do, whether you need to handle text for multiple different fonts, or whether you want to use one particular font for your application. If you want to settle on a font to use, you can edit it to remove ligatures.
I implemented a text editor with capabilities lacking in the regular JUCE TextEditor (different fonts, colours, formatting) to upgrade existing apps and to be used in the future. It is already working but now this ligature issue appeared, and without correct caret positioning it is just useless. I don’t have time to implement a completely new solution based on Harfbuzz etc., so right now it seems that using GlyphArrangment with all its shortcomings is the way to go.