diff options
author | 2023-08-18 18:46:22 -0300 | |
---|---|---|
committer | 2023-08-18 18:46:22 -0300 | |
commit | e86363837d8e3a6241a90cb5b895034f07106059 (patch) | |
tree | 24852327d51460f8feec47cfe96c4f84604a14e3 /wgpu/src/text.rs | |
parent | cb8b70bec3e8bbf809e7d8ffc559adb712f45e14 (diff) | |
download | iced-e86363837d8e3a6241a90cb5b895034f07106059.tar.gz iced-e86363837d8e3a6241a90cb5b895034f07106059.tar.bz2 iced-e86363837d8e3a6241a90cb5b895034f07106059.zip |
Make the style attribute available on Font
Diffstat (limited to 'wgpu/src/text.rs')
-rw-r--r-- | wgpu/src/text.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/wgpu/src/text.rs b/wgpu/src/text.rs index ef910c39..fb13545d 100644 --- a/wgpu/src/text.rs +++ b/wgpu/src/text.rs @@ -339,6 +339,14 @@ fn to_stretch(stretch: font::Stretch) -> glyphon::Stretch { } } +fn to_style(style: font::Style) -> glyphon::Style { + match style { + font::Style::Normal => glyphon::Style::Normal, + font::Style::Italic => glyphon::Style::Italic, + font::Style::Oblique => glyphon::Style::Oblique, + } +} + fn to_shaping(shaping: Shaping) -> glyphon::Shaping { match shaping { Shaping::Basic => glyphon::Shaping::Basic, @@ -420,7 +428,8 @@ impl Cache { glyphon::Attrs::new() .family(to_family(key.font.family)) .weight(to_weight(key.font.weight)) - .stretch(to_stretch(key.font.stretch)), + .stretch(to_stretch(key.font.stretch)) + .style(to_style(key.font.style)), to_shaping(key.shaping), ); |