pub struct FontBuilder<'a, C: PixelColor, Conf> {
    pub pos: Coord,
    /* private fields */
}
Expand description

The font builder

Fields

pos: Coord

Top left corner of the text

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Render a string in the implementing font’s typeface. Read more
Get the dimensions of a piece of text rendered in a particular font
Which kind of iterator are we turning this into?
The type of the elements being iterated over.
Creates an iterator from a value. Read more

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));

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));
Add a complete style to the object
Set the stroke colour for the object Read more
Set the stroke width for the object Read more
Set the fill property of the object’s style Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.