pub struct ScalerOutline<'a> {
scaler: &'a ScalerFont,
outline: OutlineGlyph<'a>,
}Expand description
An outline from a ScalerFont, resolved for drawing.
Holds the outline in its source format. A caller can size its own working memory and then draw without looking up the glyph again.
Fields§
§scaler: &'a ScalerFont§outline: OutlineGlyph<'a>Implementations§
Source§impl ScalerOutline<'_>
impl ScalerOutline<'_>
Sourcepub fn source(&self) -> OutlineSource
pub fn source(&self) -> OutlineSource
Returns the table that contains the outline.
Sourcepub fn required_memory_size(&self) -> usize
pub fn required_memory_size(&self) -> usize
Returns the size in bytes of the working memory needed by
draw.
Returns zero for the automatic hinter, which manages its own memory.
Sourcepub fn draw(
&self,
memory: DrawMemory<'_>,
sink: &mut impl PathSink,
) -> Result<DrawnMetrics, ScaleError>
pub fn draw( &self, memory: DrawMemory<'_>, sink: &mut impl PathSink, ) -> Result<DrawnMetrics, ScaleError>
Draws the outline into sink with the scaler’s size and hinting.
With DrawMemory::Scratch, working memory comes from short lived
scratch, which may be allocated on the heap for a large glyph program.
Supplied memory must hold at least
required_memory_size bytes, or the
draw fails with ScaleError::InsufficientMemory.
Sourcefn draw_dyn(
&self,
memory: Option<&mut [u8]>,
sink: &mut dyn PathSink,
) -> Result<DrawnMetrics, ScaleError>
fn draw_dyn( &self, memory: Option<&mut [u8]>, sink: &mut dyn PathSink, ) -> Result<DrawnMetrics, ScaleError>
Dispatches a draw through a trait object so the engines are compiled once rather than once per sink type.
Trait Implementations§
Source§impl<'a> Clone for ScalerOutline<'a>
impl<'a> Clone for ScalerOutline<'a>
Source§fn clone(&self) -> ScalerOutline<'a>
fn clone(&self) -> ScalerOutline<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more