diff options
Diffstat (limited to 'core/src/widget')
| -rw-r--r-- | core/src/widget/text.rs | 9 | 
1 files changed, 8 insertions, 1 deletions
diff --git a/core/src/widget/text.rs b/core/src/widget/text.rs index 427d9471..0996e7ff 100644 --- a/core/src/widget/text.rs +++ b/core/src/widget/text.rs @@ -1,5 +1,5 @@  //! Write some text for your users to read. -use crate::{Color, Length}; +use crate::{Color, Font, Length};  /// A paragraph of text.  /// @@ -16,6 +16,7 @@ pub struct Text {      pub content: String,      pub size: Option<u16>,      pub color: Option<Color>, +    pub font: Font,      pub width: Length,      pub height: Length,      pub horizontal_alignment: HorizontalAlignment, @@ -31,6 +32,7 @@ impl Text {              content: String::from(label),              size: None,              color: None, +            font: Font::Default,              width: Length::Fill,              height: Length::Shrink,              horizontal_alignment: HorizontalAlignment::Left, @@ -54,6 +56,11 @@ impl Text {          self      } +    pub fn font(mut self, font: Font) -> Self { +        self.font = font; +        self +    } +      /// Sets the width of the [`Text`] boundaries.      ///      /// [`Text`]: struct.Text.html  | 
