summaryrefslogtreecommitdiffstats
path: root/core/src/font.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-08-20 14:22:46 +0200
committerLibravatar GitHub <noreply@github.com>2023-08-20 14:22:46 +0200
commit3bea1f703cea137818c16bf41c7ea372bd8b91b9 (patch)
tree4d16eb329ec1630fac3f62ba2edc68d4209bc357 /core/src/font.rs
parent2a3cb0fa7ab5b2b532932012ca7f479bf331049c (diff)
parente86363837d8e3a6241a90cb5b895034f07106059 (diff)
downloadiced-3bea1f703cea137818c16bf41c7ea372bd8b91b9.tar.gz
iced-3bea1f703cea137818c16bf41c7ea372bd8b91b9.tar.bz2
iced-3bea1f703cea137818c16bf41c7ea372bd8b91b9.zip
Merge pull request #2041 from lufte/issue-2040
Make the style attribute available on Font
Diffstat (limited to 'core/src/font.rs')
-rw-r--r--core/src/font.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/src/font.rs b/core/src/font.rs
index bb425fd6..7f647847 100644
--- a/core/src/font.rs
+++ b/core/src/font.rs
@@ -10,6 +10,8 @@ pub struct Font {
pub weight: Weight,
/// The [`Stretch`] of the [`Font`].
pub stretch: Stretch,
+ /// The [`Style`] of the [`Font`].
+ pub style: Style,
/// Whether if the [`Font`] is monospaced or not.
pub monospaced: bool,
}
@@ -20,6 +22,7 @@ impl Font {
family: Family::SansSerif,
weight: Weight::Normal,
stretch: Stretch::Normal,
+ style: Style::Normal,
monospaced: false,
};
@@ -100,3 +103,13 @@ pub enum Stretch {
ExtraExpanded,
UltraExpanded,
}
+
+/// The style of some text.
+#[allow(missing_docs)]
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
+pub enum Style {
+ #[default]
+ Normal,
+ Italic,
+ Oblique,
+}