-
Notifications
You must be signed in to change notification settings - Fork 489
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
Feature/ccmp #688
Feature/ccmp #688
Conversation
This looks like a great addition! Please check why the build is failing: https://github.com/opentypejs/opentype.js/actions/runs/8388243929/job/22972963564?pr=688 |
remove file header
remove file header
remove file header
missing ","
remove file header
okay, i removed the file header and fixed a code error. |
change "" to ''
There are still some lining issues, can you please resolve them? Then you can run |
Please also add tests for the ligature substitution format 3 and the substitution type 21 (which should catch the mistake I mentioned in the comment I just added to the associated code) |
I'm trying to add tests for ligature with sub_5, it doesn't work. Maybe I need a few days to fix it. This may modify the code related to "liga" and "rlig". |
Add a new case in chainingSubstitutionFormat3.
Removed substitutionType 21, it's no longer used
I removed substitution type 21 and ligatureSubstitutionFormat3. As an alternative, use chainSubstitutionFormat3 to process the sub5 table. Sub5 may exist in liga and ccmp, both of which are processed using ligatureSubstitutionFormat3. I added test code to ensure they work properly. |
Thanks for your work! Two more things, then we'll hopefully be ready for review:
Big thanks again! |
removed test/liga.js added new test in test/featureQuery.js
|
Great to see someone being interested in contributing! There is an issue with an overview of TODOs: #374 |
Thanks for your suggestion. I'll finsh the format 5.1,5.2,5.3 in this PR, please merge them later. |
@Connum , I have added support for 5.1. |
By the way, 5.1 and 5.3 are currently only effective in the 'ccmp' table and cannot be recognized in the 'liga' table. I have tested their performance in Figma (halfbuzz+freetype) and they can take effect anywhere. I think this is caused by an error in the 'language tag', and I will describe it in the issues later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few comments for things that need clarification or fixing.
* @param {ContextRange} range a range of tokens | ||
*/ | ||
function ccmpReplacementLigatures(range) { | ||
const script = 'delf'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be 'DFLT'?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only place in the codebase with 'delf'
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this made it through the review process, I didn't follow up because it was marked as resolved. Good catch, thanks!
@TonyJR could you comment on this please? I think it should be DFLT for the default script. And for the future, please let reviewers resolve the conversations. :)
Another thing I noticed: The 'ccmp' tag was already present in the Line 114 in 6408975
Should this be present in Line 25 in 6408975
Line 40 in 6408975
Or is it maybe not needed at all, because the This might also relate to your comment #688 (comment) ? I think you forgot to describe the issue with the language tag for us. Could it be related to the wrong |
Get rid of the code duplication between '51' and '53'
Support noto-emoji
Description
add a new contextChecker for ccmp table in tokenizeText()
add a new substitutionFormat for 'lookup sub_5'
Motivation and Context
This PR resoved multi-character emoji #511.
noto-emoji uses the 'ccmp' table to solve the 'multi-character for one emoji' problem, which is a 'Language forms' feature that should be executed before all other features. When parsing the noto-emoji font, I found that 'lookup sub_5' could not be parsed correctly, so I added a substitutionFormat to handle this issue.
How Has This Been Tested?
The unit tests passed and I added a test case for this feature.
Types of changes
Checklist:
npm run test
and all tests passed green (including code styling checks).