We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
font_maybe
Text
1 parent 283d0e7 commit d59b0deCopy full SHA for d59b0de
core/src/widget/text.rs
@@ -100,6 +100,17 @@ where
100
self
101
}
102
103
+ /// Sets the [`Font`] of the [`Text`], if `Some`.
104
+ ///
105
+ /// [`Font`]: crate::text::Renderer::Font
106
+ pub fn font_maybe(
107
+ mut self,
108
+ font: Option<impl Into<Renderer::Font>>,
109
+ ) -> Self {
110
+ self.format.font = font.map(Into::into);
111
+ self
112
+ }
113
+
114
/// Sets the width of the [`Text`] boundaries.
115
pub fn width(mut self, width: impl Into<Length>) -> Self {
116
self.format.width = width.into();
0 commit comments