troika
troika copied to clipboard
Option to disable ligature substitution
Would it be possible to allow disabling ligature substitution? I could think of two cases where this would be useful:
- Applying letter spacing. Currently, the symbols that are ligature substituted appear as one and a non-zero letter spacing has no effect on it. I should be able to disable ligatures in such cases so that every character has the letter spacing applied.
- Rendering each character as a separate mesh: I was using the caret positions in
textRenderInfoto place one text mesh for each character for an animation I was creating involving separate characters. In this case too, the ligatures aren't really useful as rendering ligatures with separate character meshes isn't really possible, so the alignment and spacing looks off.
That's a great idea, thank you for the examples.
The letter-spacing case is an obvious one I just hadn't thought of -- I did a little testing and it looks like browsers disable the ligatures automatically with any nonzero letter-spacing, and I think it makes sense to follow their lead.
But I might as well expose an explicit flag as well, which would handle your other case.