-
Notifications
You must be signed in to change notification settings - Fork 142
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
Remove skrifa from vello's public API #747
base: main
Are you sure you want to change the base?
Conversation
@@ -400,7 +400,7 @@ impl<'a> DrawGlyphs<'a> { | |||
} | |||
|
|||
/// Sets the normalized design space coordinates for a variable font instance. | |||
pub fn normalized_coords(mut self, coords: &[NormalizedCoord]) -> Self { | |||
pub fn normalized_coords(mut self, coords: impl Iterator<Item = i16>) -> Self { |
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 could require ExactSizeIterator
here if we want to.
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 think it would hurt to have a pub type NormalizedCoord = i16
in vello_encoding
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.
What does ExactSizeIterator
win us?
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 think we definitely should document this slightly better, even if just to say "this will be provided by your text layout implementation". The current format is quite unactionable.
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.
What does
ExactSizeIterator
win us?
Potentially slightly cheaper allocation. But I suspect size_hint
will work even without ExactSizeIterator
, and that even if it doesn't the cost will be small.
Note this type is still visible from vello/vello_encoding/src/encoding.rs Line 548 in e6ead09
This is a bit more tricky because skrifa actually wants a |
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.
Looks good. This also needs a CHANGELOG entry
examples/scenes/src/simple_text.rs
Outdated
@@ -210,7 +217,7 @@ impl SimpleText { | |||
} | |||
|
|||
fn to_font_ref(font: &Font) -> Option<FontRef<'_>> { | |||
use vello::skrifa::raw::FileRef; | |||
use skrifa::raw::FileRef; |
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.
Is there much advantage to this import being here rather than at the top of the file?
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 think so. That was where it already was, but I've moved it to the top.
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.
Ah, apologies. I probably didn't originally notice that this was only a change and not an addition.
@@ -400,7 +400,7 @@ impl<'a> DrawGlyphs<'a> { | |||
} | |||
|
|||
/// Sets the normalized design space coordinates for a variable font instance. | |||
pub fn normalized_coords(mut self, coords: &[NormalizedCoord]) -> Self { | |||
pub fn normalized_coords(mut self, coords: impl Iterator<Item = i16>) -> Self { |
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.
What does ExactSizeIterator
win us?
@@ -400,7 +400,7 @@ impl<'a> DrawGlyphs<'a> { | |||
} | |||
|
|||
/// Sets the normalized design space coordinates for a variable font instance. | |||
pub fn normalized_coords(mut self, coords: &[NormalizedCoord]) -> Self { | |||
pub fn normalized_coords(mut self, coords: impl Iterator<Item = i16>) -> Self { |
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 think we definitely should document this slightly better, even if just to say "this will be provided by your text layout implementation". The current format is quite unactionable.
@nicoburns Can we wrap this one up and land it? I'd like to make sure this is in our upcoming release. |
Signed-off-by: Nico Burns <[email protected]>
How much do we still care about this being public in |
Signed-off-by: Nico Burns <[email protected]>
d7005bb
to
e847f5f
Compare
Signed-off-by: Nico Burns <[email protected]>
I don't hate making
|
My suggestion would be for |
Looking again, I'm not sure that would be practical; Vello itself exposes vello_encoding as public API. I don't know the right answer here |
I'd probably suggest making our own |
The motivation for this is two-fold: