Namespace CliProc

The namespace CliProc contains programmatic implementations of various CLI functionality.

Consolidation

Function CliProc.consolidateFont<GS extends Ot.GlyphStore>(font:Ot.Font<GS>):​void

Consolidates the font, including:

  • Cleanup all the data references to glyphs not present in font's glyph set.
  • Cleanup fonts' OTL tables, like merging identical feature records under same language.

Garbage Collection

Function CliProc.gcFont<GS extends Ot.GlyphStore>(font:Ot.Font<GS>,​gsf:Ot.GlyphStoreFactory<GS>):​void

Reduces the font's glyph set to all glyphs accessible.

Subsetting

Function CliProc.subsetFont<GS extends Ot.GlyphStore>(font:Ot.Font<GS>,​text:Iterable<string>,​gsf:Ot.GlyphStoreFactory<GS>):​void

Reduces the font's glyph set to all glyphs accessible from text.

Font Merging

Function CliProc.mergeFonts<GS1 extends Ot.GlyphStore,​GS2 extends Ot.GlyphStore>(basis:Ot.Font<GS1>,​override:Ot.Font<GS2>,​gsf:Ot.GlyphStoreFactory<GS1>,​options?:CliProc.MergeOptions)

Create a combined font override into font basis, which will have a new glyph store and new cmap, GSUB, GPOS and GDEF tables. The remaining tables will be shared with basis.

DataType CliProc.MergeOptions

Members

  • preferOverride?:​boolean

    When set, the character mapping and OTL will prefer the mapping in override over basis.

Changing UPM

Function CliProc.rebaseFont<GS extends Ot.GlyphStore>(font:Ot.Font<GS>,​newUpm:number):​void

Reduces the font's units-per-em value to newUpm.

Unify Design Space

Function CliProc.unifyDesignSpaces<GS extends Ot.GlyphStore>(fonts:Ot.Font<GS>[]):​void

Unify the design space of the input when they are compatible; Otherwise raise error.

Glyph Set Sharing

Function CliProc.shareGlyphSet<GS extends Ot.GlyphStore>(fonts:Ot.Font<GS>[],​gsf:Ot.GlyphStoreFactory<GS>,​options?:CliProc.ShareGlyphSetOptions):​void

Unify the glyph set by glyph shape. This procedure is usually used when creating TTC files from TTF files.

DataType CliProc.ShareGlyphSetOptions

Members

  • unifyGlyphList?:​boolean

    Whether to make the glyph list the same. When set to false, only the glyph references will be unified.

Glyph Geometry Transformation

Function CliProc.inPlaceTransformFontGlyph<GS extends Ot.GlyphStore>(fonts:Ot.Font<GS>[],​transform:Ot.Glyph.Transform2X3):​void

Perform a 2x3 affine transform on all glyphs' geometries. Composite glyphs will get flatten.

Function CliProc.inPlaceTransformFontGlyphDependent<GS extends Ot.GlyphStore>(fonts:Ot.Font<GS>[],​transformF:(glyph:Ot.Glyph)=>Ot.Glyph.Transform2X3):​void

Perform a 2x3 affine transform on all glyphs' geometries. The transform may depend on the glyph's content. Composite glyphs will get flatten.