feat(troika-three-text): Add a property to toggle ligatures#352
feat(troika-three-text): Add a property to toggle ligatures#352blenderskool wants to merge 2 commits intoprotectwise:mainfrom
Conversation
| for (let ci = 0; ci < glyphIds.length; ci++) { | ||
| if (!joiningForms || !isJoiningFeature || formsToFeatures[joiningForms[ci]] === feature.tag) { | ||
| Typr.U._applySubs(glyphIds, ci, tab, lookupList) | ||
| if (enableLigatures) { |
There was a problem hiding this comment.
I noticed this part was responsible for ligature substitution, and I moved it behind the flag, but if it inadvertently disables something else do let me know!
There was a problem hiding this comment.
Ah, yeah I think we need to be more selective -- some substitutions are required for correctness (e.g. in Arabic scripts). We'll need to filter the supportedFeatures to remove just the stylistic ligatures. I think that's liga, but I'd have to research the others.
There was a problem hiding this comment.
Documentation for the feature tags: https://learn.microsoft.com/en-us/typography/opentype/spec/features_ko#tag-liga
There was a problem hiding this comment.
Thanks, I've updated the code to only ignore liga, dlig and clig feature tags when non-zero letter spacing is applied. I think dlig and clig aren't supported right now going by this line:
const supportedFeatures = /^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws|ccmp)$/so they don't have any effect but good to keep them if it gets supported in the future.
Changes:
enableLigaturesproperty toTextto toggle ligature substitution.This PR fixes #349