summaryrefslogtreecommitdiffstats
path: root/wgpu
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu')
-rw-r--r--wgpu/src/text.rs11
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),
);