Ot.Font

Font Type

Datatype Ot.Font<GS extends Data.OrderStore<Ot.Glyph> = Data.OrderStore<Ot.Glyph>>

Type Parameter Requirements

The type Ot.Font is generic, and it supports any glyph store types (GS) that can decide an order of glyphs (Data.Order<Ot.Glyph>) by implementing Data.OrderStore<Ot.Glyph>.

A pre-supplied implementation is Ot.ListGlyphStore. The factory creating Ot.ListGlyphStore's is Ot.ListGlyphStoreFactory.

When the GS parameter is absent, it will default to Data.OrderStore<Ot.Glyph>.

An Ot.Font<GS> could be either Ot.Font.Cff<GS> or Ot.Font.Ttf<GS>, depending on whether the cff property exists. When present, the font is considered CFF. Utility functions Ot.Font.isCff and Ot.Font.isTtf could be used to detect the types.

Members

Type Ot.Font.Cff<GS extends Data.OrderStore<Ot.Glyph> = Data.OrderStore<Ot.Glyph>>

CFF variant of Ot.Font<GS>. The property cff is guaranteed to be present.

Type Ot.Font.Ttf<GS extends Data.OrderStore<Ot.Glyph> = Data.OrderStore<Ot.Glyph>>

TrueType variant of Ot.Font<GS>. Properties fpgm, prep and cvt may present.

Utility functions

Function Ot.Font.isCff<GS extends Data.Order<Ot.Glyph>>(font:Ot.Font<GS>):​font is Ot.Font.Cff<GS>

Detects whether font is a CFF font.

Function Ot.Font.isTtf<GS extends Data.Order<Ot.Glyph>>(font:Ot.Font<GS>):​font is Ot.Font.Ttf<GS>

Detects whether font is a TrueType font.