-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
No SVG tests #95
Comments
Recent version of skia-python can render them. (And colrv1 too). Don't know if you want to add that. |
Is there at least a standardized structure of outputting SVG for color glyphs? I'd like to prevent implementing it one way and then having to refactor it once tests are added. |
Not sure it answers your question, but nanoemoji can convert SVGs to various color-font formats: |
Thanks! We actually need to look at the other way round, SVG from COLR/CPAL, but maybe there's something in there... |
See this example, up to about line 50: It extracts the SVG data from a ot-svg glyph via freetype-py, then (from about line 50 onwards) draw it with skia. You can replace the drawing code with another svg drawing library. This is the earliest example that works with older skia-python. The other |
I think there's a misunderstanding. The text rendering tests expect an SVG structure to compare if a glyph is rendered correctly. As there are no tests for color fonts (neither SVG fonts, nor COLR/CPAL fonts), it's currently unknown what SVG structure is expected. |
The freetype-py code extracts the ot-svg data directly as a svg document. (Supposedly with a subset of svg functionality, since animations etc don't make sense as avg glyphs). Wouldn't that be just a direct comparison after some lint'ting? |
SVG fonts were added a while ago via #56, but there are actually no tests for SVG font rendering in the test suite.
Opentype.js may soon have parsing and writing support for them (opentypejs/opentype.js#672) and I'd like to try to implement the rendering, so it would be great to have tests for that.
The text was updated successfully, but these errors were encountered: