Struct embedded_text::style::builder::TextBoxStyleBuilder [−][src]
pub struct TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, { /* fields omitted */ }TextBoxStyle builder object.
Implementations
impl<C, F> TextBoxStyleBuilder<C, F, LeftAligned, TopAligned, Exact<FullRowsOnly>> where
C: PixelColor,
F: Font + Copy, [src]
impl<C, F> TextBoxStyleBuilder<C, F, LeftAligned, TopAligned, Exact<FullRowsOnly>> where
C: PixelColor,
F: Font + Copy, [src]#[must_use]pub fn new(font: F) -> Self[src]
Creates a new TextBoxStyleBuilder with a given font.
Default settings are:
LeftAlignedTopAligned- Text color: transparent
- Background color: transparent
- Height mode:
Exact - Line spacing: 0px
#[must_use]pub fn from_text_style(text_style: TextStyle<C, F>) -> Self[src]
Creates a TextBoxStyleBuilder from existing TextStyle object.
Example
use embedded_text::prelude::*; use embedded_graphics::{fonts::Font6x8, pixelcolor::BinaryColor, style::TextStyleBuilder}; let text_style = TextStyleBuilder::new(Font6x8) .background_color(BinaryColor::On) .build(); let style = TextBoxStyleBuilder::from_text_style(text_style) .build();
impl<C, F, A, V, H> TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy,
A: HorizontalTextAlignment,
V: VerticalTextAlignment,
H: HeightMode, [src]
impl<C, F, A, V, H> TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy,
A: HorizontalTextAlignment,
V: VerticalTextAlignment,
H: HeightMode, [src]#[must_use]pub fn text_color(self, text_color: C) -> Self[src]
Sets the text color.
Note: once the text color is set, there is no way to reset it to transparent.
Example: text with transparent background.
use embedded_text::prelude::*; use embedded_graphics::{fonts::Font6x8, pixelcolor::BinaryColor}; let style = TextBoxStyleBuilder::new(Font6x8) .text_color(BinaryColor::On) .build();
#[must_use]pub fn line_spacing(self, line_spacing: i32) -> Self[src]
Sets the vertical space between lines, in pixels.
Note: You can set negative values as line spacing if you wish your lines to overlap.
Example
use embedded_text::prelude::*; use embedded_graphics::{fonts::Font6x8, pixelcolor::BinaryColor}; let style = TextBoxStyleBuilder::new(Font6x8) .text_color(BinaryColor::On) .line_spacing(3) .build();
#[must_use]pub fn background_color(self, background_color: C) -> Self[src]
Sets the background color.
Note: once the background color is set, there is no way to reset it to transparent.
Example: transparent text with background.
use embedded_text::prelude::*; use embedded_graphics::{fonts::Font6x8, pixelcolor::BinaryColor}; let style = TextBoxStyleBuilder::new(Font6x8) .background_color(BinaryColor::On) .build();
#[must_use]pub fn text_style(self, text_style: TextStyle<C, F>) -> Self[src]
Copies properties from an existing text style object.
Example
use embedded_text::prelude::*; use embedded_graphics::{fonts::Font6x8, pixelcolor::BinaryColor, style::TextStyleBuilder}; let text_style = TextStyleBuilder::new(Font6x8) .background_color(BinaryColor::On) .build(); let style = TextBoxStyleBuilder::new(Font6x8) .text_style(text_style) .build();
This method has been deprecated and will be removed in a later release. Use
TextBoxStyleBuilder::from_text_style instead.
#[must_use]pub fn alignment<TA: HorizontalTextAlignment>(
self,
alignment: TA
) -> TextBoxStyleBuilder<C, F, TA, V, H>[src]
self,
alignment: TA
) -> TextBoxStyleBuilder<C, F, TA, V, H>
Sets the horizontal text alignment.
#[must_use]pub fn vertical_alignment<VA: VerticalTextAlignment>(
self,
vertical_alignment: VA
) -> TextBoxStyleBuilder<C, F, A, VA, H>[src]
self,
vertical_alignment: VA
) -> TextBoxStyleBuilder<C, F, A, VA, H>
Sets the vertical text alignment.
#[must_use]pub fn height_mode<HM: HeightMode>(
self,
height_mode: HM
) -> TextBoxStyleBuilder<C, F, A, V, HM>[src]
self,
height_mode: HM
) -> TextBoxStyleBuilder<C, F, A, V, HM>
Sets the height mode.
#[must_use]pub fn tab_size(self, tab_size: TabSize<F>) -> Self[src]
Sets the tab size.
#[must_use]pub fn underlined(self, underlined: bool) -> Self[src]
Enables or disables underlined text.
#[must_use]pub fn strikethrough(self, strikethrough: bool) -> Self[src]
Enables or disables strikethrough text.
#[must_use]pub fn build(self) -> TextBoxStyle<C, F, A, V, H>[src]
Builds the TextBoxStyle.
Trait Implementations
impl<C: Clone, F: Clone, A: Clone, V: Clone, H: Clone> Clone for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]
impl<C: Clone, F: Clone, A: Clone, V: Clone, H: Clone> Clone for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]fn clone(&self) -> TextBoxStyleBuilder<C, F, A, V, H>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<C: Copy, F: Copy, A: Copy, V: Copy, H: Copy> Copy for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]
impl<C: Copy, F: Copy, A: Copy, V: Copy, H: Copy> Copy for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]impl<C: Debug, F: Debug, A: Debug, V: Debug, H: Debug> Debug for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]
impl<C: Debug, F: Debug, A: Debug, V: Debug, H: Debug> Debug for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]impl<C: Eq, F: Eq, A: Eq, V: Eq, H: Eq> Eq for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]
impl<C: Eq, F: Eq, A: Eq, V: Eq, H: Eq> Eq for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]impl<C: Hash, F: Hash, A: Hash, V: Hash, H: Hash> Hash for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]
impl<C: Hash, F: Hash, A: Hash, V: Hash, H: Hash> Hash for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]impl<C: PartialEq, F: PartialEq, A: PartialEq, V: PartialEq, H: PartialEq> PartialEq<TextBoxStyleBuilder<C, F, A, V, H>> for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]
impl<C: PartialEq, F: PartialEq, A: PartialEq, V: PartialEq, H: PartialEq> PartialEq<TextBoxStyleBuilder<C, F, A, V, H>> for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]fn eq(&self, other: &TextBoxStyleBuilder<C, F, A, V, H>) -> bool[src]
fn ne(&self, other: &TextBoxStyleBuilder<C, F, A, V, H>) -> bool[src]
impl<C, F, A, V, H> StructuralEq for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]
impl<C, F, A, V, H> StructuralEq for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]impl<C, F, A, V, H> StructuralPartialEq for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]
impl<C, F, A, V, H> StructuralPartialEq for TextBoxStyleBuilder<C, F, A, V, H> where
C: PixelColor,
F: Font + Copy, [src]Auto Trait Implementations
impl<C, F, A, V, H> RefUnwindSafe for TextBoxStyleBuilder<C, F, A, V, H> where
A: RefUnwindSafe,
C: RefUnwindSafe,
F: RefUnwindSafe,
H: RefUnwindSafe,
V: RefUnwindSafe,
impl<C, F, A, V, H> RefUnwindSafe for TextBoxStyleBuilder<C, F, A, V, H> where
A: RefUnwindSafe,
C: RefUnwindSafe,
F: RefUnwindSafe,
H: RefUnwindSafe,
V: RefUnwindSafe, impl<C, F, A, V, H> Send for TextBoxStyleBuilder<C, F, A, V, H> where
A: Send,
C: Send,
F: Send,
H: Send,
V: Send,
impl<C, F, A, V, H> Send for TextBoxStyleBuilder<C, F, A, V, H> where
A: Send,
C: Send,
F: Send,
H: Send,
V: Send, impl<C, F, A, V, H> Sync for TextBoxStyleBuilder<C, F, A, V, H> where
A: Sync,
C: Sync,
F: Sync,
H: Sync,
V: Sync,
impl<C, F, A, V, H> Sync for TextBoxStyleBuilder<C, F, A, V, H> where
A: Sync,
C: Sync,
F: Sync,
H: Sync,
V: Sync, impl<C, F, A, V, H> Unpin for TextBoxStyleBuilder<C, F, A, V, H> where
A: Unpin,
C: Unpin,
F: Unpin,
H: Unpin,
V: Unpin,
impl<C, F, A, V, H> Unpin for TextBoxStyleBuilder<C, F, A, V, H> where
A: Unpin,
C: Unpin,
F: Unpin,
H: Unpin,
V: Unpin, impl<C, F, A, V, H> UnwindSafe for TextBoxStyleBuilder<C, F, A, V, H> where
A: UnwindSafe,
C: UnwindSafe,
F: UnwindSafe,
H: UnwindSafe,
V: UnwindSafe,
impl<C, F, A, V, H> UnwindSafe for TextBoxStyleBuilder<C, F, A, V, H> where
A: UnwindSafe,
C: UnwindSafe,
F: UnwindSafe,
H: UnwindSafe,
V: UnwindSafe,