os_terminal/font/
mod.rs

1use alloc::vec::Vec;
2
3#[cfg(feature = "bitmap")]
4mod bitmap;
5#[cfg(feature = "truetype")]
6mod truetype;
7
8#[cfg(feature = "bitmap")]
9pub use bitmap::BitmapFont;
10#[cfg(feature = "truetype")]
11pub use truetype::TrueTypeFont;
12
13pub enum Rasterized<'a> {
14    Slice(&'a [&'a [u8]]),
15    Vec(&'a Vec<Vec<u8>>),
16    Owned(Vec<Vec<u8>>),
17}
18
19#[derive(Default, Clone, PartialEq, Eq, PartialOrd, Ord)]
20pub struct ContentInfo {
21    pub content: char,
22    pub bold: bool,
23    pub italic: bool,
24    pub wide: bool,
25}
26
27pub trait FontManager: Send {
28    fn size(&self) -> (usize, usize);
29    fn rasterize(&mut self, info: ContentInfo) -> Rasterized;
30}