summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-06 05:03:11 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-06 05:03:11 +0100
commitf719ba3f4efebdf29cd5922d9e083f8dea96c486 (patch)
tree1b628d33ede47313ade6ab2f9577bc6371d598cb /web
parentad500441afc355f0b8ca2a463248d350d74f0f20 (diff)
downloadiced-f719ba3f4efebdf29cd5922d9e083f8dea96c486.tar.gz
iced-f719ba3f4efebdf29cd5922d9e083f8dea96c486.tar.bz2
iced-f719ba3f4efebdf29cd5922d9e083f8dea96c486.zip
Add `font-family` to `Text` style in `iced_web`
Diffstat (limited to 'web')
-rw-r--r--web/src/widget/text.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/src/widget/text.rs b/web/src/widget/text.rs
index 46230fef..3ec565a8 100644
--- a/web/src/widget/text.rs
+++ b/web/src/widget/text.rs
@@ -133,12 +133,16 @@ impl<'a, Message> Widget<Message> for Text {
let style = bumpalo::format!(
in bump,
- "width: {}; height: {}; font-size: {}px; color: {}; text-align: {}",
+ "width: {}; height: {}; font-size: {}px; color: {}; text-align: {}; font-family: {}",
width,
height,
self.size.unwrap_or(20),
color,
- text_align
+ text_align,
+ match self.font {
+ Font::Default => "inherit",
+ Font::External { name, .. } => name,
+ }
);
// TODO: Complete styling