pub struct GlyphRunBuilder<'a, B> {
run: GlyphRun<'a>,
backend: B,
}Expand description
A builder for configuring and drawing glyphs.
Fields§
§run: GlyphRun<'a>§backend: BImplementations§
Source§impl<'a, B> GlyphRunBuilder<'a, B>
impl<'a, B> GlyphRunBuilder<'a, B>
Sourcepub fn new(
font: FontData,
transform: Affine,
paint_transform: Affine,
backend: B,
) -> Self
pub fn new( font: FontData, transform: Affine, paint_transform: Affine, backend: B, ) -> Self
Creates a new builder for drawing glyphs with a pre-bound backend.
Sourcepub fn font_embolden(self, embolden: FontEmbolden) -> Self
pub fn font_embolden(self, embolden: FontEmbolden) -> Self
Set synthetic embolden settings.
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.
Source§impl<'a, B> GlyphRunBuilder<'a, B>where
B: GlyphRunBackend<'a>,
impl<'a, B> GlyphRunBuilder<'a, B>where
B: GlyphRunBackend<'a>,
Sourcepub fn atlas_cache(self, enabled: bool) -> Self
pub fn atlas_cache(self, enabled: bool) -> Self
Enable or disable the glyph atlas cache.
Note: Atlas caching is currently highly experimental and not recommended for external use.
Sourcepub fn fill_glyphs<Glyphs>(self, glyphs: Glyphs)
pub fn fill_glyphs<Glyphs>(self, glyphs: Glyphs)
Fill the glyphs using the current settings.
Sourcepub fn stroke_glyphs<Glyphs>(self, glyphs: Glyphs)
pub fn stroke_glyphs<Glyphs>(self, glyphs: Glyphs)
Stroke the glyphs using the current settings.
Sourcepub fn render_decoration<Glyphs>(
self,
glyphs: Glyphs,
x_range: RangeInclusive<f32>,
baseline_y: f32,
offset: f32,
size: f32,
buffer: f32,
)
pub fn render_decoration<Glyphs>( self, glyphs: Glyphs, x_range: RangeInclusive<f32>, baseline_y: f32, offset: f32, size: f32, buffer: f32, )
Render a decoration (e.g. underline) with skip-ink behavior.