pub struct Text {
pub content: String,
pub style: TextStyle,
pub common: Common,
}Fields§
§content: String§style: TextStyle§common: CommonImplementations§
Source§impl Text
impl Text
pub fn new(content: impl Into<String>) -> Self
pub fn size(self, size: f32) -> Self
pub fn bold(self) -> Self
pub fn font(self, font: FontKey) -> Self
pub fn color(self, color: Color) -> Self
pub fn align(self, align: Align) -> Self
pub fn line_height(self, line_height: f32) -> Self
Sourcepub fn heading1(self) -> Self
pub fn heading1(self) -> Self
Heading presets (Phase 6, plan/02-elementcatalog-and-features.md):
thin wrappers over .size()/.bold(), additionally setting
keep_with_next so a heading never ends up alone at the bottom of
a page without its following content
(plan/05-overflow-and-robustness.md Grundprinzip 9).
pub fn heading2(self) -> Self
pub fn heading3(self) -> Self
pub fn width(self, width: f32) -> Self
pub fn height(self, height: f32) -> Self
pub fn flex(self, factor: f32) -> Self
pub fn padding(self, padding: f32) -> Self
pub fn overflow(self, overflow: Overflow) -> Self
pub fn background(self, color: Color) -> Self
pub fn border(self, border: Border) -> Self
Sourcepub fn keep_with_next(self) -> Self
pub fn keep_with_next(self) -> Self
See plan/05-overflow-and-robustness.md Grundprinzip 9: only
placed on a page if the following sibling also still fits.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnsafeUnpin for Text
impl UnwindSafe for Text
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more