Struct embedded_graphics::fonts::Font8x16 [−][src]
pub struct Font8x16<'a> {
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> Debug for Font8x16<'a>[src]
impl<'a> Debug for Font8x16<'a>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> Clone for Font8x16<'a>[src]
impl<'a> Clone for Font8x16<'a>fn clone(&self) -> Font8x16<'a>[src]
fn clone(&self) -> Font8x16<'a>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> Copy for Font8x16<'a>[src]
impl<'a> Copy for Font8x16<'a>impl<'a> Font<'a> for Font8x16<'a>[src]
impl<'a> Font<'a> for Font8x16<'a>fn render_str(text: &'a str, color: u8) -> Font8x16<'a>[src]
fn render_str(text: &'a str, color: u8) -> Font8x16<'a>Render a string in the implementing font's typeface. Read more
impl<'a> IntoIterator for &'a Font8x16<'a>[src]
impl<'a> IntoIterator for &'a Font8x16<'a>type IntoIter = Font8x16Iterator<'a>
Which kind of iterator are we turning this into?
type Item = Pixel
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> Drawable for Font8x16<'a>[src]
impl<'a> Drawable for Font8x16<'a>impl<'a> Transform for Font8x16<'a>[src]
impl<'a> Transform for Font8x16<'a>fn translate(&self, by: Coord) -> Self[src]
fn translate(&self, by: Coord) -> SelfTranslate the image from its current position to a new position by (x, y) pixels, returning
a new Font8x16. For a mutating transform, see translate_mut.
// 8px x 1px test image let text = Font8x16::render_str("Hello world", 1); 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.
let mut text = Font6x8::render_str("Hello world", 1); text.translate_mut(Coord::new(25, 30)); assert_eq!(text.pos, Coord::new(25, 30));