pub struct GlyphRunBuilder<'a, T: GlyphRenderer + 'a> {
run: GlyphRun<'a>,
renderer: &'a mut T,
}
Expand description
A builder for configuring and drawing glyphs.
Fields§
§run: GlyphRun<'a>
§renderer: &'a mut T
Implementations§
Source§impl<'a, T: GlyphRenderer + 'a> GlyphRunBuilder<'a, T>
impl<'a, T: GlyphRenderer + 'a> GlyphRunBuilder<'a, T>
Sourcepub fn new(font: Font, transform: Affine, renderer: &'a mut T) -> Self
pub fn new(font: Font, transform: Affine, renderer: &'a mut T) -> Self
Creates a new builder for drawing glyphs.
Sourcepub fn glyph_transform(self, transform: Affine) -> Self
pub fn glyph_transform(self, transform: Affine) -> Self
Set the per-glyph transform. Use Affine::skew
with a horizontal-only skew to simulate
italic text.
Sourcepub fn hint(self, hint: bool) -> Self
pub fn hint(self, hint: bool) -> Self
Set whether font hinting is enabled.
This performs vertical hinting only. Hinting is performed only if the combined transform
and glyph_transform
have a uniform scale and no vertical skew or rotation.
Sourcepub fn normalized_coords(self, coords: &'a [NormalizedCoord]) -> Self
pub fn normalized_coords(self, coords: &'a [NormalizedCoord]) -> Self
Set normalized variation coordinates for variable fonts.
Sourcepub fn fill_glyphs(self, glyphs: impl Iterator<Item = Glyph>)
pub fn fill_glyphs(self, glyphs: impl Iterator<Item = Glyph>)
Consumes the builder and fills the glyphs with the current configuration.
Sourcepub fn stroke_glyphs(self, glyphs: impl Iterator<Item = Glyph>)
pub fn stroke_glyphs(self, glyphs: impl Iterator<Item = Glyph>)
Consumes the builder and strokes the glyphs with the current configuration.
fn render(self, glyphs: impl Iterator<Item = Glyph>, style: Style)
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for GlyphRunBuilder<'a, T>
impl<'a, T> !RefUnwindSafe for GlyphRunBuilder<'a, T>
impl<'a, T> Send for GlyphRunBuilder<'a, T>where
T: Send,
impl<'a, T> Sync for GlyphRunBuilder<'a, T>where
T: Sync,
impl<'a, T> Unpin for GlyphRunBuilder<'a, T>
impl<'a, T> !UnwindSafe for GlyphRunBuilder<'a, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more