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>
impl<'a> Shaper<'a>
pub fn new(font: &FontRef<'a>, mode: ShaperMode) -> Self
pub fn font(&self) -> &FontRef<'a>
pub fn charmap(&self) -> &Charmap<'a>
pub fn lookup_count(&self) -> u16
pub fn cluster_shaper(&'a self, style: &StyleClass) -> ClusterShaper<'a>
Sourcepub(crate) fn compute_coverage(
&self,
style: &StyleClass,
coverage_kind: ShaperCoverageKind,
glyph_styles: &mut [GlyphStyle],
visited_set: &mut VisitedLookupSet<'_>,
) -> bool
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.
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> 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