pub struct Post<'a> { /* private fields */ }Expand description
post (PostScript) table
Implementations§
Source§impl<'a> Post<'a>
impl<'a> Post<'a>
pub const MIN_SIZE: usize
Sourcepub fn resolve_offset<O: Offset, R: FontRead<'a, Args = ()>>(
&self,
offset: O,
) -> Result<R, ReadError>
pub fn resolve_offset<O: Offset, R: FontRead<'a, Args = ()>>( &self, offset: O, ) -> Result<R, ReadError>
Resolve the provided offset from the start of this table.
Sourcepub fn offset_data(&self) -> FontData<'a>
pub fn offset_data(&self) -> FontData<'a>
Return a reference to this table’s raw data.
We use this in the compile crate to resolve offsets.
Sourcepub fn shape(&self) -> &Self
👎Deprecated: just use the base type directly
pub fn shape(&self) -> &Self
just use the base type directly
Return a reference to the table’s ‘Shape’ struct.
This is a low level implementation detail, but it can be useful in some cases where you want to know things about a table’s layout, such as the byte offsets of specific fields.
Sourcepub fn version(&self) -> Version16Dot16
pub fn version(&self) -> Version16Dot16
0x00010000 for version 1.0 0x00020000 for version 2.0 0x00025000 for version 2.5 (deprecated) 0x00030000 for version 3.0
Sourcepub fn italic_angle(&self) -> Fixed
pub fn italic_angle(&self) -> Fixed
Italic angle in counter-clockwise degrees from the vertical. Zero for upright text, negative for text that leans to the right (forward).
Sourcepub fn underline_position(&self) -> FWord
pub fn underline_position(&self) -> FWord
This is the suggested distance of the top of the underline from the baseline (negative values indicate below baseline). The PostScript definition of this FontInfo dictionary key (the y coordinate of the center of the stroke) is not used for historical reasons. The value of the PostScript key may be calculated by subtracting half the underlineThickness from the value of this field.
Sourcepub fn underline_thickness(&self) -> FWord
pub fn underline_thickness(&self) -> FWord
Suggested values for the underline thickness. In general, the underline thickness should match the thickness of the underscore character (U+005F LOW LINE), and should also match the strikeout thickness, which is specified in the OS/2 table.
Sourcepub fn is_fixed_pitch(&self) -> u32
pub fn is_fixed_pitch(&self) -> u32
Set to 0 if the font is proportionally spaced, non-zero if the font is not proportionally spaced (i.e. monospaced).
Sourcepub fn min_mem_type42(&self) -> u32
pub fn min_mem_type42(&self) -> u32
Minimum memory usage when an OpenType font is downloaded.
Sourcepub fn max_mem_type42(&self) -> u32
pub fn max_mem_type42(&self) -> u32
Maximum memory usage when an OpenType font is downloaded.
Sourcepub fn min_mem_type1(&self) -> u32
pub fn min_mem_type1(&self) -> u32
Minimum memory usage when an OpenType font is downloaded as a Type 1 font.
Sourcepub fn max_mem_type1(&self) -> u32
pub fn max_mem_type1(&self) -> u32
Maximum memory usage when an OpenType font is downloaded as a Type 1 font.
Sourcepub fn num_glyphs(&self) -> Option<u16>
pub fn num_glyphs(&self) -> Option<u16>
Number of glyphs (this should be the same as numGlyphs in ‘maxp’ table).
Sourcepub fn glyph_name_index(&self) -> Option<&'a [BigEndian<u16>]>
pub fn glyph_name_index(&self) -> Option<&'a [BigEndian<u16>]>
Array of indices into the string data. See below for details.
Sourcepub fn string_data(&self) -> Option<VarLenArray<'a, PString<'a>>>
pub fn string_data(&self) -> Option<VarLenArray<'a, PString<'a>>>
Storage for the string data.
pub fn version_byte_range(&self) -> Range<usize> ⓘ
pub fn italic_angle_byte_range(&self) -> Range<usize> ⓘ
pub fn underline_position_byte_range(&self) -> Range<usize> ⓘ
pub fn underline_thickness_byte_range(&self) -> Range<usize> ⓘ
pub fn is_fixed_pitch_byte_range(&self) -> Range<usize> ⓘ
pub fn min_mem_type42_byte_range(&self) -> Range<usize> ⓘ
pub fn max_mem_type42_byte_range(&self) -> Range<usize> ⓘ
pub fn min_mem_type1_byte_range(&self) -> Range<usize> ⓘ
pub fn max_mem_type1_byte_range(&self) -> Range<usize> ⓘ
pub fn num_glyphs_byte_range(&self) -> Range<usize> ⓘ
pub fn glyph_name_index_byte_range(&self) -> Range<usize> ⓘ
pub fn string_data_byte_range(&self) -> Range<usize> ⓘ
Source§impl<'a> Post<'a>
impl<'a> Post<'a>
Sourcepub fn glyph_name(&self, glyph_id: GlyphId16) -> Option<&'a str>
pub fn glyph_name(&self, glyph_id: GlyphId16) -> Option<&'a str>
Returns the name for the given glyph.
Note that this is a relatively expensive operation, as it may require
a linear scan through the string data to find the target name. If you
need to iterate over all glyph names or collect them into a map for
faster access, use Self::glyph_names instead.
Sourcepub fn glyph_names(&self) -> GlyphNames<'a> ⓘ
pub fn glyph_names(&self) -> GlyphNames<'a> ⓘ
Return an iterator over the glyph names in this table.