1#![no_std]
2
3use embedded_graphics::{
40 geometry::Size,
41 image::ImageRaw,
42 mono_font::{mapping::StrGlyphMapping, DecorationDimensions, MonoFont},
43};
44
45const CHARS_PER_ROW: u32 = 32;
46
47const GLYPH_MAPPING: StrGlyphMapping =
52 StrGlyphMapping::new("\0 ~\0\u{00A0}ÿ", '?' as usize - ' ' as usize);
53
54pub const PROFONT_7_POINT: MonoFont = MonoFont {
56 image: ImageRaw::new(
57 include_bytes!("../data/ProFont7Point.raw"),
58 CHARS_PER_ROW * 5,
59 ),
60
61 character_size: Size::new(5, 10),
62 character_spacing: 0,
63 baseline: 7,
64 underline: DecorationDimensions::new(8, 1),
65 strikethrough: DecorationDimensions::new(6, 1),
66 glyph_mapping: &GLYPH_MAPPING,
67};
68
69pub const PROFONT_9_POINT: MonoFont = MonoFont {
71 image: ImageRaw::new(
72 include_bytes!("../data/ProFont9Point.raw"),
73 CHARS_PER_ROW * 6,
74 ),
75
76 character_size: Size::new(6, 11),
77 character_spacing: 0,
78 baseline: 8,
79 underline: DecorationDimensions::new(10, 1),
80 strikethrough: DecorationDimensions::new(6, 1),
81 glyph_mapping: &GLYPH_MAPPING,
82};
83
84pub const PROFONT_10_POINT: MonoFont = MonoFont {
86 image: ImageRaw::new(
87 include_bytes!("../data/ProFont10Point.raw"),
88 CHARS_PER_ROW * 6,
89 ),
90
91 character_size: Size::new(6, 12),
92 character_spacing: 1,
93 baseline: 9,
94 underline: DecorationDimensions::new(10 + 1, 1),
95 strikethrough: DecorationDimensions::new(7, 1),
96 glyph_mapping: &GLYPH_MAPPING,
97};
98
99pub const PROFONT_12_POINT: MonoFont = MonoFont {
101 image: ImageRaw::new(
102 include_bytes!("../data/ProFont12Point.raw"),
103 CHARS_PER_ROW * 7,
104 ),
105
106 character_size: Size::new(7, 15),
107 character_spacing: 1,
108 baseline: 11,
109 underline: DecorationDimensions::new(13, 1),
110 strikethrough: DecorationDimensions::new(8, 1),
111 glyph_mapping: &GLYPH_MAPPING,
112};
113
114pub const PROFONT_14_POINT: MonoFont = MonoFont {
116 image: ImageRaw::new(
117 include_bytes!("../data/ProFont14Point.raw"),
118 CHARS_PER_ROW * 10,
119 ),
120
121 character_size: Size::new(10, 17),
122 character_spacing: 0,
123 baseline: 13,
124 underline: DecorationDimensions::new(15, 1),
125 strikethrough: DecorationDimensions::new(9, 2),
126 glyph_mapping: &GLYPH_MAPPING,
127};
128
129pub const PROFONT_18_POINT: MonoFont = MonoFont {
131 image: ImageRaw::new(
132 include_bytes!("../data/ProFont18Point.raw"),
133 CHARS_PER_ROW * 12,
134 ),
135
136 character_size: Size::new(12, 22),
137 character_spacing: 0,
138 baseline: 17,
139 underline: DecorationDimensions::new(19, 2),
140 strikethrough: DecorationDimensions::new(12, 2),
141 glyph_mapping: &GLYPH_MAPPING,
142};
143
144pub const PROFONT_24_POINT: MonoFont = MonoFont {
146 image: ImageRaw::new(
147 include_bytes!("../data/ProFont24Point.raw"),
148 CHARS_PER_ROW * 16,
149 ),
150
151 character_size: Size::new(16, 29),
152 character_spacing: 0,
153 baseline: 24,
154 underline: DecorationDimensions::new(26, 2),
155 strikethrough: DecorationDimensions::new(16, 2),
156 glyph_mapping: &GLYPH_MAPPING,
157};