-
Notifications
You must be signed in to change notification settings - Fork 499
Add UI names for Stylistic Set / Character Variants features #452
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
base: master
Are you sure you want to change the base?
Conversation
Nice! I think it could use an example & test with a font that has Stylistic Set, How did you test this? |
One note: Not only Stylistic Sets (ss01–ss20) can have an optional UI Name ID but also the Character Variant feature (cv01–cv99). Maybe it would be good to implement this as well, once you are working on it? The font Source Code Variabe is using both. |
@Jolg42 I tested this in development on the included example page (the one served with the I've now added automated tests for the added features. As for an example, do you have anything specific in mind? An addition to the example page or the README? @vinuel Good point, thanks. The FeatureParams table is now being parsed for |
I just wonder, isn't this ready to get published? |
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.
LGTM! 🚀
@ILOVEPIE I only resolved merge conflicts in .js.map files that will be re-generated anyway, but therefore my review does not count towards allowing the merge because I'm technically the last pusher - do you want to review it as well, or shall I proceed with the merge? |
We always want to have someone else review first. |
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.
Looks good apart from those comments I made, Idk if we want to make those changes to the Parser first as a separate PR and then include this one, or if we want to approve this PR and then make those changes with a later PR.
Yeah, let's do the optimizations in a separate PR! Other than that, it looks good to go! |
@Connum seeing as this needs a code update anyways to merge, can we change those |
@Connum did we run the tests? |
Narf! No we didn't! 😉 I'll look into it! |
So I just read the spec and feature names can indeed be platform-specific as well, so we can't get rid of the overhead that the platform preservation has caused:
but rather
|
that sounds good but I don't think those numeric indexes are supposed to be showing up in the names object. |
Where should we store them instead? |
Numeric names indexes are by the way already sotored that way, so I don't think this should be fixed in this PR. |
Description
When parsing the features list, the
featureParams
offset value is being retrieved but the FeatureParams table itself is not. With these changes, the FeatureParams table will be extracted and theuiNameId
from it will be matched against thename
table, and the resultingname
record will be inserted into the feature definition for featuresss01
–ss20
.Motivation and Context
This is intended to close #399.
How Has This Been Tested?
I tested the code with several fonts that had stylistic set names assigned as well as with ones that didn't.
I ran the automated tests – I had to adjust the parse.js test to include the
tableOffset
parameter needed to go back to the feature table and add missing data. This implementation is not ideal but I had no better idea due to the highly functional/declarative style of this project (also, my noob skills). Open to suggestions on a better implementation here.Screenshots (if appropriate):
Types of changes
Checklist:
npm run test
and all tests passed green (including code styling checks).