-
Notifications
You must be signed in to change notification settings - Fork 476
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
fix setting preferred subfamily #635
fix setting preferred subfamily #635
Conversation
Thanks for your contribution! I think the first link is incorrect, because it links to the repo root of the font of your second link, and not some testing tool. Could you also add a test case for this issue, please? |
Sorry, didn't really write a standalone script or test to test this out. Since I was trying to fix a particular issue in that repo, just did it manually through my fork of that site. But I can write a test case for it. I do want to clarify of how I should go about it. I was thinking of creating a new test file for |
Basically we want to test |
6daff41
to
18f030f
Compare
Hi, so I added another script in package.json to just run mocha so I could specify the test files to run. Would you like this committed or named something else? "scripts": {
...,
"test": "npm run build && npm run dist && mocha --require reify --recursive && npm run lint",
"test:local": "mocha --require reify --recursive",
...
}, But as an update, I finally got the tables parsed correctly so I can check the values for equality. Hopefully can get this done in the next day or so. |
18f030f
to
2408dd2
Compare
Let's not include that with this PR |
4b4b8bc
to
5695198
Compare
Hey sorry, took a bit longer. Pushed the tests for review. |
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! 🚀
Description
Fixed how a font's
preferredSubfamily
is set.Currently in the
tables/sfnt.js
file insidefontToSfntTable
, when setting a font'spreferredSubfamily
it's looking forpreferredSubFamily
, so if it's not already set it will always beundefined
. Changed theF
to anf
Motivation and Context
Fixes
undefined
preferredSubfamily if it's not explicitly setHow Has This Been Tested?
Testing a feature from this repo/site. which parses font files which does not have
macintosh.preferredSubfamily
set, but haswindows.preferredSubfamily
set. Specifically fonts from here. Launched the site locally using a simple http server and ran the customization feature from the site, while testing how the font object'sname
props change.Screenshots (if appropriate):
Types of changes
Checklist:
npm run test
and all tests passed green (including code styling checks).