[−][src]Struct embedded_graphics::fonts::font_builder::FontBuilder
The font builder
This is a helper struct to reduce code duplication when implementing fonts. View the module level type definitions for a list of usable fonts.
Fields
pos: Coord
Top left corner of the text
Trait Implementations
impl<'a, C: PixelColor + Clone, Conf> Clone for FontBuilder<'a, C, Conf>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a, C: PixelColor + Copy, Conf> Copy for FontBuilder<'a, C, Conf>
[src]
impl<'a, C: Debug + PixelColor, Conf: Debug> Debug for FontBuilder<'a, C, Conf>
[src]
impl<'a, C, Conf> Dimensions for FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
[src]
C: PixelColor,
Conf: FontBuilderConf,
fn top_left(&self) -> Coord
[src]
fn bottom_right(&self) -> Coord
[src]
fn size(&self) -> UnsignedCoord
[src]
Get the bounding box of a piece of text
Currently does not handle newlines (but neither does the rasteriser). It will give (0, 0)
if the string to render is empty.
impl<'a, C: 'a, Conf: 'a> Drawable for FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
[src]
C: PixelColor,
Conf: FontBuilderConf,
impl<'a, C, Conf> Font<'a, C> for FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
[src]
C: PixelColor,
Conf: FontBuilderConf,
fn render_str(text: &'a str) -> Self
[src]
impl<'a, C: 'a, Conf: 'a> IntoIterator for FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
[src]
C: PixelColor,
Conf: FontBuilderConf,
type Item = Pixel<C>
The type of the elements being iterated over.
type IntoIter = FontBuilderIterator<'a, C, Conf>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, C, Conf> IntoIterator for &'a FontBuilder<'a, C, Conf> where
C: PixelColor,
Conf: FontBuilderConf,
[src]
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]
impl<'a, C, Conf> Transform for FontBuilder<'a, C, Conf> where
C: PixelColor,
[src]
C: PixelColor,
fn translate(&self, by: Coord) -> Self
[src]
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]
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));
impl<'a, C, Conf> WithStyle<C> for FontBuilder<'a, C, Conf> where
C: PixelColor,
[src]
C: PixelColor,
Auto Trait Implementations
impl<'a, C, Conf> Send for FontBuilder<'a, C, Conf> where
C: Send,
Conf: Send,
C: Send,
Conf: Send,
impl<'a, C, Conf> Sync for FontBuilder<'a, C, Conf> where
C: Sync,
Conf: Sync,
C: Sync,
Conf: Sync,
impl<'a, C, Conf> Unpin for FontBuilder<'a, C, Conf> where
C: Unpin,
Conf: Unpin,
C: Unpin,
Conf: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,