pub struct hb_font_t<'a> {
pub(crate) font: FontKind<'a>,
pub(crate) units_per_em: u16,
pub(crate) cmap_cache: &'a hb_cache_core_t<KEY_BITS, VALUE_BITS, CACHE_SIZE, <() as SelectAtomic<STORAGE_BITS>>::Type>,
pub(crate) ot_tables: OtTables<'a>,
pub(crate) aat_tables: AatTables<'a>,
pub(crate) apply_trak: bool,
}Expand description
A configured shaper.
Fields§
§font: FontKind<'a>§units_per_em: u16§cmap_cache: &'a hb_cache_core_t<KEY_BITS, VALUE_BITS, CACHE_SIZE, <() as SelectAtomic<STORAGE_BITS>>::Type>§ot_tables: OtTables<'a>§aat_tables: AatTables<'a>§apply_trak: boolImplementations§
Source§impl<'a> Shaper<'a>
impl<'a> Shaper<'a>
pub(crate) fn from_font(font: &'a FontInstance) -> Option<Self>
Sourcepub fn units_per_em(&self) -> i32
pub fn units_per_em(&self) -> i32
Returns font’s units per EM.
Sourcepub fn coords(&self) -> &'a [NormalizedCoord] ⓘ
pub fn coords(&self) -> &'a [NormalizedCoord] ⓘ
Returns the currently active normalized coordinates.
Sourcepub fn shape(
&self,
buffer: UnicodeBuffer,
options: ShapeOptions<'_>,
) -> GlyphBuffer
pub fn shape( &self, buffer: UnicodeBuffer, options: ShapeOptions<'_>, ) -> GlyphBuffer
Shapes the buffer content using provided options.
Consumes the buffer. You can then run GlyphBuffer::clear to get the UnicodeBuffer back
without allocating a new one.
If a plan is provided, it is up to the caller to ensure that the shape plan matches the properties of the provided buffer, otherwise the shaping result will likely be incorrect.
§Panics
Will panic when debugging assertions are enabled if the buffer and plan have mismatched properties.
fn shape_with_plan( &self, plan: &ShapePlan, buffer: UnicodeBuffer, options: ShapeOptions<'_>, ) -> GlyphBuffer
pub(crate) fn glyph_names(&self) -> GlyphNames<'a>
pub(crate) fn glyph_metrics(&self) -> GlyphMetrics<'a>
pub(crate) fn layout_table( &self, table_index: TableIndex, ) -> Option<LayoutTable<'a>>
pub(crate) fn layout_tables( &self, ) -> impl Iterator<Item = (TableIndex, LayoutTable<'a>)> + '_
Trait Implementations§
Source§impl SerializerFont for Shaper<'_>
impl SerializerFont for Shaper<'_>
fn coords(&self) -> &[F2Dot14]
fn glyph_names(&self) -> GlyphNames<'_>
fn glyph_metrics(&self) -> GlyphMetrics<'_>
Auto Trait Implementations§
impl<'a> Freeze for hb_font_t<'a>
impl<'a> !RefUnwindSafe for hb_font_t<'a>
impl<'a> Send for hb_font_t<'a>
impl<'a> Sync for hb_font_t<'a>
impl<'a> Unpin for hb_font_t<'a>
impl<'a> UnsafeUnpin for hb_font_t<'a>
impl<'a> !UnwindSafe for hb_font_t<'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