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

font-parsing tests? #63

Closed
Pomax opened this issue Oct 31, 2020 · 4 comments
Closed

font-parsing tests? #63

Pomax opened this issue Oct 31, 2020 · 4 comments

Comments

@Pomax
Copy link

Pomax commented Oct 31, 2020

A few folks and myself have recently been working on getting Font.js uplifted to ES2020 and browser+node compatibility, but it's hard to come by dedicated fonts for testing things like detecting the correct number of GPOS/GSUB script/feature/lookups, ligature resolution, non cmap-4/12 character support, fvar, etc.

Is there a subset of this battery of fonts that might work well for the purpose of not specifically text rendering, but certainly doing everything up to the shaping step?

@brawer
Copy link
Collaborator

brawer commented Nov 1, 2020

Because all the engines currently being tested can return glyph outlines, the current test harness is always comparing paths, even if the test case (and the corresponding test font) is actually about an earlier step. For your purpose, maybe you could go manually over the description of the test suite and decide which specific tests make sense for you? For example, I’d imagine that the CMAP tests might be useful, but those for GPOS will probably be irrelevant for Font.js unless you change the scope of your project to include shaping. Even if you don’t care about shaping, have a look at the HarfBuzz test suite which takes the test fonts from this repo here, and automatically converts them to the format used in the HarfBuzz test suite; maybe Font.js could do something similar? — Also, please feel (extremely!) welcome to contribute additional test fonts to this test suite!

@Pomax
Copy link
Author

Pomax commented Nov 1, 2020

Great suggestions, thanks! If we do end up crafting custom fonts for testing and validation purposes, I'll be sure to let you know/contribute them via PR.

@HinTak
Copy link

HinTak commented Nov 1, 2020

If you are looking for some broken fonts, https://github.com/google/oss-fuzz make some for their freetype fuzz'ing. They may not be broken in the way you want though...

@Pomax
Copy link
Author

Pomax commented Nov 1, 2020

Font.js doesn't really do any validation, it's more for parsing fonts that you are assumed to have made sure are not broken already. So for testing we mostly need small fonts that encode specific parts of the OpenType spec to make sure that the parse result is correct with respect to what's really in the font.

Still, good to know there's a resource for broken fonts, too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants