-
Notifications
You must be signed in to change notification settings - Fork 222
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
COLRv1 support #298
base: master
Are you sure you want to change the base?
COLRv1 support #298
Conversation
As of this point, we can render (simple) COLRv1 glyphs on canvas: const dpi = window.devicePixelRatio;
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
canvas.style.width = '200px'
canvas.style.height = '200px'
canvas.getContext('2d').scale(dpi, dpi);
ctx.transform(1.0, 0, 0, -1.0, 0,120); // flip Y direction, 0 in font is baseline, 0 in canvas is top!
let glyph = font.glyphForCodePoint(0x270d);
glyph.render(ctx, 120); Next step... instantiating variable paints! |
…32/16 bit deltas.
Code is done, needs tests. |
Ping? Also, the last commit I just added is not technically related to COLRv1; I was going to submit it as a separate PR but it builds on the fact that the DeltaSetIndexMap is moved to |
Ping, again? |
This is a WIP PR for COLRv1 support. At the moment it should handle the decoding of COLRv1 tables, but this isn't plugged in to the rest of the library. To get that working, we would need to think through how we want to represent paint trees.
Also no tests yet, but they're coming.