pub struct Table<'a> {
table_data: &'a [u8],
strings: Index<'a>,
global_subrs: Index<'a>,
charset: Charset<'a>,
number_of_glyphs: NonZeroU16,
matrix: Matrix,
char_strings: Index<'a>,
kind: FontKind<'a>,
}
Expand description
Fields§
§table_data: &'a [u8]
§strings: Index<'a>
§global_subrs: Index<'a>
§charset: Charset<'a>
§number_of_glyphs: NonZeroU16
§matrix: Matrix
§char_strings: Index<'a>
§kind: FontKind<'a>
Implementations§
source§impl<'a> Table<'a>
impl<'a> Table<'a>
sourcepub fn number_of_glyphs(&self) -> u16
pub fn number_of_glyphs(&self) -> u16
Returns a total number of glyphs in the font.
Never zero.
sourcepub fn outline(
&self,
glyph_id: GlyphId,
builder: &mut dyn OutlineBuilder,
) -> Result<Rect, CFFError>
pub fn outline( &self, glyph_id: GlyphId, builder: &mut dyn OutlineBuilder, ) -> Result<Rect, CFFError>
Outlines a glyph.
sourcepub fn glyph_index(&self, code_point: u8) -> Option<GlyphId>
pub fn glyph_index(&self, code_point: u8) -> Option<GlyphId>
Resolves a Glyph ID for a code point.
Similar to Face::glyph_index
but 8bit
and uses CFF encoding and charset tables instead of TrueType cmap
.
sourcepub fn glyph_width(&self, glyph_id: GlyphId) -> Option<u16>
pub fn glyph_width(&self, glyph_id: GlyphId) -> Option<u16>
Returns a glyph width.
This value is different from outline bbox width and is stored separately.
Technically similar to Face::glyph_hor_advance
.
sourcepub fn glyph_index_by_name(&self, name: &str) -> Option<GlyphId>
pub fn glyph_index_by_name(&self, name: &str) -> Option<GlyphId>
Returns a glyph ID by a name.
sourcepub fn glyph_name(&self, glyph_id: GlyphId) -> Option<&'a str>
pub fn glyph_name(&self, glyph_id: GlyphId) -> Option<&'a str>
Returns a glyph name.
Trait Implementations§
impl<'a> Copy for Table<'a>
Auto Trait Implementations§
impl<'a> Freeze for Table<'a>
impl<'a> RefUnwindSafe for Table<'a>
impl<'a> Send for Table<'a>
impl<'a> Sync for Table<'a>
impl<'a> Unpin for Table<'a>
impl<'a> UnwindSafe for Table<'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