use embedded_graphics::{fonts::Font6x8, pixelcolor::BinaryColor, prelude::*};
use embedded_graphics_simulator::{
BinaryColorTheme, OutputSettingsBuilder, SimulatorDisplay, Window,
};
use embedded_text::prelude::*;
fn main() {
let text = "Hello, World!\n\
Lorem Ipsum is simply dummy text of the printing and typesetting industry. \
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when \
an unknown printer took a galley of type and scrambled it to make a type specimen book.";
let textbox_style = TextBoxStyleBuilder::new(Font6x8)
.alignment(RightAligned)
.text_color(BinaryColor::On)
.height_mode(FitToText)
.build();
let bounds = Rectangle::new(Point::zero(), Point::new(128, 0));
let text_box = TextBox::new(text, bounds).into_styled(textbox_style);
let mut display = SimulatorDisplay::new(text_box.size());
text_box.draw(&mut display).unwrap();
let output_settings = OutputSettingsBuilder::new()
.theme(BinaryColorTheme::OledBlue)
.build();
Window::new("Right aligned TextBox example", &output_settings).show_static(&display);
}