Namespace FontIo
IO Procedures
FontIo.readFont<GS extends Data.Order<Ot.Glyph>>(sfnt,gsf,config?):Ot.Font<GS>
Creates a Ot.Font form a Ot.Sfnt. The parameter gsf
is used to provide the glyph store factory to create the glyph store. When using with Ot.ListGlyphStore, Ot.ListGlyphStoreFactory is recommended to be provided for gsf
parameter.
FontIo.writeFont<GS extends Data.Order<Ot.Glyph>>(font,config?):Ot.Sfnt
Creates a Ot.Sfnt form a Ot.Font.
FontIo.readSfntOtf(buffer:Buffer):Ot.Sfnt
Creates a Ot.Sfnt form a Buffer.
FontIo.writeSfntOtf(sfnt:Ot.Sfnt):Buffer
Creates a Buffer form a Ot.Sfnt.
FontIo.writeSfntOtfFromTableSlices(sfnt:FontIo.TableSliceCollection):Buffer
Creates a Buffer form a Ot.TableSliceCollection.
FontIo.readSfntTtc(buffer:Buffer):Ot.Sfnt[]
Creates a Ot.Sfnt array form a Buffer representing a TTC file.
FontIo.writeSfntTtc(sfnt:Ot.Sfnt[]):Buffer
Creates a TTC file Buffer form a Ot.Sfnt array.
FontIo.writeSfntTtcFromTableSlices(sfnt:Ot.TableSliceCollection[]):Buffer
Creates a TTC file Buffer form a FontIo.TableSliceCollection array.
Table Slice Collection
Datatype FontIo.TableSliceCollection
Properties
- readonly version:number
- tables:Map<Tag,FontIo.TableSlice>
Datatype FontIo.TableSlice
Properties
IO Configuration
Datatype FontIo.FontIoConfig
Members
-
-
statOs2XAvgCharWidth?:boolean
Whether to recalculate
xAvgCharWidth
property inOS/2
table when writing fonts. Defaults totrue
.
-
statOs2XAvgCharWidth?:boolean
-
cff?:
-
doLocalOptimization?:boolean
Whether to perform local optimization when writing the
CFF
/CFF2
table. Defaults totrue
. -
doGlobalOptimization?:boolean
Whether to perform global optimization when writing the
CFF
/CFF2
table. Defaults totrue
.
-
doLocalOptimization?:boolean
-
ttf?:
-
gvarOptimizeTolerance?:boolean
The error tolerance when writing the
gvar
table. Defaults to1/128
. With higher tolerance thegvar
table writer would do more aggressive IUP optimization. -
gvarForceProduceGVD?:boolean
When building
gvar
, force production of glyph variation data, even if the glyph has no variation. -
gvarForceZeroGapsBetweenGVD?:boolean
When building
gvar
, force a 4-byte zero gap between each glyph variation data.
-
gvarOptimizeTolerance?:boolean
-
encoding?:
-
statOs2UnicodeRanges?:boolean
Whether to recalculate
ulUnicodeRange1
...ulUnicodeRange4
property inOS/2
table when writing fonts. Defaults totrue
. -
forceCmapSubtableFormatToBePresent?:boolean
Whether to force a
cmap
format 4 subtable to be present even if it is empty or non-buildable (i.e. when all characters are mapped to exactly the same glyph). Under those situations, a “stub”cmap
format 4 subtable containing no mapping will be created. Defaults totrue
.
-
statOs2UnicodeRanges?:boolean
-
-
namer?:Ot.GlyphNamer
The glyph namer. Defaults to Ot.StandardOtGlyphNamer.
-
namer?:Ot.GlyphNamer
-
layout?:
- gdefWriteTrick?:number
-
lookupWriteTricks?:Map<Ot.GsubGpos.LookupProp,number>
Specific options to control writing behavior when writing
GDEF
table, andGSUB
/GPOS
lookups, to provide platform-specific optimizations. The number is a flag-field and could be assigned as:0x0001
: Avoid lookup being lifted as an extension lookup;0x0002
: Force single substitution and single position lookups to form one single subtable;0x0004
: Force lookups to use flat (format 1) coverage table;0x0008
: Force lookups to use coverage tables and class-def tables with less items instead of smaller footprint;0x0010
: Force contextual lookups to become chaining (could be used to workaround certain Apple shaping engine's bugs);
-
-
processExtPrivateTable?:boolean
Whether process the Extensible Privates Table (
XPRV
). Defaults totrue
.
-
processExtPrivateTable?:boolean
-
-
processVttPrivateTables?:boolean
Whether process the VTT private data tables (TSI-tables). Defaults to
true
. -
recalculatePseudoInstructions?:boolean
Whether recalculate composite glyphs’ pseudo-instructions. Defaults to
true
.
-
processVttPrivateTables?:boolean
-
generateDummyDigitalSignature?:boolean
Whether generate an 8-byte dummy digital signature (
DSIG
table) to the final SFNT.