Skip to content
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

Merged
merged 11 commits into from
Jun 20, 2024
Merged

Conversation

LaurenzV
Copy link
Contributor

Will make it easier to port code from harfbuzz to rustybuzz. I hope I did the libm thing correctly.

@LaurenzV
Copy link
Contributor Author

Hmm... yeah some advice on how to deal with the feature thingy would be appreciated. 😄

Cargo.toml Outdated
std = []
no-std = ["libm"]
Copy link
Collaborator

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")]
Copy link
Collaborator

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.

Copy link
Collaborator

@RazrFalcon RazrFalcon Jun 18, 2024

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.

@LaurenzV
Copy link
Contributor Author

I'll mark this as draft since I also want to test it in rustybuzz first, which might take a while.

@LaurenzV LaurenzV marked this pull request as draft June 18, 2024 13:40
@LaurenzV
Copy link
Contributor Author

Is it okay that when building with no default features and variable-fonts, you must also add no-std-float (or std)? Kinda annoying, but not sure if there is a better way...

@RazrFalcon
Copy link
Collaborator

Yes, same with tiny-skia. --no-default-features implies adding --feature libm. No better way to handle this to my knowledge.

@LaurenzV LaurenzV marked this pull request as ready for review June 19, 2024 15:32
@LaurenzV
Copy link
Contributor Author

Okay, should be good now.

Cargo.toml Outdated Show resolved Hide resolved
@RazrFalcon RazrFalcon merged commit c2d3bf1 into harfbuzz:master Jun 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants