embedded_graphics::fonts

Struct Font6x6

Source
pub struct Font6x6;
Expand description

6x6 pixel variable width font.

6x6 font spritemap screenshot

§Examples

See the module-level documentation for examples.

Trait Implementations§

Source§

impl Clone for Font6x6

Source§

fn clone(&self) -> Font6x6

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Font6x6

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Font6x6

Source§

fn default() -> Font6x6

Returns the “default value” for a type. Read more
Source§

impl Font for Font6x6

Source§

const FONT_IMAGE: &'static [u8] = b"\x02\n\x14z& B\n\x88\x00\x00\x02\xf1\x0f<\x93\xcf<\xf3\xc0\x00 \x08\x1c\x02\n>\xa0I \x81\x07\x08\x00\x00\x04\x93\x01\x04\x92\x08\x04\x92H C\x84\"\x02\x00\x14\xf8\x86\x00\x81\x0f\xbe\x03\xe0\x08\x91\x0f\x1c\xf3\xcf\x08\xf3\xc0\x00\x80\x02\x0c\x00\x00>)\n\x00\x81\x07\x08\x80\x00\x10\x91\x08\x04\x10I\x10\x90H C\x84\x00\x02\x00\x14\xf2/\x00B\n\x88\x80\x08 \xf3\x8f<\x13\xcf \xf3\xc0 \x08\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00s\xce<\xe3\x8f<\x92\x07$\x82)<\xf1\x8f<\xe2H\xa2\x8a/\xb0\x83\x04\x00\nI \x92\x08 \x92\x01(\x83m$\x92I BH\xa2QA A\n\x00K\xce \x93\x8e,\xf2\x010\x82\xab$\xf2O<BH\xaa \x82 !\x00\x00\xaaI \x92\x08$\x92\t(\x82)$\x82\x8a\x04BE6P\x84 \x11\x00\x00rN<\xe3\x88<\x92\x06$\xe2)<\x81I<C\xc2\"\x88\x8f\xb0\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>\x80\x08\x00\x11\x83\x1c\x82\x02 \x80\x00\x00\xe1\xc0\x1c\x80\x00\x00\x02@\x18\x83\x00\x00A\x88\x00\x12D$\x80\x00(\x81N\x18\x92F \xe2I\"\xa2O\x10\x81\x06\x80\x02O<\xf3\xce\x1c\xe2\x020\x82\xa9$\xe1\xc9\x18\x82I\"C\xc20\x81\x89\x00\x02I \x92\x04\x04\x92\n(\x82)$\x80H\x04\xa2J*@D\x10\x81\x00\x00\x01\xaf<\xf1\x84\x18\x92\x04$b)\x18\x80H8A\x84\x14\xa3\x8f\x18\x83\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x02\x0c2(\x18\x93\xc4\x08\x00\x0f\xbcA\x0e8A\'\x00\x01\x04\x08\xf3\xc0\x08\x00\x0f\x12AH\x10\x02J\x12\x00\x08\x80\xa3\x82\x08\x81+\x00\x03\n$\xa2\x80\x00\x02\n8\xe3\xe0(\x02\xc5$\xf3\xca\x80A\x0e8\x01+ \x01\x04\x12\xb2\xc0\x18\x02\x0f\x10@\x88\x10\x02@\x12\x10\t\x80\x00\x08\x08\x01\xc7\x00C\x80$\xa2\x80\"\x02\x02.0\x880\x03\xc0\x08\x00\n\x80\x03\x8e8\x01\x03\x00\xc0\x0e\x08\xf3\xc0\x1c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"

Raw image data containing the font.
Source§

const FONT_IMAGE_WIDTH: u32 = 192u32

The width of the raw image data. Read more
Source§

const CHARACTER_SIZE: Size

Size of a single character in pixel.
Source§

const VARIABLE_WIDTH: bool = true

Whether characters have a variable width or not. Read more
Source§

const CHARACTER_SPACING: u32 = 1u32

Spacing between characters. Read more
Source§

fn char_offset(c: char) -> u32

Returns the position a character in the font.
Source§

fn char_width(c: char) -> u32

Returns the actual width of a character in the font.
Source§

fn character_pixel(c: char, x: u32, y: u32) -> bool

Returns the value of a pixel in a character in the font.
Source§

impl Hash for Font6x6

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Font6x6

Source§

fn cmp(&self, other: &Font6x6) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Font6x6

Source§

fn eq(&self, other: &Font6x6) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Font6x6

Source§

fn partial_cmp(&self, other: &Font6x6) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Font6x6

Source§

impl Eq for Font6x6

Source§

impl StructuralPartialEq for Font6x6

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 0 bytes