pub struct GlyphRunRenderer<'a, 'b, Glyphs: Iterator<Item = Glyph> + Clone> { /* private fields */ }Expand description
Helper struct for rendering a prepared glyph run.
Implementations§
Source§impl<'a, 'b, Glyphs: Iterator<Item = Glyph> + Clone> GlyphRunRenderer<'a, 'b, Glyphs>
impl<'a, 'b, Glyphs: Iterator<Item = Glyph> + Clone> GlyphRunRenderer<'a, 'b, Glyphs>
Sourcepub fn fill_glyphs(&mut self, renderer: &mut impl GlyphRenderer)
pub fn fill_glyphs(&mut self, renderer: &mut impl GlyphRenderer)
Fills the glyphs with the current configuration.
Sourcepub fn stroke_glyphs(&mut self, renderer: &mut impl GlyphRenderer)
pub fn stroke_glyphs(&mut self, renderer: &mut impl GlyphRenderer)
Strokes the glyphs with the current configuration.
Sourcepub fn stroke_adjustment(&self) -> f64
pub fn stroke_adjustment(&self) -> f64
Return the scaling factor that should be applied to the stroke width when stroking this glyph run.
Sourcepub fn render_decoration(
&mut self,
x_range: RangeInclusive<f32>,
baseline_y: f32,
offset: f32,
size: f32,
buffer: f32,
renderer: &mut impl DrawSink,
)
pub fn render_decoration( &mut self, x_range: RangeInclusive<f32>, baseline_y: f32, offset: f32, size: f32, buffer: f32, renderer: &mut impl DrawSink, )
Render a decoration (like an underline) that skips over glyph descenders.
This implements text-decoration-skip-ink-like behavior, where the decoration line is interrupted where it
would overlap with glyph outlines.
The x_range specifies the horizontal position of the decoration, and the offset and size specify its
vertical position and height (relative to the baseline). The buffer specifies how much horizontal space to
leave around each descender.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'b, Glyphs> Freeze for GlyphRunRenderer<'a, 'b, Glyphs>where
Glyphs: Freeze,
impl<'a, 'b, Glyphs> !RefUnwindSafe for GlyphRunRenderer<'a, 'b, Glyphs>
impl<'a, 'b, Glyphs> Send for GlyphRunRenderer<'a, 'b, Glyphs>where
Glyphs: Send,
impl<'a, 'b, Glyphs> Sync for GlyphRunRenderer<'a, 'b, Glyphs>where
Glyphs: Sync,
impl<'a, 'b, Glyphs> Unpin for GlyphRunRenderer<'a, 'b, Glyphs>where
Glyphs: Unpin,
impl<'a, 'b, Glyphs> UnsafeUnpin for GlyphRunRenderer<'a, 'b, Glyphs>where
Glyphs: UnsafeUnpin,
impl<'a, 'b, Glyphs> !UnwindSafe for GlyphRunRenderer<'a, 'b, Glyphs>
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