We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I noticed Face::set_variation now returns Some(()) even when the face does not have the axis since v0.20.0.
Face::set_variation
Some(())
If this is intended the docs should be amended.
Returns None when face is not variable or doesn't have such axis.
None
// [dependencies] // ttf-parser19 = { version = "0.19", package = "ttf-parser" } // ttf-parser = "0.20" const VAR_FONT: &[u8] = include_bytes!("../Cantarell-VF.otf"); fn main() { let mut face = ttf_parser19::Face::parse(VAR_FONT, 0).unwrap(); dbg!(face.set_variation(ttf_parser19::Tag::from_bytes(b"wght"), 600.0)); // Some(()) dbg!(face.set_variation(ttf_parser19::Tag::from_bytes(b"foob"), 200.0)); // None dbg!(face.set_variation(ttf_parser19::Tag::from_bytes(b"barr"), 200.0)); // None let mut face = ttf_parser::Face::parse(VAR_FONT, 0).unwrap(); dbg!(face.set_variation(ttf_parser::Tag::from_bytes(b"wght"), 600.0)); // Some(()) dbg!(face.set_variation(ttf_parser::Tag::from_bytes(b"foob"), 200.0)); // Some(()) dbg!(face.set_variation(ttf_parser::Tag::from_bytes(b"barr"), 200.0)); // Some(()) }
Using Cantarell-VF.otf.
The text was updated successfully, but these errors were encountered:
Yes, my bad. It should not return anything now. You have to use face.variation_axes() to check for available tags beforehand.
face.variation_axes()
This mimics the harfbuzz API: https://github.com/harfbuzz/harfbuzz/blob/b0150ffd05523c7cef9b3c91a8d6050177fceda3/src/hb-font.cc#L2658-L2676
Sorry, something went wrong.
No branches or pull requests
I noticed
Face::set_variation
now returnsSome(())
even when the face does not have the axis since v0.20.0.If this is intended the docs should be amended.
Reproduce
Using Cantarell-VF.otf.
The text was updated successfully, but these errors were encountered: