use embedded_graphics::iterator::raw::RawDataSlice;
use embedded_graphics::pixelcolor::PixelColor;
use embedded_graphics::pixelcolor::raw::BigEndian;
use crate::charmap::{Charmap, CharmapEntry};
use crate::metrics::{BitmapFontMetrics, DecorationDimensions};
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct BitmapFont<'a, C, const N: usize>
where
C: PixelColor + From<C::Raw>,
RawDataSlice<'a, C::Raw, BigEndian>: IntoIterator<Item = C::Raw>,
{
pub charmap: Charmap<'a, C, N>,
pub metrics: BitmapFontMetrics,
pub underline: DecorationDimensions,
pub strikethrough: DecorationDimensions,
}
impl<'a, C, const N: usize> BitmapFont<'a, C, N>
where
C: PixelColor + From<C::Raw>,
RawDataSlice<'a, C::Raw, BigEndian>: IntoIterator<Item = C::Raw>,
{
pub const NULL: Self = Self {
charmap: Charmap::Leaf(CharmapEntry::NULL),
metrics: BitmapFontMetrics::NULL,
underline: DecorationDimensions::NULL,
strikethrough: DecorationDimensions::NULL,
};
}