pub enum PixelFont {
Outline7x9,
Standard4x4,
Standard4x5,
Standard6x7,
Standard8x10,
Script8x8,
Limited3x5,
}
Expand description
PixelFont is used to set the size and positioning in pixels of text
Variants§
Outline7x9
Standard4x4
Standard4x5
Standard6x7
Standard8x10
Script8x8
Limited3x5
No lower case, some symbols look bad
Implementations§
Source§impl PixelFont
impl PixelFont
Sourcepub fn measure(&self, text: &str) -> (usize, usize)
pub fn measure(&self, text: &str) -> (usize, usize)
Return size in pixels for text
Run text
through wrapping strategy first
pub fn char_width(&self) -> usize
pub fn line_height(&self) -> usize
pub const fn pixels(&self, code: u8) -> &[bool]
Sourcepub const fn px_to_cols(&self, px: usize) -> usize
pub const fn px_to_cols(&self, px: usize) -> usize
Converts pixels to columns
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PixelFont
impl<'de> Deserialize<'de> for PixelFont
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for PixelFont
impl Eq for PixelFont
impl StructuralPartialEq for PixelFont
Auto Trait Implementations§
impl Freeze for PixelFont
impl RefUnwindSafe for PixelFont
impl Send for PixelFont
impl Sync for PixelFont
impl Unpin for PixelFont
impl UnwindSafe for PixelFont
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more