Skip to main content

GlyphInfoExtractor

Struct GlyphInfoExtractor 

Source
struct GlyphInfoExtractor<'a, 'b> {
    transforms: Vec<Affine>,
    clip_stack: Vec<Rect>,
    coarse_bbox: Option<Rect>,
    has_non_default_blend: bool,
    outline_glyphs: OutlineGlyphCollection<'a>,
    outline_cache: &'a mut OutlineCacheSession<'b>,
    location: LocationRef<'a>,
    font_info: FontInfo,
}

Fields§

§transforms: Vec<Affine>§clip_stack: Vec<Rect>§coarse_bbox: Option<Rect>§has_non_default_blend: bool§outline_glyphs: OutlineGlyphCollection<'a>§outline_cache: &'a mut OutlineCacheSession<'b>§location: LocationRef<'a>§font_info: FontInfo

Implementations§

Source§

impl<'a, 'b> GlyphInfoExtractor<'a, 'b>

Source

fn new( font_ref: &'a FontRef<'a>, location: LocationRef<'a>, outline_cache: &'a mut OutlineCacheSession<'b>, font_info: FontInfo, ) -> Self

Source

fn cur_transform(&self) -> Affine

Source

fn push_clip_bbox(&mut self, clip_bbox: Rect)

Source

fn transform_rect(&self, rect: Rect) -> Rect

Source

fn get_outline(&mut self, glyph_id: GlyphId) -> Option<CachedOutline<'_>>

Source

fn finish(self) -> ColrGlyphInfo

Trait Implementations§

Source§

impl ColorPainter for GlyphInfoExtractor<'_, '_>

Source§

fn push_transform(&mut self, t: Transform)

Push the specified transform by concatenating it to the current transformation matrix.
Source§

fn pop_transform(&mut self)

Restore the transformation matrix to the state before the previous push_transform call.
Source§

fn push_clip_glyph(&mut self, glyph_id: GlyphId)

Apply a clip path in the shape of glyph specified by glyph_id.
Source§

fn push_clip_box(&mut self, clip_box: BoundingBox<f32>)

Apply a clip rectangle specified by clip_rect.
Source§

fn pop_clip(&mut self)

Restore the clip state to the state before a previous push_clip_glyph or push_clip_box call.
Source§

fn fill(&mut self, _brush: Brush<'_>)

Fill the current clip area with the specified gradient fill.
Source§

fn push_layer(&mut self, composite_mode: CompositeMode)

Open a new layer, and merge the layer down using composite_mode when pop_layer is called, signalling that this layer is done drawing.
Source§

fn pop_layer(&mut self)

Merge the pushed layer down using composite_mode passed to the matching push_layer.
Source§

fn fill_glyph( &mut self, glyph_id: GlyphId, brush_transform: Option<Matrix<f32>>, brush: Brush<'_>, )

Combined clip and fill operation. Read more
Source§

fn paint_cached_color_glyph( &mut self, _glyph: GlyphId, ) -> Result<PaintCachedColorGlyph, PaintError>

Optionally implement this method: Draw an unscaled COLRv1 glyph given the current transformation matrix (as accumulated by push_transform calls).
Source§

fn pop_layer_with_mode(&mut self, _composite_mode: CompositeMode)

Alternative version of push_layer where the composite_mode is also passed to the method. This is useful for graphics libraries that need the compositing mode at layer pop time and do not want to manually track the mode. Read more

Auto Trait Implementations§

§

impl<'a, 'b> Freeze for GlyphInfoExtractor<'a, 'b>

§

impl<'a, 'b> RefUnwindSafe for GlyphInfoExtractor<'a, 'b>

§

impl<'a, 'b> Send for GlyphInfoExtractor<'a, 'b>

§

impl<'a, 'b> Sync for GlyphInfoExtractor<'a, 'b>

§

impl<'a, 'b> Unpin for GlyphInfoExtractor<'a, 'b>

§

impl<'a, 'b> UnsafeUnpin for GlyphInfoExtractor<'a, 'b>

§

impl<'a, 'b> !UnwindSafe for GlyphInfoExtractor<'a, 'b>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.