pub struct GlyfTable<'a> {
    pub records: Vec<GlyfRecord<'a>>,
}
Expand description

Fields

records: Vec<GlyfRecord<'a>>

Implementations

Returns a copy of this table that only contains the glyphs specified by glyph_ids.

Returns a parsed glyph if present. Returns None if the GlyfRecord is Empty.

Trait Implementations

Formats the value using the given formatter. Read more
Visit the glyph outlines in self.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Write this glyf table into ctxt.

A Note About Padding

On the loca table documentation at the bottom it states:

Note that the local offsets should be 32-bit aligned. Offsets which are not 32-bit aligned may seriously degrade performance of some processors.

On the Recommendations for OpenType Fonts page it states:

We recommend that local offsets should be 16-bit aligned, in both the short and long formats of this table.

On Apple’s loca documentation it says:

The glyph data is always word aligned.

Elsewhere in the Apple docs they refer to long as 32-bits, so assuming word here means 16-bits.

An issue was raised against Microsoft’s docs regarding this. Behdad Esfahbod commented:

All the requirements should be removed since 2019.

In reality, in the short format, you are forced to do 16-bit alignment because of how offsets are stored. In the long format, use alignment 1. We’ve been doing that in fonttools for years and never ever heard a complaint whatsoever.

So with this in mind we implement 16-bit alignment when index_to_loc_format is 0, and no alignment/padding otherwise.

The type of the value returned by write_dep.
The type of the arguments supplied to write_dep.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.