-
Notifications
You must be signed in to change notification settings - Fork 72
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
Simplify COLR API for transforms #155
Conversation
Hmm... yeah some advice on how to deal with the feature thingy would be appreciated. 😄 |
Cargo.toml
Outdated
std = [] | ||
no-std = ["libm"] |
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 would suggest using no-std-float
, just like in tiny-skia
.
src/lib.rs
Outdated
/// Creates a new rotation transform. | ||
#[inline] | ||
pub fn new_rotate(angle: f32) -> Self { | ||
#[cfg(feature = "no-std")] |
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 would suggest going the tine-skia
route by using a trait.
And then
#[cfg(all(not(feature = "std"), feature = "no-std-float"))]
use crate::NoStdFloat;
where needed.
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.
You can put the new trait somewhere in lib.rs
But it should be pub(crate)
this time.
I'll mark this as draft since I also want to test it in |
Is it okay that when building with no default features and |
Yes, same with |
Okay, should be good now. |
Will make it easier to port code from harfbuzz to rustybuzz. I hope I did the
libm
thing correctly.