Struct embedded_graphics::fonts::font_builder::FontBuilder [−][src]
pub struct FontBuilder<'a, C: PixelColor, Conf> { pub pos: Coord, // some fields omitted }
The font builder
Fields
pos: Coord
Top left corner of the text
Trait Implementations
impl<'a, C: Debug + PixelColor, Conf: Debug> Debug for FontBuilder<'a, C, Conf>
[src]
impl<'a, C: Debug + PixelColor, Conf: Debug> Debug for FontBuilder<'a, C, Conf>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a, C: PixelColor + Copy, Conf> Copy for FontBuilder<'a, C, Conf>
[src]
impl<'a, C: PixelColor + Copy, Conf> Copy for FontBuilder<'a, C, Conf>
impl<'a, C: PixelColor + Clone, Conf> Clone for FontBuilder<'a, C, Conf>
[src]
impl<'a, C: PixelColor + Clone, Conf> Clone for FontBuilder<'a, C, Conf>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
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)
Performs copy-assignment from source
. Read more
impl<'a, C, Conf> Font<'a, C> for FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
[src]
impl<'a, C, Conf> Font<'a, C> for FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
fn render_str(text: &'a str) -> Self
[src]
fn render_str(text: &'a str) -> Self
Render a string in the implementing font's typeface. Read more
fn dimensions(&self) -> UnsignedCoord
[src]
fn dimensions(&self) -> UnsignedCoord
Get the dimensions of a piece of text rendered in a particular font
impl<'a, C, Conf> WithStyle<C> for FontBuilder<'a, C, Conf> where
C: PixelColor,
[src]
impl<'a, C, Conf> WithStyle<C> for FontBuilder<'a, C, Conf> where
C: PixelColor,
fn with_style(self, style: Style<C>) -> Self
[src]
fn with_style(self, style: Style<C>) -> Self
Add a complete style to the object
fn with_stroke(self, color: Option<C>) -> Self
[src]
fn with_stroke(self, color: Option<C>) -> Self
Set the stroke colour for the object Read more
fn with_stroke_width(self, _width: u8) -> Self
[src]
fn with_stroke_width(self, _width: u8) -> Self
Set the stroke width for the object Read more
fn with_fill(self, color: Option<C>) -> Self
[src]
fn with_fill(self, color: Option<C>) -> Self
Set the fill property of the object's style Read more
impl<'a, C, Conf> IntoIterator for &'a FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
[src]
impl<'a, C, Conf> IntoIterator for &'a FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
type IntoIter = FontBuilderIterator<'a, C, Conf>
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::IntoIter
Creates an iterator from a value. Read more
impl<'a, C, Conf> Drawable for FontBuilder<'a, C, Conf> where
C: PixelColor,
[src]
impl<'a, C, Conf> Drawable for FontBuilder<'a, C, Conf> where
C: PixelColor,
impl<'a, C, Conf> Transform for FontBuilder<'a, C, Conf> where
C: PixelColor,
[src]
impl<'a, C, Conf> Transform for FontBuilder<'a, C, Conf> where
C: PixelColor,
fn translate(&self, by: Coord) -> Self
[src]
fn translate(&self, by: Coord) -> Self
Translate 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") 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 Self
Translate the font origin from its current position to a new position by (x, y) pixels.
// 8px x 1px test image let mut text = Font8x16::render_str("Hello world") text.translate_mut(Coord::new(25, 30)); assert_eq!(text.pos, Coord::new(25, 30));
Auto Trait Implementations
impl<'a, C, Conf> Send for FontBuilder<'a, C, Conf> where
C: Send,
Conf: Send,
impl<'a, C, Conf> Send for FontBuilder<'a, C, Conf> where
C: Send,
Conf: Send,
impl<'a, C, Conf> Sync for FontBuilder<'a, C, Conf> where
C: Sync,
Conf: Sync,
impl<'a, C, Conf> Sync for FontBuilder<'a, C, Conf> where
C: Sync,
Conf: Sync,