-
-
Notifications
You must be signed in to change notification settings - Fork 39
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 skrifa::NormalizedCoord
to represent normalized coordinates
#76
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nico Burns <[email protected]>
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.
This looks reasonable and makes sense. The one downside is that updating the skrifa version is now potentially a breaking change but the interop benefit is probably worth it.
Hmm... true. And I guess this is also currently true of Vello atm. Perhaps it would make sense to go the other way and use i16 as the interchange type? This type is a re-export of |
The other option is that vello’s |
I believe vello also currently re-exports skrifa so an update there is a breaking change regardless. Maybe we should rethink that. |
That seems sensible anyway given that it only needs an iterator. But I was also thinking about Vello's release cycle. It would also be nice if a Skrifa bump in Vello didn't require a breaking release. Really the |
The In the meantime, we should consider changing vello to take an iterator, maybe of a simpler type like the current one in swash. edit: and removing everything else that might make a skrifa update a breaking change. |
The motivation for this PR is to avoid this conversion boilerplate (and otherwise unnecessary
Vec
allocation) when integratingparley
(which uses swash'sNormalizedCoord
) withvello
(which uses skrifa'sNormalizedCoord
).Once
parley
is updated with this change it should be possible to passrun.normalized_coords
directly todraw_glyphs().normalized_coords
.This PR assumes that the bit representation of normalized coords is the same in Swash and Skrifa, and that Skrifa just has a newtype around the raw bits.