Skip to content

Commit

Permalink
Map font-stretch/font-width from stylo to parley
Browse files Browse the repository at this point in the history
Signed-off-by: Nico Burns <[email protected]>
  • Loading branch information
nicoburns committed Dec 16, 2024
1 parent 99bc99f commit aa6c38b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/blitz-dom/src/stylo_to_parley.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub(crate) fn style(style: &stylo::ComputedValues) -> parley::TextStyle<'static,
stylo::FontStyle::ITALIC => parley::FontStyle::Italic,
val => parley::FontStyle::Oblique(Some(val.oblique_degrees())),
};
let font_width = parley::FontWidth::from_percentage(font_styles.font_stretch.0.to_float());

// Convert font family
let families: Vec<_> = font_styles
Expand Down Expand Up @@ -113,7 +114,7 @@ pub(crate) fn style(style: &stylo::ComputedValues) -> parley::TextStyle<'static,
// font_stack: parley::FontStack::Single(FontFamily::Generic(GenericFamily::SystemUi)),
font_stack: parley::FontStack::List(Cow::Owned(families)),
font_size,
font_width: Default::default(),
font_width,
font_style,
font_weight,
font_variations: parley::FontSettings::List(Cow::Borrowed(&[])),
Expand Down

0 comments on commit aa6c38b

Please sign in to comment.