Struct ab_glyph::FontVec[][src]

pub struct FontVec(_);
Expand description

Font data handle stored in a Vec<u8> + parsed data. See Font for more methods.

Also see FontRef.

Example

use ab_glyph::{Font, FontVec};

let font = FontVec::try_from_vec_and_index(owned_font_data, 0)?;

assert_eq!(font.glyph_id('s'), ab_glyph::GlyphId(56));

Implementations

Creates an FontVec from owned data.

For font collections see FontVec::try_from_vec_and_index.

Example
let font = FontVec::try_from_vec(owned_font_data)?;

Creates an FontVec from owned data.

You can set index for font collections. For simple fonts use 0 or FontVec::try_from_vec.

Example
let font = FontVec::try_from_vec_and_index(owned_font_data, 0)?;

Trait Implementations

Formats the value using the given formatter. Read more

Get the size of the font unit Read more

Unscaled glyph ascent. Read more

Unscaled glyph descent. Read more

Unscaled line gap. Read more

Lookup a GlyphId matching a given char. Read more

Unscaled horizontal advance for a given glyph id. Read more

Unscaled horizontal side bearing for a given glyph id. Read more

Unscaled vertical advance for a given glyph id. Read more

Unscaled vertical side bearing for a given glyph id. Read more

Returns additional unscaled kerning to apply for a particular pair of glyph ids. Read more

Compute unscaled glyph outline curves & bounding box.

The number of glyphs present in this font. Glyph identifiers for this font will always be in the range 0..self.glyph_count() Read more

Returns an iterator of all distinct (GlyphId, char) pairs. Not ordered. Read more

Returns a pre-rendered image of the glyph. Read more

Unscaled height ascent - descent. Read more

Returns the layout bounds of this glyph. These are different to the outline px_bounds(). Read more

Compute glyph outline ready for drawing.

Construct a PxScaleFontRef by associating with the given pixel scale. Read more

Move into a PxScaleFont associated with the given pixel scale. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.