troika icon indicating copy to clipboard operation
troika copied to clipboard

Option to disable ligature substitution

Open blenderskool opened this issue 1 year ago • 1 comments

Would it be possible to allow disabling ligature substitution? I could think of two cases where this would be useful:

  1. 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.
  2. Rendering each character as a separate mesh: I was using the caret positions in textRenderInfo to 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.
image

blenderskool avatar Dec 15 '24 12:12 blenderskool

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.

lojjic avatar Dec 15 '24 17:12 lojjic