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

Handle rlig for latin script #564

Draft
wants to merge 60 commits into
base: master
Choose a base branch
from
Draft

Conversation

Connum
Copy link
Contributor

@Connum Connum commented Feb 14, 2023

Description

This handles the rlig feature for latin scripts.

Motivation and Context

Despite being enabled for latin scripts even by default, rlig ligatures were only handled for Arabic script.

I did some minor refactoring of the ligature application to diminish code duplication betweeen arabic and latin script ligatures and the new rlig implementation. They now use the same method in a new src/features/commonFeatureUtils.js file, without breaking the existing file/module structure, with parameters for the script, feature and range. This might come in handy as we progress to implement new font features. Speaking of which, we should probably overhaul feature handling as we do so. This PR only enables rlig for the latin script, which fixes #554 (and fixes #479), while other scripts might need it as well and there are other features that might not be script-specific.

How Has This Been Tested?

Tested with the Pecita font provided in #479 and added corresponding tests for it (the font is under SIL Open Font License so I was able to use it directly for the tests), not breaking any other tests.

Screenshots (if appropriate):

before:
image
after (note the "qu" and "ck" shapes):
image
The rest of the differences to how it should look according to #479 can be attributed to not supporting the calt feature.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I did npm run test and all tests passed green (including code styling checks).
  • I have added tests to cover my changes.
  • My change requires a change to the documentation.
  • I have updated the README accordingly.
  • I have read the CONTRIBUTING document.

- added GPOS LookupType 4 parser for MarkBasePosFormat1 support
- added GPOS LookupType 9 parser for Extension Positioning SubtableFormat1 support
- tests coverage for all supported and not supported lookups of GPOS

TODO: Add a support device offsets for anchor (Parser.anchor) table format 3.
- introduced an union, ordered features lookup list
- refactored the Font options features update method
- supported kerning table
- supported kern lookup table
- supported mark to base attachments
- fix for kern sequence
- tests coverage
@Connum Connum requested a review from ILOVEPIE February 14, 2023 17:58
@ILOVEPIE
Copy link
Contributor

This might conflict with #535 and #557. Which should we merge first, one of those two PRs reworks the feature system (can't remember which one).

@ILOVEPIE
Copy link
Contributor

@Connum do we want to merge this first or rework it once #535 and #557 are merged?

@Connum
Copy link
Contributor Author

Connum commented Feb 17, 2023

Good question... Both of them made changes to bidi.js which I also altered, and both of them could probably benefit from the common helper function that I introduced. I think it's easier to merge those two first and have me adapt the rlig code to those changes instead of heaving to incorporate mine into both of the PRs.

# Conflicts:
#	src/bidi.js
#	src/features/arab/arabicRequiredLigatures.js
#	src/features/latn/latinLigatures.js
@Connum
Copy link
Contributor Author

Connum commented Feb 27, 2023

up-to-date with current master, blocked by #535 and #557

…onFormat1

- substitution algorithm to match specficiation (lookup - apply - lookup - apply)
- added support for multiSubstitutionFormat1 substitutions
- updated applySubstitution method for more flexibility
- tests coverage
@Connum
Copy link
Contributor Author

Connum commented Nov 30, 2023

I somehow managed to mess up this branch... Going to convert to draft until I find time to fix this.

@Connum Connum marked this pull request as draft November 30, 2023 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Required Ligatures (rlig) are not implemented for latin script. Ligatures not rendering
3 participants