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.
2 parents b3e1be5 + c82f97c commit d94c080Copy full SHA for d94c080
1 file changed
core/src/widget/text.rs
@@ -99,6 +99,17 @@ where
99
self
100
}
101
102
+ /// Sets the [`Font`] of the [`Text`], if `Some`.
103
+ ///
104
+ /// [`Font`]: crate::text::Renderer::Font
105
+ pub fn font_maybe(
106
+ mut self,
107
+ font: Option<impl Into<Renderer::Font>>,
108
+ ) -> Self {
109
+ self.format.font = font.map(Into::into);
110
+ self
111
+ }
112
+
113
/// Sets the width of the [`Text`] boundaries.
114
pub fn width(mut self, width: impl Into<Length>) -> Self {
115
self.format.width = width.into();
0 commit comments