Skip to main content

Outlines

Struct Outlines 

Source
pub(crate) struct Outlines<'a> {
    varc: Varc<'a>,
    coverage: CoverageTable<'a>,
    var_store: Option<MultiItemVariationStore<'a>>,
    regions: Option<SparseVariationRegionList<'a>>,
    base: BaseOutlines<'a>,
    glyph_metrics: GlyphHMetrics<'a>,
    units_per_em: u16,
    axis_count: usize,
}

Fields§

§varc: Varc<'a>§coverage: CoverageTable<'a>§var_store: Option<MultiItemVariationStore<'a>>§regions: Option<SparseVariationRegionList<'a>>§base: BaseOutlines<'a>§glyph_metrics: GlyphHMetrics<'a>§units_per_em: u16§axis_count: usize

Implementations§

Source§

impl<'a> Outlines<'a>

Source

pub fn new(font: &FontRef<'a>) -> Option<Self>

Source

fn from_base( font: &FontRef<'a>, varc: Varc<'a>, base: BaseOutlines<'a>, ) -> Option<Self>

Source

pub fn units_per_em(&self) -> u16

Source

pub fn glyph_count(&self) -> u32

Source

pub fn prefer_interpreter(&self) -> bool

Source

pub fn fractional_size_hinting(&self) -> bool

Source

pub fn font(&self) -> &FontRef<'a>

Source

pub(crate) fn fallback_outline_kind( &self, glyph_id: GlyphId, ) -> Option<OutlineKind<'a>>

Source

pub fn outline(&self, glyph_id: GlyphId) -> Result<Option<Outline>, ReadError>

Source

fn coverage_index(&self, glyph_id: GlyphId) -> Result<Option<u16>, ReadError>

Lightweight coverage lookup without computing max_component_memory.

Source

fn compute_max_component_memory( &self, glyph_id: GlyphId, coverage_index: u16, ) -> Result<usize, ReadError>

Source

fn max_component_memory_for_glyph( &self, glyph_id: GlyphId, coverage_index: u16, stack: &mut SmallVec<GlyphId, 8>, ) -> Result<usize, ReadError>

Source

pub fn draw( &self, outline: &Outline, buf: &mut [u8], size: Size, coords: &[F2Dot14], path_style: PathStyle, pen: &mut impl OutlinePen, ) -> Result<(), DrawError>

Source

pub fn draw_unscaled( &self, outline: &Outline, buf: &mut [u8], coords: &[F2Dot14], pen: &mut impl OutlinePen, ) -> Result<i32, DrawError>

Source

fn draw_glyph( &self, glyph_id: GlyphId, coverage_index: u16, current_coords: &[F2Dot14], parent_matrix: Matrix<f32>, ctx: &VarcSharedContext<'a, '_>, buf: &mut [u8], pen: &mut dyn OutlinePen, stack: &mut SmallVec<GlyphId, 8>, scalar_cache: &mut ScalarCache, scratch: &mut Scratchpad, ) -> Result<(), DrawError>

Source

fn draw_base_glyph( &self, glyph_id: GlyphId, coords: &[F2Dot14], size: Size, path_style: PathStyle, buf: &mut [u8], pen: &mut impl OutlinePen, ) -> Result<(), DrawError>

Source

fn component_coords( &self, component: &VarcComponent<'_>, current_coords: &[F2Dot14], coords: &mut SmallVec<F2Dot14, 64>, scalar_cache: &mut ScalarCache, scratch: &mut Scratchpad, font_coords: &[F2Dot14], store_regions: Option<(&MultiItemVariationStore<'a>, &SparseVariationRegionList<'a>)>, ) -> Result<(), DrawError>

Source

fn axis_indices( &self, nth: usize, out: &mut SmallVec<u16, 64>, ) -> Result<usize, DrawError>

Source

fn axis_values( &self, component: &VarcComponent<'_>, count: usize, out: &mut SmallVec<f32, 64>, ) -> Result<(), DrawError>

Source

fn apply_transform_variations( &self, component: &VarcComponent<'_>, coords: &[F2Dot14], transform: &mut DecomposedTransform, scalar_cache: &mut ScalarCache, scratch: &mut Scratchpad, store_regions: Option<(&MultiItemVariationStore<'a>, &SparseVariationRegionList<'a>)>, ) -> Result<(), DrawError>

Source

fn component_condition_met( &self, component: &VarcComponent<'_>, coords: &[F2Dot14], scalar_cache: &mut ScalarCache, scratch: &mut Scratchpad, store_regions: Option<(&MultiItemVariationStore<'a>, &SparseVariationRegionList<'a>)>, ) -> Result<bool, DrawError>

Source

fn eval_condition( condition: &Condition<'a>, coords: &[F2Dot14], var_store: &MultiItemVariationStore<'a>, regions: &SparseVariationRegionList<'a>, scalar_cache: &mut ScalarCache, scratch: &mut Scratchpad, ) -> Result<bool, DrawError>

Source

fn scalar_cache_from_store( &self, store: Option<&MultiItemVariationStore<'a>>, ) -> Result<Option<ScalarCache>, DrawError>

Trait Implementations§

Source§

impl<'a> Clone for Outlines<'a>

Source§

fn clone(&self) -> Outlines<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Outlines<'a>

§

impl<'a> RefUnwindSafe for Outlines<'a>

§

impl<'a> Send for Outlines<'a>

§

impl<'a> Sync for Outlines<'a>

§

impl<'a> Unpin for Outlines<'a>

§

impl<'a> UnsafeUnpin for Outlines<'a>

§

impl<'a> UnwindSafe for Outlines<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.