#[non_exhaustive]pub struct BigText<'a> {
pub lines: Vec<Line<'a>>,
pub style: Style,
pub pixel_size: PixelSize,
pub alignment: Alignment,
}Expand description
Displays one or more lines of text using 8x8 pixel characters.
The text is rendered using the font8x8 crate.
Using the pixel_size method, you can also chose, how ‘big’ a pixel should be. Currently a
pixel of the 8x8 font can be represented by one full or half (horizontal/vertical/both)
character cell of the terminal.
§Examples
use ratatui::prelude::*;
use tui_big_text::{BigText, PixelSize};
BigText::builder()
.pixel_size(PixelSize::Full)
.style(Style::new().white())
.lines(vec![
"Hello".red().into(),
"World".blue().into(),
"=====".into(),
])
.build();Renders:
██ ██ ███ ███
██ ██ ██ ██
██ ██ ████ ██ ██ ████
██████ ██ ██ ██ ██ ██ ██
██ ██ ██████ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██
██ ██ ████ ████ ████ ████
██ ██ ███ ███
██ ██ ██ ██
██ ██ ████ ██ ███ ██ ██
██ █ ██ ██ ██ ███ ██ ██ █████
███████ ██ ██ ██ ██ ██ ██ ██
███ ███ ██ ██ ██ ██ ██ ██
██ ██ ████ ████ ████ ███ ██
███ ██ ███ ██ ███ ██ ███ ██ ███ ██
██ ███ ██ ███ ██ ███ ██ ███ ██ ███Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.lines: Vec<Line<'a>>The text to display
style: StyleThe style of the widget
Defaults to Style::default()
pixel_size: PixelSizeThe size of single glyphs
Defaults to PixelSize::default() (=> PixelSize::Full)
alignment: AlignmentThe horizontal alignment of the text
Defaults to Alignment::default() (=> Alignment::Left)
Implementations§
Source§impl BigText<'static>
impl BigText<'static>
Sourcepub fn builder() -> BigTextBuilder<'static>
pub fn builder() -> BigTextBuilder<'static>
Create a new BigTextBuilder to configure a BigText widget.
Trait Implementations§
impl<'a> Eq for BigText<'a>
impl<'a> StructuralPartialEq for BigText<'a>
Auto Trait Implementations§
impl<'a> Freeze for BigText<'a>
impl<'a> RefUnwindSafe for BigText<'a>
impl<'a> Send for BigText<'a>
impl<'a> Sync for BigText<'a>
impl<'a> Unpin for BigText<'a>
impl<'a> UnwindSafe for BigText<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more