skia_safe::textlayout::TextStyle::font_metrics
brokes in 0.70.0
#934
Answered
by
pragmatrix
FlysoftBeta
asked this question in
Q&A
-
in 0.70.0, the result of let mut style = skia_safe::textlayout::TextStyle::new();
style.set_foreground_paint(skia_safe::Paint::new(skia_safe::Color4f::new(1.0, 1.0, 1.0, 1.0), skia_safe::ColorSpace::new_srgb()));
style.set_font_size(20.0);
style.set_font_style(skia_safe::FontStyle::new(
500.0.into(),
skia_safe::font_style::Width::NORMAL,
skia_safe::font_style::Slant::Upright,
));
dbg!(style.clone(), style.font_metrics()); |
Beta Was this translation helpful? Give feedback.
Answered by
pragmatrix
Feb 11, 2024
Replies: 1 comment 1 reply
-
There were some changes with the default font / typeface (empty since 0.70.0) which I suspect is the underlying cause. I suggest that you use |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
FlysoftBeta
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There were some changes with the default font / typeface (empty since 0.70.0) which I suspect is the underlying cause. I suggest that you use
TextStyle::set_typeface()
. And to get a the default typeface useFontMgr::new()
andFontMgr::legacy_make_typeface()
. The strategy here is to be explicit on what font to use, best to deploy one with your app, or query one using theFontMgr::match...
functions.