Add font_maybe to Text.
This commit is contained in:
parent
1533d18640
commit
c82f97c8c9
1 changed files with 11 additions and 0 deletions
|
|
@ -99,6 +99,17 @@ where
|
|||
self
|
||||
}
|
||||
|
||||
/// Sets the [`Font`] of the [`Text`], if `Some`.
|
||||
///
|
||||
/// [`Font`]: crate::text::Renderer::Font
|
||||
pub fn font_maybe(
|
||||
mut self,
|
||||
font: Option<impl Into<Renderer::Font>>,
|
||||
) -> Self {
|
||||
self.format.font = font.map(Into::into);
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the width of the [`Text`] boundaries.
|
||||
pub fn width(mut self, width: impl Into<Length>) -> Self {
|
||||
self.format.width = width.into();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue