1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use crate::{rendering::cursor::Cursor, style::StyledTextBox};
use embedded_graphics::prelude::*;
pub mod bottom;
pub mod center;
pub mod justified;
pub mod left;
pub mod right;
pub mod top;
pub trait HorizontalTextAlignment: Copy {
const STARTING_SPACES: bool;
const ENDING_SPACES: bool;
}
pub trait VerticalTextAlignment: Copy {
fn apply_vertical_alignment<'a, C, F, A>(
cursor: &mut Cursor<F>,
styled_text_box: &'a StyledTextBox<'a, C, F, A, Self>,
) where
C: PixelColor,
F: Font + Copy,
A: HorizontalTextAlignment;
}
pub use bottom::BottomAligned;
pub use center::CenterAligned;
pub use justified::Justified;
pub use left::LeftAligned;
pub use right::RightAligned;
pub use top::TopAligned;