-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Use opentype.js to test font data #102
Conversation
3dd82b0
to
62f54fa
Compare
@puzrin PTAL. |
cfc2c24
to
2e89362
Compare
@puzrin We really need to test based on the font table, I recently upgraded from v2.0.0 to the latest version and there were a lot of problems. Without these tests, it is difficult to troubleshoot and find problems. |
a2653cb
to
ae425be
Compare
d484139
to
21963af
Compare
Only when the 7th bit of os2.fsSelection is turned off, the usWinAscent/usWinDescent will be used to calculate the row height. The spec says: > Early versions of this specification suggested that the usWinAscent value be computed as the yMax for all characters in the Windows “ANSI” character set. For new fonts, the value should be determined based on the primary languages the font is designed to support, and should take into consideration additional height that may be required to accommodate tall glyphs or mark positioning.
95412a5
to
3123030
Compare
@@ -28,10 +28,10 @@ function svg2ttf(svgString, options) { | |||
font.copyright = options.copyright || svgFont.metadata; | |||
font.description = options.description || 'Generated by svg2ttf from Fontello project.'; | |||
font.url = options.url || 'http://fontello.com'; | |||
font.sfntNames.push({ id: 2, value: options.subfamilyname || svgFont.subfamilyName || 'Regular' }); // subfamily name | |||
font.sfntNames.push({ id: 4, value: options.fullname || svgFont.id }); // full name | |||
font.sfntNames.push({ id: 2, value: (options.subfamilyname || svgFont.subfamilyName || 'Regular').trim() }); // subfamily name |
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 don't like idea of auto-trim. IMO that's a garbage for artificial case.
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 prefer svg2ttf to filter out these extraneous whitespace characters in order to produce a cleaner font file. Similar processing is also done in ufo2ft, of course we can only consider familyName and styleName.
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, i do not agree, IMO tool should write data exactly as been passed. IMO if you need trimming, it should be filtered on upper app level.
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 also changed my mind, and now I agree with you.
Sorry, please let me test in the fork's |
|
||
// it('bin compare', function () { | ||
// assert.deepStrictEqual(new Uint8Array(svg2ttf(src, { ts: 1457357570703 }).buffer), dst); | ||
// }); |
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.
We no longer need binary-based testing.
@yisibl see master updates. IMO this PR has no more worth to merge. |
I can resubmit a new PR. |
@yisibl if you think something important was missed in master commits - please do PR, i will review. |
IMO master is ready for release, but i'll be waiting for your comments for sure. |
Through this PR, we can better test fonts and no longer use binary-based comparison methods.