Struct Shaper

Source
pub(crate) struct Shaper<'a> {
    font: FontRef<'a>,
    mode: ShaperMode,
    charmap: Charmap<'a>,
    gsub: Option<Gsub<'a>>,
}
Expand description

Maps characters to glyphs and handles extended style coverage beyond glyphs that are available in the character map.

Roughly covers the functionality in https://gitlab.freedesktop.org/freetype/freetype/-/blob/57617782464411201ce7bbc93b086c1b4d7d84a5/src/autofit/afshaper.c.

Fields§

§font: FontRef<'a>§mode: ShaperMode§charmap: Charmap<'a>§gsub: Option<Gsub<'a>>

Implementations§

Source§

impl<'a> Shaper<'a>

Source

pub fn new(font: &FontRef<'a>, mode: ShaperMode) -> Self

Source

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

Source

pub fn charmap(&self) -> &Charmap<'a>

Source

pub fn lookup_count(&self) -> u16

Source

pub fn cluster_shaper(&'a self, style: &StyleClass) -> ClusterShaper<'a>

Source

pub(crate) fn compute_coverage( &self, style: &StyleClass, coverage_kind: ShaperCoverageKind, glyph_styles: &mut [GlyphStyle], visited_set: &mut VisitedLookupSet<'_>, ) -> bool

Uses layout tables to compute coverage for the given style.

Returns true if any glyph styles were updated for this style.

See https://gitlab.freedesktop.org/freetype/freetype/-/blob/57617782464411201ce7bbc93b086c1b4d7d84a5/src/autofit/afshaper.c#L99

Auto Trait Implementations§

§

impl<'a> Freeze for Shaper<'a>

§

impl<'a> RefUnwindSafe for Shaper<'a>

§

impl<'a> Send for Shaper<'a>

§

impl<'a> Sync for Shaper<'a>

§

impl<'a> Unpin for Shaper<'a>

§

impl<'a> UnwindSafe for Shaper<'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> 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, 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.