Struct vello::DrawGlyphs
source · pub struct DrawGlyphs<'a> { /* private fields */ }
Expand description
Builder for encoding a glyph run.
Implementations§
source§impl<'a> DrawGlyphs<'a>
impl<'a> DrawGlyphs<'a>
sourcepub fn new(encoding: &'a mut Encoding, font: &Font) -> Self
pub fn new(encoding: &'a mut Encoding, font: &Font) -> Self
Creates a new builder for encoding a glyph run for the specified encoding with the given font.
sourcepub fn transform(self, transform: Affine) -> Self
pub fn transform(self, transform: Affine) -> Self
Sets the global transform. This is applied to all glyphs after the offset translation.
The default value is the identity matrix.
sourcepub fn glyph_transform(self, transform: Option<Affine>) -> Self
pub fn glyph_transform(self, transform: Option<Affine>) -> Self
Sets the per-glyph transform. This is applied to all glyphs prior to offset translation. This is common used for applying a shear to simulate an oblique font.
The default value is None
.
sourcepub fn font_size(self, size: f32) -> Self
pub fn font_size(self, size: f32) -> Self
Sets the font size in pixels per em units.
The default value is 16.0.
sourcepub fn hint(self, hint: bool) -> Self
pub fn hint(self, hint: bool) -> Self
Sets whether to enable hinting.
The default value is false
.
sourcepub fn normalized_coords(self, coords: &[NormalizedCoord]) -> Self
pub fn normalized_coords(self, coords: &[NormalizedCoord]) -> Self
Sets the normalized design space coordinates for a variable font instance.
sourcepub fn brush(self, brush: impl Into<BrushRef<'a>>) -> Self
pub fn brush(self, brush: impl Into<BrushRef<'a>>) -> Self
Sets the brush.
The default value is solid black.
sourcepub fn brush_alpha(self, alpha: f32) -> Self
pub fn brush_alpha(self, alpha: f32) -> Self
Sets an additional alpha multiplier for the brush.
The default value is 1.0.