Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(troika-three-text): Add a property to toggle ligatures #352

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blenderskool
Copy link

Changes:

  • Added a enableLigatures property to Text to toggle ligature substitution.
  • Ligature substitution is also automatically disabled when letter spacing is not zero.

This PR fixes #349

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) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to disable ligature substitution
2 participants