Struct embedded_graphics::fonts::Font6x12 [−][src]
pub struct Font6x12<'a, C: PixelColor> { pub pos: Coord, // some fields omitted }
Container struct to hold a positioned piece of text
Fields
pos: Coord
Top left corner of the text
Trait Implementations
impl<'a, C: Debug + PixelColor> Debug for Font6x12<'a, C>[src]
impl<'a, C: Debug + PixelColor> Debug for Font6x12<'a, C>fn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'a, C: Clone + PixelColor> Clone for Font6x12<'a, C>[src]
impl<'a, C: Clone + PixelColor> Clone for Font6x12<'a, C>fn clone(&self) -> Font6x12<'a, C>[src]
fn clone(&self) -> Font6x12<'a, C>Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl<'a, C: Copy + PixelColor> Copy for Font6x12<'a, C>[src]
impl<'a, C: Copy + PixelColor> Copy for Font6x12<'a, C>impl<'a, C> Font<'a, C> for Font6x12<'a, C> where
C: PixelColor, [src]
impl<'a, C> Font<'a, C> for Font6x12<'a, C> where
C: PixelColor, fn render_str(text: &'a str, color: C) -> Font6x12<'a, C>[src]
fn render_str(text: &'a str, color: C) -> Font6x12<'a, C>Render a string in the implementing font's typeface. Read more
impl<'a, C> IntoIterator for &'a Font6x12<'a, C> where
C: PixelColor, [src]
impl<'a, C> IntoIterator for &'a Font6x12<'a, C> where
C: PixelColor, type IntoIter = Font6x12Iterator<'a, C>
Which kind of iterator are we turning this into?
type Item = Pixel<C>
The type of the elements being iterated over.
fn into_iter(self) -> Self::IntoIter[src]
fn into_iter(self) -> Self::IntoIterCreates an iterator from a value. Read more
impl<'a, C> Drawable for Font6x12<'a, C> where
C: PixelColor, [src]
impl<'a, C> Drawable for Font6x12<'a, C> where
C: PixelColor, impl<'a, C> Transform for Font6x12<'a, C> where
C: PixelColor, [src]
impl<'a, C> Transform for Font6x12<'a, C> where
C: PixelColor, fn translate(&self, by: Coord) -> Self[src]
fn translate(&self, by: Coord) -> SelfTranslate the font origin from its current position to a new position by (x, y) pixels,
returning a new Font6x8. For a mutating transform, see translate_mut.
let text = Font6x8::render_str("Hello world", 1u8); let moved = text.translate(Coord::new(25, 30)); assert_eq!(text.pos, Coord::new(0, 0)); assert_eq!(moved.pos, Coord::new(25, 30));
fn translate_mut(&mut self, by: Coord) -> &mut Self[src]
fn translate_mut(&mut self, by: Coord) -> &mut SelfTranslate the font origin from its current position to a new position by (x, y) pixels.
// 8px x 1px test image let mut text = Font6x12::render_str("Hello world", 1u8); text.translate_mut(Coord::new(25, 30)); assert_eq!(text.pos, Coord::new(25, 30));