package tables
Import Path
github.com/go-text/typesetting/font/opentype/tables (on go.dev)
Dependency Relation
imports 9 packages, and imported by 4 packages
Involved Source Files
aat_ankr_gen.go
aat_ankr_src.go
aat_common.go
aat_feat_gen.go
aat_feat_src.go
aat_kerx_gen.go
aat_kerx_src.go
aat_ltag_gen.go
aat_ltag_src.go
aat_mortx_gen.go
aat_mortx_src.go
aat_properties.go
aat_trak_gen.go
aat_trak_src.go
cmap_gen.go
cmap_src.go
glyphs.go
glyphs_bitmap_gen.go
glyphs_bitmap_src.go
glyphs_colr_gen.go
glyphs_colr_src.go
glyphs_cpal_gen.go
glyphs_cpal_src.go
glyphs_glyf_gen.go
glyphs_glyf_src.go
glyphs_misc_gen.go
glyphs_misc_src.go
glyphs_sbix_gen.go
glyphs_sbix_src.go
head_gen.go
head_src.go
hhea_vhea_gen.go
hhea_vhea_src.go
hmtx_vmtx_gen.go
hmtx_vmtx_src.go
kern.go
kern_gen.go
kern_src.go
maxp_gen.go
maxp_src.go
name_gen.go
name_src.go
os2_gen.go
os2_src.go
ot_gdef_gen.go
ot_gdef_src.go
ot_gpos_gen.go
ot_gpos_src.go
ot_gsub_gen.go
ot_gsub_src.go
ot_layout.go
ot_layout_gen.go
ot_layout_src.go
ot_properties.go
post_gen.go
post_src.go
tables.go
xvar_gen.go
xvar_src.go
Package-Level Type Names (total 353)
// Complement of flags for the settings that this feature and setting disable.
// Flags for the settings that this feature and setting enables.
FeatureSetting uint16
FeatureType uint16
// Circumstances under which this table is used.
// The tuple count. This value is only used with variation fonts and should be 0 for all other fonts. The subtable's tupleCount will be ignored if the 'kerx' table version is less than 4.
( AATKernSubtableHeader) Data() KernData
AATKernSubtableHeader : KernSubtable
func ParseAATKernSubtableHeader(src []byte) (AATKernSubtableHeader, int, error)
AATLookup is conceptually a map[GlyphID]uint16, but it may
be implemented more efficiently.
Class returns the class ID for the provided glyph, or (0, false)
for glyphs not covered by this class.
Returns 0 if not supported
Coverage returns the glyphs covered by this lookup as
a list of inclusive ranges
AATLoopkup0
AATLoopkup10
AATLoopkup2
AATLoopkup4
AATLoopkup6
AATLoopkup8
AATLookup : AatLookupMixed
func ParseAATLookup(src []byte, valuesCount int) (AATLookup, int, error)
AATLookupExt is the same as AATLookup, but class values are uint32
Class returns the class ID for the provided glyph, or (0, false)
for glyphs not covered by this class.
Returns 0 if not supported
Coverage returns the glyphs covered by this lookup as
a list of inclusive ranges
AATLoopkupExt0
AATLoopkupExt10
AATLoopkupExt2
AATLoopkupExt4
AATLoopkupExt6
AATLoopkupExt8
AATLookupExt : AatLookupMixed
func ParseAATLookupExt(src []byte, valuesCount int) (AATLookupExt, int, error)
Returns 0 if not supported
Coverage returns the glyphs covered by this lookup as
a list of inclusive ranges
AATLookup (interface)
AATLookupExt (interface)
AATLoopkup0
AATLoopkup10
AATLoopkup2
AATLoopkup4
AATLoopkup6
AATLoopkup8
AATLoopkupExt0
AATLoopkupExt10
AATLoopkupExt2
AATLoopkupExt4
AATLoopkupExt6
AATLoopkupExt8
FirstGlyph GlyphID
LastGlyph GlyphID
offset to an array of []uint16 (or []uint32 for extended) with length last - first + 1
func ParseAATLookupRecord4(src []byte, parentSrc []byte) (AATLookupRecord4, int, error)
Values []uint16
( AATLoopkup0) Class(g GlyphID) (uint16, bool)
( AATLoopkup0) ClassUint32(g GlyphID) uint32
( AATLoopkup0) Coverage() [][2]GlyphID
AATLoopkup0 : AATLookup
AATLoopkup0 : AatLookupMixed
func ParseAATLoopkup0(src []byte, valuesCount int) (AATLoopkup0, int, error)
FirstGlyph GlyphID
Values []uint16
( AATLoopkup10) Class(g GlyphID) (uint16, bool)
( AATLoopkup10) ClassUint32(g GlyphID) uint32
( AATLoopkup10) Coverage() [][2]GlyphID
AATLoopkup10 : AATLookup
AATLoopkup10 : AatLookupMixed
func ParseAATLoopkup10(src []byte) (AATLoopkup10, int, error)
Records []LookupRecord2
( AATLoopkup2) Class(g GlyphID) (uint16, bool)
( AATLoopkup2) ClassUint32(g GlyphID) uint32
( AATLoopkup2) Coverage() [][2]GlyphID
AATLoopkup2 : AATLookup
AATLoopkup2 : AatLookupMixed
func ParseAATLoopkup2(src []byte) (AATLoopkup2, int, error)
Do not include the termination segment
( AATLoopkup4) Class(g GlyphID) (uint16, bool)
( AATLoopkup4) ClassUint32(g GlyphID) uint32
( AATLoopkup4) Coverage() [][2]GlyphID
AATLoopkup4 : AATLookup
AATLoopkup4 : AatLookupMixed
func ParseAATLoopkup4(src []byte) (AATLoopkup4, int, error)
Records []loopkupRecord6
( AATLoopkup6) Class(g GlyphID) (uint16, bool)
( AATLoopkup6) ClassUint32(g GlyphID) uint32
( AATLoopkup6) Coverage() [][2]GlyphID
AATLoopkup6 : AATLookup
AATLoopkup6 : AatLookupMixed
func ParseAATLoopkup6(src []byte) (AATLoopkup6, int, error)
AATLoopkup8Data AATLoopkup8Data
AATLoopkup8Data.FirstGlyph GlyphID
AATLoopkup8Data.Values []uint16
( AATLoopkup8) Class(g GlyphID) (uint16, bool)
( AATLoopkup8) ClassUint32(g GlyphID) uint32
( AATLoopkup8) Coverage() [][2]GlyphID
AATLoopkup8 : AATLookup
AATLoopkup8 : AatLookupMixed
func ParseAATLoopkup8(src []byte) (AATLoopkup8, int, error)
FirstGlyph GlyphID
Values []uint16
( AATLoopkup8Data) Class(g GlyphID) (uint16, bool)
func ParseAATLoopkup8Data(src []byte) (AATLoopkup8Data, int, error)
Values []uint32
( AATLoopkupExt0) Class(g GlyphID) (uint32, bool)
( AATLoopkupExt0) ClassUint32(g GlyphID) uint32
( AATLoopkupExt0) Coverage() [][2]GlyphID
AATLoopkupExt0 : AATLookupExt
AATLoopkupExt0 : AatLookupMixed
func ParseAATLoopkupExt0(src []byte, valuesCount int) (AATLoopkupExt0, int, error)
FirstGlyph GlyphID
Values []uint32
( AATLoopkupExt10) Class(g GlyphID) (uint32, bool)
( AATLoopkupExt10) ClassUint32(g GlyphID) uint32
( AATLoopkupExt10) Coverage() [][2]GlyphID
AATLoopkupExt10 : AATLookupExt
AATLoopkupExt10 : AatLookupMixed
func ParseAATLoopkupExt10(src []byte) (AATLoopkupExt10, int, error)
Records []lookupRecordExt2
( AATLoopkupExt2) Class(g GlyphID) (uint32, bool)
( AATLoopkupExt2) ClassUint32(g GlyphID) uint32
( AATLoopkupExt2) Coverage() [][2]GlyphID
AATLoopkupExt2 : AATLookupExt
AATLoopkupExt2 : AatLookupMixed
func ParseAATLoopkupExt2(src []byte) (AATLoopkupExt2, int, error)
the values pointed by the record are uint32
( AATLoopkupExt4) Class(g GlyphID) (uint32, bool)
( AATLoopkupExt4) ClassUint32(g GlyphID) uint32
( AATLoopkupExt4) Coverage() [][2]GlyphID
AATLoopkupExt4 : AATLookupExt
AATLoopkupExt4 : AatLookupMixed
func ParseAATLoopkupExt4(src []byte) (AATLoopkupExt4, int, error)
Records []loopkupRecordExt6
( AATLoopkupExt6) Class(g GlyphID) (uint32, bool)
( AATLoopkupExt6) ClassUint32(g GlyphID) uint32
( AATLoopkupExt6) Coverage() [][2]GlyphID
AATLoopkupExt6 : AATLookupExt
AATLoopkupExt6 : AatLookupMixed
func ParseAATLoopkupExt6(src []byte) (AATLoopkupExt6, int, error)
AATLoopkup8Data AATLoopkup8Data
AATLoopkup8Data.FirstGlyph GlyphID
AATLoopkup8Data.Values []uint16
( AATLoopkupExt8) Class(g GlyphID) (uint32, bool)
( AATLoopkupExt8) ClassUint32(g GlyphID) uint32
( AATLoopkupExt8) Coverage() [][2]GlyphID
AATLoopkupExt8 : AATLookupExt
AATLoopkupExt8 : AatLookupMixed
func ParseAATLoopkupExt8(src []byte) (AATLoopkupExt8, int, error)
AATStateEntry is shared between old and extended state tables,
and between the different kind of entries.
See the various AsXXX() methods.
// Table specific.
NewState uint16
AsKernxIndex reads the internal data for entries in 'kern/x' subtable format 1 or 4.
An entry with no index returns 0xFFFF
AsMorxContextual reads the internal data for entries in morx contextual subtable.
The returned indexes use 0xFFFF as empty value.
AsMorxInsertion reads the internal data for entries in morx insertion subtable.
The returned indexes use 0xFFFF as empty value.
AsMorxLigature reads the internal data for entries in morx ligature subtable.
func github.com/go-text/typesetting/font.(*AATStateTable).GetEntry(state, class uint16) AATStateEntry
State table header, without the actual data
See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6Tables.html
// Byte offset from the beginning of the state table to the class subtable.
// entry data are empty
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
States [][]uint8
func ParseAATStateTable(src []byte) (AATStateTable, int, error)
Extended state table, including the data
See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6Tables.html - State tables
binarygen: argument=entryDataSize int
// Byte offset from the beginning of the state table to the class subtable.
// length is the maximum state + 1
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
// each sub array has length stateSize
func ParseAATStateTableExt(src []byte, valuesCount int, entryDataSize int) (AATStateTableExt, int, error)
// Translation in x direction.
// Translation in y direction.
// x-component of transformed x-basis vector.
// x-component of transformed y-basis vector.
// y-component of transformed x-basis vector.
// y-component of transformed y-basis vector.
func ParseAffine2x3(src []byte) (Affine2x3, int, error)
// Array of alternate glyph IDs, in arbitrary order
func ParseAlternateSet(src []byte) (AlternateSet, int, error)
AlternateSets []AlternateSet
// Offset to Coverage table, from beginning of substitution subtable
( AlternateSubs) Cov() Coverage
AlternateSubs : GSUBLookup
func ParseAlternateSubs(src []byte) (AlternateSubs, int, error)
AnchorFormat1
AnchorFormat2
AnchorFormat3
func ParseAnchor(src []byte) (Anchor, int, error)
func AnchorMatrix.Anchor(index, class int) Anchor
// Horizontal value, in design units
// Vertical value, in design units
AnchorFormat1 : Anchor
func ParseAnchorFormat1(src []byte) (AnchorFormat1, int, error)
// Index to glyph contour point
// Horizontal value, in design units
// Vertical value, in design units
AnchorFormat2 : Anchor
func ParseAnchorFormat2(src []byte) (AnchorFormat2, int, error)
// Horizontal value, in design units
// Offset to Device table (non-variable font) / VariationIndex table (variable font) for X coordinate, from beginning of Anchor table (may be NULL)
// Vertical value, in design units
// Offset to Device table (non-variable font) / VariationIndex table (variable font) for Y coordinate, from beginning of Anchor table (may be NULL)
AnchorFormat3 : Anchor
func ParseAnchorFormat3(src []byte) (AnchorFormat3, int, error)
AnchorMatrix is a compact representation of a [][]Anchor
( AnchorMatrix) Anchor(index, class int) Anchor
( AnchorMatrix) Len() int
func BaseArray.Anchors() AnchorMatrix
func LigatureAttach.Anchors() AnchorMatrix
func Mark2Array.Anchors() AnchorMatrix
Ankr is the anchor point table
See - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ankr.html
GetAnchor return the i-th anchor for `glyph`, or {0,0} if not found.
func ParseAnkr(src []byte, valuesCount int) (Ankr, int, error)
AnkrAnchor is a point within the coordinate space of a given glyph
independent of the control points used to render the glyph
X int16
Y int16
func ParseAnkrAnchor(src []byte) (AnkrAnchor, int, error)
func Ankr.GetAnchor(glyph GlyphID, index int) (anchor AnkrAnchor)
// [glyphCount] Array of offsets to AttachPoint tables-from beginning of AttachList table-in Coverage Index order
// Offset to Coverage table - from beginning of AttachList table
func ParseAttachList(src []byte) (AttachList, int, error)
// [pointCount] Array of contour point indices -in increasing numerical order
func ParseAttachPoint(src []byte) (AttachPoint, int, error)
avar — Axis Variations Table
// [axisCount] The segment maps array — one segment map for each axis, in the order of axes specified in the 'fvar' table.
func ParseAvar(src []byte) (Avar, int, error)
// The name ID for entries in the 'name' table that provide a display string for this axis.
// A value that applications can use to determine primary sorting of face names, or for ordering of labels when composing family or face names.
// A tag identifying the axis of design variation.
AxisValue1
AxisValue2
AxisValue3
AxisValue4
func ParseAxisValue(src []byte) (AxisValue, int, error)
AxisValue1 : AxisValue
func ParseAxisValue1(src []byte) (AxisValue1, int, error)
AxisValue2 : AxisValue
func ParseAxisValue2(src []byte) (AxisValue2, int, error)
AxisValue3 : AxisValue
func ParseAxisValue3(src []byte) (AxisValue3, int, error)
AxisValue4 : AxisValue
func ParseAxisValue4(src []byte) (AxisValue4, int, error)
// Offset in bytes from the beginning of the STAT table to the start of the design axes value offsets array. If axisValueCount is zero, set to zero; if axisValueCount is greater than zero, must be greater than zero.
func ParseAxisValueArray(src []byte, valuesCount int) (AxisValueArray, int, error)
// A normalized coordinate value obtained using default normalization.
// The modified, normalized coordinate value.
type AxisValueRecord (struct)
( BaseArray) Anchors() AnchorMatrix
func ParseBaseArray(src []byte, offsetsCount int) (BaseArray, int, error)
SmallGlyphMetrics SmallGlyphMetrics
// Horizontal advance width in pixels.
// Distance in pixels from the horizontal origin to the left edge of the bitmap.
// Distance in pixels from the horizontal origin to the top edge of the bitmap.
// Number of rows of data.
// Number of columns of data.
Format 17: small metrics, PNG image data
Image []byte
SmallGlyphMetrics SmallGlyphMetrics
// Horizontal advance width in pixels.
// Distance in pixels from the horizontal origin to the left edge of the bitmap.
// Distance in pixels from the horizontal origin to the top edge of the bitmap.
// Number of rows of data.
// Number of columns of data.
func ParseBitmapData17(src []byte) (BitmapData17, int, error)
Format 18: big metrics, PNG image data
BigGlyphMetrics BigGlyphMetrics
BigGlyphMetrics.SmallGlyphMetrics SmallGlyphMetrics
// Horizontal advance width in pixels.
// Distance in pixels from the horizontal origin to the left edge of the bitmap.
// Distance in pixels from the horizontal origin to the top edge of the bitmap.
// Number of rows of data.
// Number of columns of data.
Image []byte
func ParseBitmapData18(src []byte) (BitmapData18, int, error)
Format 19: metrics in CBLC table, PNG image data
Image []byte
func ParseBitmapData19(src []byte) (BitmapData19, int, error)
Format 2: small metrics, bit-aligned data
Image []byte
SmallGlyphMetrics SmallGlyphMetrics
// Horizontal advance width in pixels.
// Distance in pixels from the horizontal origin to the left edge of the bitmap.
// Distance in pixels from the horizontal origin to the top edge of the bitmap.
// Number of rows of data.
// Number of columns of data.
func ParseBitmapData2(src []byte) (BitmapData2, int, error)
Format 5: metrics in CBLC table, bit-aligned image data only
Image []byte
func ParseBitmapData5(src []byte) (BitmapData5, int, error)
// The actual embedded graphic data. The total length is inferred from sequential entries in the glyphDataOffsets array and the fixed size (8 bytes) of the preceding fields.
// Indicates the format of the embedded graphic data: one of 'jpg ', 'png ' or 'tiff', or the special format 'dupe'.
// The horizontal (x-axis) position of the left edge of the bitmap graphic in relation to the glyph design space origin.
// The vertical (y-axis) position of the bottom edge of the bitmap graphic in relation to the glyph design space origin.
func ParseBitmapGlyphData(src []byte) (BitmapGlyphData, int, error)
// Line metrics for text rendered horizontally.
// Horizontal pixels per em.
// Vertical pixels per em.
// Line metrics for text rendered vertically.
// First glyph ID of this range.
IndexSubHeader IndexSubHeader
// Offset to image data in EBDT table.
// Format of EBDT image data.
IndexSubHeader.IndexData IndexData
// Last glyph ID of this range (inclusive).
Bloc is the bitmap location table
See - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bloc.html
CaretValue1
CaretValue2
CaretValue3
func ParseCaretValue(src []byte) (CaretValue, int, error)
// X or Y value, in design units
CaretValue1 : CaretValue
func ParseCaretValue1(src []byte) (CaretValue1, int, error)
// Contour point index on glyph
CaretValue2 : CaretValue
func ParseCaretValue2(src []byte) (CaretValue2, int, error)
// X or Y value, in design units
Device DeviceTable
CaretValue3 : CaretValue
func ParseCaretValue3(src []byte) (CaretValue3, int, error)
CBLC is the Color Bitmap Location Table
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/cblc
// BitmapSize records array.
// with same length as [BitmapSizes]
func ParseCBLC(src []byte) (CBLC, int, error)
CFF is the Compact Font Format Table.
Since it used its own format, quite different from the regular Opentype format,
its interpretation is handled externally (see font/cff).
See also https://learn.microsoft.com/fr-fr/typography/opentype/spec/cff
ChainedClassSequenceRuleSet has the same binary format as ChainedSequenceRuleSet,
and using the same type simplifies later processing.
Data ChainedContextualPosITF
( ChainedContextualPos) Cov() Coverage
ChainedContextualPos : GPOSLookup
func ParseChainedContextualPos(src []byte) (ChainedContextualPos, int, error)
// [chainedSeqRuleSetCount] Array of offsets to ChainedSeqRuleSet tables, from beginning of ChainedSequenceContextFormat1 table (may be NULL)
( ChainedContextualPos1) Cov() Coverage
ChainedContextualPos1 : ChainedContextualPosITF
func ParseChainedContextualPos1(src []byte) (ChainedContextualPos1, int, error)
// Offset to ClassDef table containing backtrack sequence context, from beginning of ChainedSequenceContextFormat2 table
// [chainedClassSeqRuleSetCount] Array of offsets to ChainedClassSequenceRuleSet tables, from beginning of ChainedSequenceContextFormat2 table (may be NULL)
// Offset to ClassDef table containing input sequence context, from beginning of ChainedSequenceContextFormat2 table
// Offset to ClassDef table containing lookahead sequence context, from beginning of ChainedSequenceContextFormat2 table
( ChainedContextualPos2) Cov() Coverage
ChainedContextualPos2 : ChainedContextualPosITF
func ParseChainedContextualPos2(src []byte) (ChainedContextualPos2, int, error)
// [backtrackGlyphCount] Array of offsets to coverage tables for the backtrack sequence
// [inputGlyphCount] Array of offsets to coverage tables for the input sequence
// [lookaheadGlyphCount] Array of offsets to coverage tables for the lookahead sequence
// [seqLookupCount] Array of SequenceLookupRecords
( ChainedContextualPos3) Cov() Coverage
ChainedContextualPos3 : ChainedContextualPosITF
func ParseChainedContextualPos3(src []byte) (ChainedContextualPos3, int, error)
( ChainedContextualPosITF) Cov() Coverage
ChainedContextualPos1
ChainedContextualPos2
ChainedContextualPos3
func ParseChainedContextualPosITF(src []byte) (ChainedContextualPosITF, int, error)
Data ChainedContextualSubsITF
( ChainedContextualSubs) Cov() Coverage
ChainedContextualSubs : GSUBLookup
func ParseChainedContextualSubs(src []byte) (ChainedContextualSubs, int, error)
// [chainedSeqRuleSetCount] Array of offsets to ChainedSeqRuleSet tables, from beginning of ChainedSequenceContextFormat1 table (may be NULL)
( ChainedContextualSubs1) Cov() Coverage
ChainedContextualSubs1 : ChainedContextualSubsITF
func ParseChainedContextualSubs1(src []byte) (ChainedContextualSubs1, int, error)
// Offset to ClassDef table containing backtrack sequence context, from beginning of ChainedSequenceContextFormat2 table
// [chainedClassSeqRuleSetCount] Array of offsets to ChainedClassSequenceRuleSet tables, from beginning of ChainedSequenceContextFormat2 table (may be NULL)
// Offset to ClassDef table containing input sequence context, from beginning of ChainedSequenceContextFormat2 table
// Offset to ClassDef table containing lookahead sequence context, from beginning of ChainedSequenceContextFormat2 table
( ChainedContextualSubs2) Cov() Coverage
ChainedContextualSubs2 : ChainedContextualSubsITF
func ParseChainedContextualSubs2(src []byte) (ChainedContextualSubs2, int, error)
// [backtrackGlyphCount] Array of offsets to coverage tables for the backtrack sequence
// [inputGlyphCount] Array of offsets to coverage tables for the input sequence
// [lookaheadGlyphCount] Array of offsets to coverage tables for the lookahead sequence
// [seqLookupCount] Array of SequenceLookupRecords
( ChainedContextualSubs3) Cov() Coverage
ChainedContextualSubs3 : ChainedContextualSubsITF
func ParseChainedContextualSubs3(src []byte) (ChainedContextualSubs3, int, error)
( ChainedContextualSubsITF) Cov() Coverage
ChainedContextualSubs1
ChainedContextualSubs2
ChainedContextualSubs3
func ParseChainedContextualSubsITF(src []byte) (ChainedContextualSubsITF, int, error)
// [chainedSeqRuleSetCount] Array of offsets to ChainedSeqRuleSet tables, from beginning of ChainedSequenceContextFormat1 table (may be NULL)
// Offset to ClassDef table containing backtrack sequence context, from beginning of ChainedSequenceContextFormat2 table
// [chainedClassSeqRuleSetCount] Array of offsets to ChainedClassSequenceRuleSet tables, from beginning of ChainedSequenceContextFormat2 table (may be NULL)
// Offset to ClassDef table containing input sequence context, from beginning of ChainedSequenceContextFormat2 table
// Offset to ClassDef table containing lookahead sequence context, from beginning of ChainedSequenceContextFormat2 table
// [backtrackGlyphCount] Array of offsets to coverage tables for the backtrack sequence
// [inputGlyphCount] Array of offsets to coverage tables for the input sequence
// [lookaheadGlyphCount] Array of offsets to coverage tables for the lookahead sequence
// [seqLookupCount] Array of SequenceLookupRecords
// [backtrackGlyphCount] Array of backtrack glyph IDs
// [inputGlyphCount - 1] Array of input glyph IDs—start with second glyph
// [lookaheadGlyphCount] Array of lookahead glyph IDs
// [seqLookupCount] Array of SequenceLookupRecords
func ParseChainedSequenceRule(src []byte) (ChainedSequenceRule, int, error)
// Array of offsets to SequenceRule tables, from beginning of the SequenceRuleSet table
func ParseChainedSequenceRuleSet(src []byte) (ChainedSequenceRuleSet, int, error)
type Class1Record ([])
// Positioning for first glyph — empty if valueFormat1 = 0.
// Positioning for second glyph — empty if valueFormat2 = 0.
func (*PairPosData2).Record(class1, class2 uint16) Class2Record
ClassDef stores a value for a set of GlyphIDs.
Conceptually it is a map[GlyphID]uint16, but it may
be implemented more efficiently.
( ClassDef) Class(gi GlyphID) (uint16, bool)
Extent returns the maximum class ID + 1. This is the length
required for an array to be indexed by the class values.
ClassDef1
ClassDef2
func ParseClassDef(src []byte) (ClassDef, int, error)
// [glyphCount] Array of Class Values — one per glyph ID
// First glyph ID of the classValueArray
( ClassDef1) Class(gi GlyphID) (uint16, bool)
( ClassDef1) Extent() int
ClassDef1 : ClassDef
func ParseClassDef1(src []byte) (ClassDef1, int, error)
// [glyphCount] Array of Class Values — one per glyph ID
( ClassDef2) Class(g GlyphID) (uint16, bool)
( ClassDef2) Extent() int
ClassDef2 : ClassDef
func ParseClassDef2(src []byte) (ClassDef2, int, error)
// Applied to all glyphs in the range
// Last glyph ID in the range
// First glyph ID in the range
ClassSequenceRuleSet has the same binary format as SequenceRuleSet,
and using the same type simplifies later processing.
ClassTable is the same as AATLookup8, but with no format and with bytes instead of uint16s
StartGlyph GlyphID
Values []byte
func ParseClassTable(src []byte) (ClassTable, int, error)
// Offset to a ClipBox table, from beginning of ClipList table.
// Last glyph ID in the range.
// First glyph ID in the range.
func ParseClip(src []byte, parentSrc []byte) (Clip, int, error)
ClipBoxFormat1
ClipBoxFormat2
func ParseClipBox(src []byte) (ClipBox, int, error)
func ClipList.Search(g GlyphID) (ClipBox, bool)
static clip box
// Maximum x of clip box.
// Minimum x of clip box.
// Maximum y of clip box.
// Minimum y of clip box.
ClipBoxFormat1 : ClipBox
func ParseClipBoxFormat1(src []byte) (ClipBoxFormat1, int, error)
variable clip box
// Base index into DeltaSetIndexMap.
// Maximum x of clip box. For variation, use varIndexBase + 2.
// Minimum x of clip box. For variation, use varIndexBase + 0.
// Maximum y of clip box. For variation, use varIndexBase + 3.
// Minimum y of clip box. For variation, use varIndexBase + 1.
ClipBoxFormat2 : ClipBox
func ParseClipBoxFormat2(src []byte) (ClipBoxFormat2, int, error)
Cmap is the Character to Glyph Index Mapping table
See https://learn.microsoft.com/en-us/typography/opentype/spec/cmap
Records []EncodingRecord
func ParseCmap(src []byte) (Cmap, int, error)
func github.com/go-text/typesetting/font.ProcessCmap(cmap Cmap, os2FontPage FontPage) (font.Cmap, font.UnicodeVariations, error)
CmapSubtable is the union type for the various cmap formats
CmapSubtable0
CmapSubtable10
CmapSubtable12
CmapSubtable13
CmapSubtable14
CmapSubtable2
CmapSubtable4
CmapSubtable6
func ParseCmapSubtable(src []byte) (CmapSubtable, int, error)
// An array that maps character codes to glyph index values.
CmapSubtable0 : CmapSubtable
func ParseCmapSubtable0(src []byte) (CmapSubtable0, int, error)
// Array of glyph indices for the character codes covered
// First character code covered
CmapSubtable10 : CmapSubtable
func ParseCmapSubtable10(src []byte) (CmapSubtable10, int, error)
// Array of SequentialMapGroup records.
CmapSubtable12 : CmapSubtable
func ParseCmapSubtable12(src []byte) (CmapSubtable12, int, error)
// Array of SequentialMapGroup records.
CmapSubtable13 : CmapSubtable
func ParseCmapSubtable13(src []byte) (CmapSubtable13, int, error)
// [numVarSelectorRecords] Array of VariationSelector records.
CmapSubtable14 : CmapSubtable
func ParseCmapSubtable14(src []byte) (CmapSubtable14, int, error)
CmapSubtable2 : CmapSubtable
func ParseCmapSubtable2(src []byte) (CmapSubtable2, int, error)
// [segCount]uint16 End characterCode for each segment, last=0xFFFF.
// glyphIdArray : uint16[] glyph index array (arbitrary length)
// [segCount]int16 Delta for all character codes in segment.
// [segCount]uint16 Offsets into glyphIdArray or 0
// [segCount]uint16 Start character code for each segment.
CmapSubtable4 : CmapSubtable
func ParseCmapSubtable4(src []byte) (CmapSubtable4, int, error)
// First character code of subrange.
// Array of glyph index values for character codes in the range.
CmapSubtable6 : CmapSubtable
func ParseCmapSubtable6(src []byte) (CmapSubtable6, int, error)
// [numStops]
// An Extend enum value.
func ParseColorLine(src []byte) (ColorLine, int, error)
// Alpha value (B3).
// Blue value (B0).
// Green value (B1).
// Red value (B2).
// Alpha value.
// Index for a CPAL palette entry.
// Position on a color line.
// Offset to ClipList table, from beginning of COLR table (may be NULL).
// Table version number
// Offset to ItemVariationStore, from beginning of COLR table (may be NULL).
// Offset to LayerList table, from beginning of COLR table (may be NULL).
// Offset to DeltaSetIndexMap table, from beginning of COLR table (may be NULL).
(*COLR1) Search(gid GlyphID) (PaintTable, bool)
func ParseCOLR(src []byte) (COLR1, error)
func ParseCOLR1(src []byte) (COLR1, int, error)
Glyphs []CompositeGlyphPart
Instructions []byte
CompositeGlyph : GlyphData
func ParseCompositeGlyph(src []byte) (CompositeGlyph, int, error)
Flags uint16
GlyphIndex GlyphID
Scale is a matrix x, 01, 10, y ; default to identity
(*CompositeGlyphPart) ArgsAsIndices() (int, int)
(*CompositeGlyphPart) ArgsAsTranslation() (int16, int16)
(*CompositeGlyphPart) HasUseMyMetrics() bool
return true if arg1 and arg2 indicated an anchor point,
not offsets
(*CompositeGlyphPart) IsScaledOffsets() bool
func ParseCompositeGlyphPart(src []byte) (CompositeGlyphPart, int, error)
const CompositeClear
const CompositeColorBurn
const CompositeColorDodge
const CompositeDarken
const CompositeDest
const CompositeDestAtop
const CompositeDestIn
const CompositeDestOut
const CompositeDestOver
const CompositeDifference
const CompositeExclusion
const CompositeHardLight
const CompositeHslColor
const CompositeHslHue
const CompositeHslLuminosity
const CompositeHslSaturation
const CompositeLighten
const CompositeMultiply
const CompositeOverlay
const CompositePlus
const CompositeScreen
const CompositeSoftLight
const CompositeSrc
const CompositeSrcAtop
const CompositeSrcIn
const CompositeSrcOut
const CompositeSrcOver
const CompositeXor
// Index (zero-based) for the variation axis within the 'fvar' table.
// Maximum value of the font variation instances that satisfy this condition.
// Minimum value of the font variation instances that satisfy this condition.
func ParseConditionFormat1(src []byte) (ConditionFormat1, int, error)
uint16 conditionCount Number of Conditions for this condition set.
// [conditionCount] Array of offsets to condition tables, from beginning of the ConditionSet table.
func ParseConditionSet(src []byte) (ConditionSet, int, error)
Data ContextualPosITF
( ContextualPos) Cov() Coverage
(*ContextualPos) Sanitize(lookupCount uint16) error
ContextualPos : GPOSLookup
func ParseContextualPos(src []byte) (ContextualPos, int, error)
// [seqRuleSetCount] Array of offsets to SequenceRuleSet tables, from beginning of SequenceContextFormat1 table (offsets may be NULL)
( ContextualPos1) Cov() Coverage
ContextualPos1 : ContextualPosITF
func ParseContextualPos1(src []byte) (ContextualPos1, int, error)
// Offset to ClassDef table, from beginning of SequenceContextFormat2 table
// [classSeqRuleSetCount] Array of offsets to ClassSequenceRuleSet tables, from beginning of SequenceContextFormat2 table (may be NULL)
( ContextualPos2) Cov() Coverage
ContextualPos2 : ContextualPosITF
func ParseContextualPos2(src []byte) (ContextualPos2, int, error)
// [glyphCount] Array of offsets to Coverage tables, from beginning of SequenceContextFormat3 subtable
// [seqLookupCount] Array of SequenceLookupRecords
( ContextualPos3) Cov() Coverage
ContextualPos3 : ContextualPosITF
func ParseContextualPos3(src []byte) (ContextualPos3, int, error)
( ContextualPosITF) Cov() Coverage
ContextualPos1
ContextualPos2
ContextualPos3
func ParseContextualPosITF(src []byte) (ContextualPosITF, int, error)
Data ContextualSubsITF
( ContextualSubs) Cov() Coverage
( ContextualSubs) Sanitize(lookupCount uint16) error
ContextualSubs : GSUBLookup
func ParseContextualSubs(src []byte) (ContextualSubs, int, error)
// [seqRuleSetCount] Array of offsets to SequenceRuleSet tables, from beginning of SequenceContextFormat1 table (offsets may be NULL)
( ContextualSubs1) Cov() Coverage
ContextualSubs1 : ContextualSubsITF
func ParseContextualSubs1(src []byte) (ContextualSubs1, int, error)
// Offset to ClassDef table, from beginning of SequenceContextFormat2 table
// [classSeqRuleSetCount] Array of offsets to ClassSequenceRuleSet tables, from beginning of SequenceContextFormat2 table (may be NULL)
( ContextualSubs2) Cov() Coverage
ContextualSubs2 : ContextualSubsITF
func ParseContextualSubs2(src []byte) (ContextualSubs2, int, error)
// [glyphCount] Array of offsets to Coverage tables, from beginning of SequenceContextFormat3 subtable
// [seqLookupCount] Array of SequenceLookupRecords
( ContextualSubs3) Cov() Coverage
ContextualSubs3 : ContextualSubsITF
func ParseContextualSubs3(src []byte) (ContextualSubs3, int, error)
( ContextualSubsITF) Cov() Coverage
ContextualSubs1
ContextualSubs2
ContextualSubs3
func ParseContextualSubsITF(src []byte) (ContextualSubsITF, int, error)
Coord is a real number in [-1;1], stored as a fixed 2.14 integer
func NewCoord(c float64) Coord
func SegmentMaps.Map(value Coord) Coord
func github.com/go-text/typesetting/font.(*Face).Coords() []Coord
func (*HVAR).AdvanceDelta(glyph GlyphID, coords []Coord) float32
func ItemVarStore.GetDelta(index VariationStoreIndex, coords []Coord) float32
func SegmentMaps.Map(value Coord) Coord
func VariationRegion.Evaluate(coords []Coord) float32
func (*VVAR).VorgDelta(glyph GlyphID, coords []Coord) float32
func github.com/go-text/typesetting/font.(*Face).SetCoords(coords []Coord)
func github.com/go-text/typesetting/font/cff.(*CFF2).LoadGlyph(glyph GlyphID, coords []Coord) ([]ot.Segment, ps.PathBounds, error)
Coverage specifies all the glyphs affected by a substitution or
positioning operation described in a subtable.
Conceptually is it a []GlyphIndex, with an Index method,
but it may be implemented for efficiently.
See https://learn.microsoft.com/typography/opentype/spec/chapter2#lookup-table
Index returns the index of the provided glyph, or
`false` if the glyph is not covered by this lookup.
Note: this method is injective: two distincts, covered glyphs are mapped
to distincts indices.
Len return the number of glyphs covered.
It is 0 for empty coverages.
For non empty Coverages, it is also 1 + (maximum index returned)
Coverage1
Coverage2
func ParseCoverage(src []byte) (Coverage, int, error)
func AlternateSubs.Cov() Coverage
func ChainedContextualPos.Cov() Coverage
func ChainedContextualPos1.Cov() Coverage
func ChainedContextualPos2.Cov() Coverage
func ChainedContextualPos3.Cov() Coverage
func ChainedContextualPosITF.Cov() Coverage
func ChainedContextualSubs.Cov() Coverage
func ChainedContextualSubs1.Cov() Coverage
func ChainedContextualSubs2.Cov() Coverage
func ChainedContextualSubs3.Cov() Coverage
func ChainedContextualSubsITF.Cov() Coverage
func ContextualPos.Cov() Coverage
func ContextualPos1.Cov() Coverage
func ContextualPos2.Cov() Coverage
func ContextualPos3.Cov() Coverage
func ContextualPosITF.Cov() Coverage
func ContextualSubs.Cov() Coverage
func ContextualSubs1.Cov() Coverage
func ContextualSubs2.Cov() Coverage
func ContextualSubs3.Cov() Coverage
func ContextualSubsITF.Cov() Coverage
func CursivePos.Cov() Coverage
func ExtensionPos.Cov() Coverage
func ExtensionSubs.Cov() Coverage
func GPOSLookup.Cov() Coverage
func GSUBLookup.Cov() Coverage
func LigatureSubs.Cov() Coverage
func MarkBasePos.Cov() Coverage
func MarkLigPos.Cov() Coverage
func MarkMarkPos.Cov() Coverage
func MultipleSubs.Cov() Coverage
func PairPos.Cov() Coverage
func PairPosData.Cov() Coverage
func PairPosData1.Cov() Coverage
func PairPosData2.Cov() Coverage
func ReverseChainSingleSubs.Cov() Coverage
func SinglePos.Cov() Coverage
func SinglePosData.Cov() Coverage
func SinglePosData1.Cov() Coverage
func SinglePosData2.Cov() Coverage
func SingleSubs.Cov() Coverage
func SingleSubstData.Cov() Coverage
func SingleSubstData1.Cov() Coverage
func SingleSubstData2.Cov() Coverage
Glyphs []GlyphID
( Coverage1) Index(gi GlyphID) (int, bool)
( Coverage1) Len() int
Coverage1 : Coverage
func ParseCoverage1(src []byte) (Coverage1, int, error)
Ranges []RangeRecord
( Coverage2) Index(gi GlyphID) (int, bool)
( Coverage2) Len() int
Coverage2 : Coverage
func ParseCoverage2(src []byte) (Coverage2, int, error)
https://learn.microsoft.com/en-us/typography/opentype/spec/cpal
For now, only the CPAL version 0 is supported.
// [numPalettes] Index of each palette’s first color record in the combined color record array.
// Offset from the beginning of CPAL table to the first ColorRecord.
// Number of palette entries in each palette.
// Table version number
func ParseCPAL(src []byte) (CPAL, int, error)
EntryExits []EntryExit
( CursivePos) Cov() Coverage
CursivePos : GPOSLookup
func ParseCursivePos(src []byte) (CursivePos, int, error)
DefaultUVSTable is used in Cmap format 14
See https://learn.microsoft.com/en-us/typography/opentype/spec/cmap#default-uvs-table
Ranges []UnicodeRange
func ParseDefaultUVSTable(src []byte) (DefaultUVSTable, int, error)
uint16 or uint32 mapCount : The number of mapping entries.
Index returns the [VariationStoreIndex] for the given index.
func ParseDeltaSetMapping(src []byte) (DeltaSetMapping, int, error)
correction range, in ppem
correction range, in ppem
with length endSize - startSize + 1
GetDelta returns the hint for the given `ppem`, scaled by `scale`.
It returns 0 for out of range `ppem` values.
DeviceHinting : DeviceTable
DeviceTable is either an DeviceHinting for standard fonts,
or a DeviceVariation for variable fonts.
DeviceHinting
DeviceVariation
DeviceTableHeader is the common header for DeviceTable
See https://learn.microsoft.com/fr-fr/typography/opentype/spec/chapter2#device-and-variationindex-tables
func ParseDeviceTableHeader(src []byte) (DeviceTableHeader, int, error)
DeltaSetInner uint16
DeltaSetOuter uint16
DeviceVariation : DeviceTable
EBLC is the Embedded Bitmap Location Table
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/eblc
EncodingID represents the platform specific id for entries in the name table.
The most common values are provided as constants.
const PEMacRoman
const PEMicrosoftSymbolCs
const PEMicrosoftUcs4
const PEMicrosoftUnicodeCs
const PEUnicodeBMP
const PEUnicodeDefault
const PEUnicodeFull
const PEUnicodeFull13
// Platform-specific encoding ID.
// Platform ID.
// Byte offset from beginning of table to the subtable for this encoding.
func ParseEncodingRecord(src []byte, parentSrc []byte) (EncodingRecord, int, error)
EntryAnchor Anchor
ExitAnchor Anchor
func ParseEntryExit(src []byte) (EntryExit, int, error)
const ExtendPad
const ExtendReflect
const ExtendRepeat
// Lookup type of subtable referenced by extensionOffset (that is, the extension subtable).
// Offset to the extension subtable, of lookup type extensionLookupType, relative to the start of the ExtensionSubstFormat1 subtable.
RawData []byte
// Lookup type of subtable referenced by extensionOffset (that is, the extension subtable).
// Offset to the extension subtable, of lookup type extensionLookupType, relative to the start of the ExtensionSubstFormat1 subtable.
RawData []byte
( ExtensionPos) Cov() Coverage
( ExtensionPos) Resolve() (GPOSLookup, error)
ExtensionPos : GPOSLookup
func ParseExtensionPos(src []byte) (ExtensionPos, int, error)
// Lookup type of subtable referenced by extensionOffset (that is, the extension subtable).
// Offset to the extension subtable, of lookup type extensionLookupType, relative to the start of the ExtensionSubstFormat1 subtable.
RawData []byte
( ExtensionSubs) Cov() Coverage
( ExtensionSubs) Resolve() (GSUBLookup, error)
ExtensionSubs : GSUBLookup
func ParseExtensionSubs(src []byte) (ExtensionSubs, int, error)
Feat is the feature name table.
See - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6feat.html
// The feature name array.
GetFeature performs a binary seach into the names, using `Feature` as key,
returning `nil` if not found.
func ParseFeat(src []byte) (Feat, int, error)
// [lookupIndexCount] Array of indices into the LookupList — zero-based (first lookup is LookupListIndex = 0)
func ParseFeature(src []byte) (Feature, int, error)
Features []Feature
// Array of FeatureRecords — zero-based (first feature has FeatureIndex = 0), listed alphabetically by feature tag
func ParseFeatureList(src []byte) (FeatureList, int, error)
// Feature type.
// Single-bit flags associated with the feature type.
// The name table index for the feature's name. This index has values greater than 255 and less than 32768.
// Offset in bytes from the beginning of the 'feat' table to this feature's setting name array. The actual type of record this offset refers to will depend on the exclusivity value, as described below.
IsExclusive returns true if the feature settings are mutually exclusive.
func ParseFeatureName(src []byte, parentSrc []byte) (FeatureName, int, error)
func Feat.GetFeature(feature uint16) *FeatureName
// The name table index for the setting's name. The nameIndex must be greater than 255 and less than 32768.
// The setting.
// [substitutionCount] Array of feature table substitution records.
func ParseFeatureTableSubstitution(src []byte) (FeatureTableSubstitution, int, error)
// Offset to an alternate feature table, from start of the FeatureTableSubstitution table.
// The feature table index to match.
func ParseFeatureTableSubstitutionRecord(src []byte, parentSrc []byte) (FeatureTableSubstitutionRecord, int, error)
// [featureVariationRecordCount] Array of feature variation records.
func ParseFeatureVariation(src []byte) (FeatureVariation, int, error)
// Offset to a condition set table, from beginning of FeatureVariations table.
// Offset to a feature table substitution table, from beginning of the FeatureVariations table.
func ParseFeatureVariationRecord(src []byte, parentSrc []byte) (FeatureVariationRecord, int, error)
Fixed214 is a number stored as a fixed 2.14 integer
Float1616 is a float32, represented in
fixed 16.16 format in font files.
See https://docs.microsoft.com/en-us/typography/legacy/legacy_arabic_fonts
https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681
func (*Os2).FontPage() FontPage
func github.com/go-text/typesetting/font.ProcessCmap(cmap Cmap, os2FontPage FontPage) (font.Cmap, font.UnicodeVariations, error)
const FPHebrew
const FPNone
const FPOemArabic
const FPSimpArabic
const FPSimpFarsi
const FPThai
const FPTradArabic
const FPTradFarsi
Fvar is the Font Variations Table.
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/fvar
FvarRecords FvarRecords
FvarRecords.Axis []VariationAxisRecord
FvarRecords.Instances []InstanceRecord
func ParseFvar(src []byte) (Fvar, int, error)
binarygen: argument=instanceCount int
binarygen: argument=instanceSize int
Axis []VariationAxisRecord
Instances []InstanceRecord
func ParseFvarRecords(src []byte, axisCount int, instanceCount int, instanceSize int) (FvarRecords, int, error)
// Offset to attachment point list table, from beginning of GDEF header (may be NULL)
// Offset to class definition table for glyph type, from beginning of GDEF header (may be NULL)
// Offset to the Item Variation Store table, from beginning of GDEF header (may be NULL)
// Offset to ligature caret list table, from beginning of GDEF header (may be NULL)
// Offset to class definition table for mark attachment type, from beginning of GDEF header (may be NULL)
// Offset to the table of mark glyph set definitions, from beginning of GDEF header (may be NULL)
GlyphProps return a summary of the glyph properties.
func ParseGDEF(src []byte) (GDEF, int, error)
Data GlyphData
// Maximum x for coordinate data.
// Minimum x for coordinate data.
// Maximum y for coordinate data.
// Minimum y for coordinate data.
func ParseGlyph(src []byte) (Glyph, int, error)
// Glyph ID of glyph present.
// Location in EBDT.
GlyphProps is a 16-bit integer where the lower 8-bit have bits representing
glyph class, and high 8-bit the mark attachment type (if any).
// Offset from the start of the GlyphVariationData table to the serialized data
// [tupleCount] Array of tuple variation headers.
func ParseGlyphVariationData(src []byte, axisCount int) (GlyphVariationData, int, error)
GPOS is the Glyph Positioning (GPOS) table.
It provides precise control over glyph placement
for sophisticated text layout and rendering in each script
and language system that a font supports.
See https://learn.microsoft.com/fr-fr/typography/opentype/spec/gpos
// Offset to FeatureList table, from beginning of GPOS table
// Offset to FeatureVariations table, from beginning of GPOS table (may be NULL)
// Offset to LookupList table, from beginning of GPOS table
// Offset to ScriptList table, from beginning of GPOS table
Coverage returns the coverage of the lookup subtable.
For ContextualPos3 and ChainedContextualPos3, its the coverage of the first input.
ChainedContextualPos
ContextualPos
CursivePos
ExtensionPos
MarkBasePos
MarkLigPos
MarkMarkPos
PairPos
SinglePos
func ExtensionPos.Resolve() (GPOSLookup, error)
func Lookup.AsGPOSLookups() ([]GPOSLookup, error)
GSUB is the Glyph Substitution (GSUB) table.
It provides data for substition of glyphs for appropriate rendering of scripts,
such as cursively-connecting forms in Arabic script,
or for advanced typographic effects, such as ligatures.
See https://learn.microsoft.com/fr-fr/typography/opentype/spec/gsub
// Offset to FeatureList table, from beginning of GPOS table
// Offset to FeatureVariations table, from beginning of GPOS table (may be NULL)
// Offset to LookupList table, from beginning of GPOS table
// Offset to ScriptList table, from beginning of GPOS table
GSUBLookup is one lookup subtable data
Coverage returns the coverage of the lookup subtable.
For ContextualSubs3 and ChainedContextualSubs3, its the coverage of the first input.
AlternateSubs
ChainedContextualSubs
ContextualSubs
ExtensionSubs
LigatureSubs
MultipleSubs
ReverseChainSingleSubs
SingleSubs
func ExtensionSubs.Resolve() (GSUBLookup, error)
func Lookup.AsGSUBLookups() ([]GSUBLookup, error)
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/gvar
GlyphVariationDatas []GlyphVariationData
func ParseGvar(src []byte) (Gvar, int, error)
TableHead contains critical information about the rest of the font.
https://learn.microsoft.com/en-us/typography/opentype/spec/head
https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6head.html
https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6bhed.html
IndexToLocFormat int16
MacStyle uint16
UnitsPerEm uint16
XMax int16
XMin int16
YMax int16
YMin int16
Upem returns a sanitize version of the 'UnitsPerEm' field.
func ParseHead(src []byte) (Head, int, error)
func github.com/go-text/typesetting/font.LoadHeadTable(ld *ot.Loader, buffer []byte) (Head, []byte, error)
https://learn.microsoft.com/en-us/typography/opentype/spec/hhea
AdvanceMax uint16
Ascender int16
CaretOffset int16
CaretSlopeRise int16
CaretSlopeRun int16
Descender int16
LineGap int16
MaxExtent int16
MinFirstSideBearing int16
MinSecondSideBearing int16
NumOfLongMetrics uint16
func ParseHhea(src []byte) (Hhea, int, error)
https://learn.microsoft.com/en-us/typography/opentype/spec/hmtx
avances are padded with the last value
and side bearings are given
Metrics []LongHorMetric
Advance returns the base side bearing, defaulting to 0 for invalid glyph index
( Hmtx) IsEmpty() bool
SideBearing returns the base side bearing, defaulting to 0 for invalid glyph index
func ParseHmtx(src []byte, metricsCount int, leftSideBearingsCount int) (Hmtx, int, error)
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/hvar
// Offset in bytes from the start of this table to the delta-set index mapping for advance widths (may be NULL).
// Offset in bytes from the start of this table to the item variation store table.
// Offset in bytes from the start of this table to the delta-set index mapping for left side bearings (may be NULL).
// Offset in bytes from the start of this table to the delta-set index mapping for right side bearings (may be NULL).
(*HVAR) AdvanceDelta(glyph GlyphID, coords []Coord) float32
func ParseHVAR(src []byte) (HVAR, int, error)
sizeOfArray = (lastGlyph - firstGlyph + 1) + 1 + 1 pad if needed
sbitOffsets[glyphIndex] + imageDataOffset = glyphData
IndexData1 : IndexData
func ParseIndexData1(src []byte, sbitOffsetsCount int) (IndexData1, int, error)
// All glyphs have the same metrics; glyph data may be compressed, byte-aligned, or bit-aligned.
// All the glyphs are of the same size.
IndexData2 : IndexData
func ParseIndexData2(src []byte) (IndexData2, int, error)
sizeOfArray = (lastGlyph - firstGlyph + 1) + 1 + 1 pad if needed
sbitOffets[glyphIndex] + imageDataOffset = glyphData
IndexData3 : IndexData
func ParseIndexData3(src []byte, sbitOffsetsCount int) (IndexData3, int, error)
// [numGlyphs + 1] One per glyph.
IndexData4 : IndexData
func ParseIndexData4(src []byte) (IndexData4, int, error)
// All glyphs have the same metrics.
// [numGlyphs] One per glyph, sorted by glyph ID.
// All glyphs have the same data size.
IndexData5 : IndexData
func ParseIndexData5(src []byte) (IndexData5, int, error)
// Offset to image data in EBDT table.
// Format of EBDT image data.
IndexData IndexData
func ParseIndexSubHeader(src []byte, sbitOffsetsCount int) (IndexSubHeader, int, error)
Subtables []IndexSubTableHeader
func ParseIndexSubTableArray(src []byte, subtablesCount int) (IndexSubTableArray, int, error)
// First glyph ID of this range.
// Last glyph ID of this range (inclusive).
// [axisCount] The coordinates array for this instance.
// Optional. The name ID for entries in the 'name' table that provide PostScript names for this instance.
// The name ID for entries in the 'name' table that provide subfamily names for this instance.
func ParseInstanceRecord(src []byte, coordinatesCount int) (InstanceRecord, int, error)
// [itemCount] Delta-set rows.
// [regionIndexCount] Array of indices into the variation region list for the regions referenced by this item variation data table.
func ParseItemVariationData(src []byte) (ItemVariationData, int, error)
// [itemVariationDataCount] Offsets in bytes from the start of the item variation store to each item variation data subtable.
// Offset in bytes from the start of the item variation store to the variation region list.
AxisCount returns the number of axis found in the
var store, which must be the same as the one in the 'fvar' table.
It returns -1 if the store is empty
GetDelta uses the variation [store] and the selected instance coordinates [coords]
to compute the value at [index].
func ParseItemVarStore(src []byte) (ItemVarStore, int, error)
Kern is the kern table. It has multiple header format, defined in Apple AAT and Microsoft OT
specs, but the subtable data actually are the same.
Microsoft (OT) format
version uint16 : Table version number (0)
nTables uint16 : Number of subtables in the kerning table.
Apple (AAT) old format
version uint16 : The version number of the kerning table (0x0001 for the current version).
nTables uint16 : The number of subtables included in the kerning table.
Apple (AAT) new format
version uint32 : The version number of the kerning table (0x00010000 for the current version).
nTables uint32 : The number of subtables included in the kerning table.
See - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6kern.html
and - https://learn.microsoft.com/fr-fr/typography/opentype/spec/kern
Tables []KernSubtable
func ParseKern(src []byte) (Kern, int, error)
KernData0
KernData1
KernData2
KernData3
func AATKernSubtableHeader.Data() KernData
func KernSubtable.Data() KernData
func OTKernSubtableHeader.Data() KernData
Pairs []Kernx0Record
KernData0 : KernData
func ParseKernData0(src []byte) (KernData0, int, error)
AATStateTable AATStateTable
// Byte offset from the beginning of the state table to the class subtable.
// entry data are empty
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
AATStateTable.States [][]uint8
Values []int16
KernData1 : KernData
func ParseKernData1(src []byte) (KernData1, int, error)
// indexed by Left + Right
// Offset from beginning of this subtable to the start of the kerning array.
Left AATLoopkup8Data
Right AATLoopkup8Data
KernData2 : KernData
func ParseKernData2(src []byte, parentSrc []byte) (KernData2, int, error)
KernIndex []uint8
Kernings []int16
LeftClass []uint8
RightClass []uint8
// The number of right-hand classes.
KernData3 : KernData
func ParseKernData3(src []byte) (KernData3, int, error)
Data returns the actual kerning data
AATKernSubtableHeader
OTKernSubtableHeader
Kerx is the extended kerning table
See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6kerx.html
Tables []KerxSubtable
func ParseKerx(src []byte, valuesCount int) (Kerx, int, error)
Anchors []KAAnchor
KerxAnchorAnchors : KerxAnchors
func ParseKerxAnchorAnchors(src []byte, anchorsCount int) (KerxAnchorAnchors, int, error)
Anchors []KAControl
KerxAnchorControls : KerxAnchors
func ParseKerxAnchorControls(src []byte, anchorsCount int) (KerxAnchorControls, int, error)
Anchors []KACoordinates
KerxAnchorCoordinates : KerxAnchors
func ParseKerxAnchorCoordinates(src []byte, anchorsCount int) (KerxAnchorCoordinates, int, error)
binarygen: argument=tupleCount int
Pairs []Kernx0Record
KerxData0 : KerxData
func ParseKerxData0(src []byte, tupleCount int) (KerxData0, int, error)
binarygen: argument=tupleCount int
binarygen: argument=valuesCount int
AATStateTableExt AATStateTableExt
// Byte offset from the beginning of the state table to the class subtable.
// length is the maximum state + 1
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
// each sub array has length stateSize
Values []int16
KerxData1 : KerxData
func ParseKerxData1(src []byte, tupleCount int, valuesCount int) (KerxData1, int, error)
// indexed by Left + Right
// Offset from beginning of this subtable to the start of the kerning array.
// Offset from beginning of this subtable to the left-hand offset table.
// Offset from beginning of this subtable to right-hand offset table.
KerxData2 : KerxData
func ParseKerxData2(src []byte, parentSrc []byte, valuesCount int) (KerxData2, int, error)
binarygen: argument=valuesCount int
AATStateTableExt AATStateTableExt
// Byte offset from the beginning of the state table to the class subtable.
// length is the maximum state + 1
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
// each sub array has length stateSize
Anchors KerxAnchors
Flags uint32
ActionType returns 0, 1 or 2, according to the anchor format :
- 0 : KerxAnchorControls
- 1 : KerxAnchorAnchors
- 2 : KerxAnchorCoordinates
KerxData4 : KerxData
func ParseKerxData4(src []byte, valuesCount int) (KerxData4, int, error)
binarygen: argument=tupleCount int
binarygen: argument=valuesCount int
Column AatLookupMixed
with rowCount * columnCount
for tuples the values are estParseKerx (Not yet run).the first element of the tuple
// Values are pre-multiplied by `columnCount`
KerxData6 : KerxData
func ParseKerxData6(src []byte, parentSrc []byte, tupleCount int, valuesCount int) (KerxData6, int, error)
binarygen: argument=valuesCount int
// Circumstances under which this table is used.
Data KerxData
// The tuple count. This value is only used with variation fonts and should be 0 for all other fonts. The subtable's tupleCount will be ignored if the 'kerx' table version is less than 4.
func ParseKerxSubtable(src []byte, valuesCount int) (KerxSubtable, int, error)
// [featureIndexCount] Array of indices into the FeatureList, in arbitrary order
// Index of a feature required for this language system; if no required features = 0xFFFF
func ParseLangSys(src []byte) (LangSys, int, error)
func Script.GetLangSys(index uint16) LangSys
LanguageID represents the language used by an entry in the name table
// Glyph ID of the glyph used for a given layer.
// Index (base 0) for a palette entry in the CPAL table.
Resolve returns an error for invalid (out of bounds) indices
func ParseLayerList(src []byte) (LayerList, int, error)
Layout represents the common layout table used by GPOS and GSUB.
The Features field contains all the features for this layout. However,
the script and language determines which feature is used.
See https://learn.microsoft.com/typography/opentype/spec/chapter2#organization
See https://learn.microsoft.com/typography/opentype/spec/gpos
See https://www.microsoft.com/typography/otspec/GSUB.htm
// Offset to FeatureList table, from beginning of GPOS table
// Offset to FeatureVariations table, from beginning of GPOS table (may be NULL)
// Offset to LookupList table, from beginning of GPOS table
// Offset to ScriptList table, from beginning of GPOS table
func ParseLayout(src []byte) (Layout, int, error)
Glyph components for one ligature
// [componentCount - 1] Array of component glyph IDs — start with the second component, ordered in writing direction
// glyph ID of ligature to substitute
func ParseLigature(src []byte) (Ligature, int, error)
// [ligatureCount] Array of offsets to LigatureAttach tables. Offsets are from beginning of LigatureArray table, ordered by ligatureCoverage index.
func ParseLigatureArray(src []byte, offsetsCount int) (LigatureArray, int, error)
( LigatureAttach) Anchors() AnchorMatrix
func ParseLigatureAttach(src []byte, offsetsCount int) (LigatureAttach, int, error)
All ligatures beginning with the same glyph
// [LigatureCount] Array of offsets to Ligature tables. Offsets are from beginning of LigatureSet table, ordered by preference.
func ParseLigatureSet(src []byte) (LigatureSet, int, error)
// Offset to Coverage table, from beginning of substitution subtable
// [ligatureSetCount] Array of offsets to LigatureSet tables. Offsets are from beginning of substitution subtable, ordered by Coverage index
( LigatureSubs) Cov() Coverage
( LigatureSubs) Sanitize() error
LigatureSubs : GSUBLookup
func ParseLigatureSubs(src []byte) (LigatureSubs, int, error)
// Offset to Coverage table - from beginning of LigCaretList table
// [ligGlyphCount] Array of offsets to LigGlyph tables, from beginning of LigCaretList table —in Coverage Index order
func ParseLigCaretList(src []byte) (LigCaretList, int, error)
// [caretCount] Array of offsets to CaretValue tables, from beginning of LigGlyph table — in increasing coordinate order
func ParseLigGlyph(src []byte) (LigGlyph, int, error)
Lookup is the common format for GSUB and GPOS lookups
// Lookup qualifiers
// Index (base 0) into GDEF mark glyph sets structure. This field is only present if the USE_MARK_FILTERING_SET lookup flag is set.
AsGPOSLookups returns the GPOS lookup subtables
AsGSUBLookups returns the GSUB lookup subtables.
func ParseLookup(src []byte) (Lookup, int, error)
Ltag is the language tags table
See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6ltag.html
( Ltag) Language(i uint16) language.Language
func ParseLtag(src []byte) (Ltag, int, error)
( Mark2Array) Anchors() AnchorMatrix
func ParseMark2Array(src []byte, offsetsCount int) (Mark2Array, int, error)
// with same length as MarkRecords
// [markCount] Array of MarkRecords, ordered by corresponding glyphs in the associated mark Coverage table.
func ParseMarkArray(src []byte) (MarkArray, int, error)
// Offset to BaseArray table, from beginning of MarkBasePos subtable.
// Offset to baseCoverage table, from beginning of MarkBasePos subtable.
// Offset to MarkArray table, from beginning of MarkBasePos subtable.
( MarkBasePos) Cov() Coverage
(*MarkBasePos) Sanitize() error
MarkBasePos : GPOSLookup
func ParseMarkBasePos(src []byte) (MarkBasePos, int, error)
// [markGlyphSetCount] Array of offsets to mark glyph set coverage tables, from the start of the MarkGlyphSets table.
func ParseMarkGlyphSets(src []byte) (MarkGlyphSets, int, error)
// Offset to LigatureArray table, from beginning of MarkLigPos subtable.
// Offset to ligatureCoverage table, from beginning of MarkLigPos subtable.
// Offset to MarkArray table, from beginning of MarkLigPos subtable.
// Number of defined mark classes
// Offset to markCoverage table, from beginning of MarkLigPos subtable.
( MarkLigPos) Cov() Coverage
(*MarkLigPos) Sanitize() error
MarkLigPos : GPOSLookup
func ParseMarkLigPos(src []byte) (MarkLigPos, int, error)
// Offset to MarkArray table for mark1, from beginning of MarkMarkPos subtable.
// Offset to Combining Mark Coverage table, from beginning of MarkMarkPos subtable.
// Offset to Mark2Array table for mark2, from beginning of MarkMarkPos subtable.
// Offset to Base Mark Coverage table, from beginning of MarkMarkPos subtable.
// Number of Combining Mark classes defined
// Format identifier: format = 1
( MarkMarkPos) Cov() Coverage
MarkMarkPos : GPOSLookup
func ParseMarkMarkPos(src []byte) (MarkMarkPos, int, error)
// Class defined for the associated mark.
https://learn.microsoft.com/en-us/typography/opentype/spec/Maxp
NumGlyphs uint16
func ParseMaxp(src []byte) (Maxp, int, error)
Morx is the extended glyph metamorphosis table
See https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html
Chains []MorxChain
func ParseMorx(src []byte, valuesCount int) (Morx, int, error)
MorxChain is a set of subtables
Features []AATFeature
// The default specification for subtables.
Subtables []MorxChainSubtable
func ParseMorxChain(src []byte, valuesCount int) (MorxChain, int, error)
Coverage flags and subtable type.
Data MorxSubtable
// The 32-bit mask identifying which subtable this is (the subtable being executed if the AND of this value and the processed defaultFlags is nonzero)
func ParseMorxChainSubtable(src []byte, valuesCount int) (MorxChainSubtable, int, error)
MorxSubtableContextual
MorxSubtableInsertion
MorxSubtableLigature
MorxSubtableNonContextual
MorxSubtableRearrangement
binarygen: argument=valuesCount int
AATStateTableExt AATStateTableExt
// Byte offset from the beginning of the state table to the class subtable.
// length is the maximum state + 1
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
// each sub array has length stateSize
Byte offset from the beginning of the state subtable to the beginning of the substitution tables :
each value of the array is itself an offet to a aatLookupTable, and the number of
items is computed from the header
MorxSubtableContextual : MorxSubtable
func ParseMorxSubtableContextual(src []byte, valuesCount int) (MorxSubtableContextual, int, error)
binarygen: argument=valuesCount int
AATStateTableExt AATStateTableExt
// Byte offset from the beginning of the state table to the class subtable.
// length is the maximum state + 1
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
// each sub array has length stateSize
// Byte offset from stateHeader to the start of the insertion glyph table.
MorxSubtableInsertion : MorxSubtable
func ParseMorxSubtableInsertion(src []byte, valuesCount int) (MorxSubtableInsertion, int, error)
binarygen: argument=valuesCount int
AATStateTableExt AATStateTableExt
// Byte offset from the beginning of the state table to the class subtable.
// length is the maximum state + 1
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
// each sub array has length stateSize
Components []uint16
LigActions []uint32
Ligatures []GlyphID
MorxSubtableLigature : MorxSubtable
func ParseMorxSubtableLigature(src []byte, valuesCount int) (MorxSubtableLigature, int, error)
The lookup value is interpreted as a GlyphIndex
MorxSubtableNonContextual : MorxSubtable
func ParseMorxSubtableNonContextual(src []byte, valuesCount int) (MorxSubtableNonContextual, int, error)
binarygen: argument=valuesCount int
AATStateTableExt AATStateTableExt
// Byte offset from the beginning of the state table to the class subtable.
// length is the maximum state + 1
// Size of a state, in bytes. The size is limited to 8 bits, although the field is 16 bits for alignment.
// each sub array has length stateSize
MorxSubtableRearrangement : MorxSubtable
func ParseMorxSubtableRearrangement(src []byte, valuesCount int) (MorxSubtableRearrangement, int, error)
MorxSubtableVersion indicates the kind of 'morx' subtable.
See the constants.
const MorxSubtableVersionContextual
const MorxSubtableVersionInsertion
const MorxSubtableVersionLigature
const MorxSubtableVersionNonContextual
const MorxSubtableVersionRearrangement
// Offset to Coverage table, from beginning of substitution subtable
Sequences []Sequence
( MultipleSubs) Cov() Coverage
( MultipleSubs) Sanitize() error
MultipleSubs : GSUBLookup
func ParseMultipleSubs(src []byte) (MultipleSubs, int, error)
// Offset in bytes from the start of this table to the item variation store table. If valueRecordCount is zero, set to zero; if valueRecordCount is greater than zero, must be greater than zero.
// [valueRecordCount] Array of value records that identify target items and the associated delta-set index for each. The valueTag records must be in binary order of their valueTag field.
func ParseMVAR(src []byte) (MVAR, int, error)
Naming table
See https://learn.microsoft.com/en-us/typography/opentype/spec/name
Name returns the entry at [name], encoded in UTF-8 when possible,
or an empty string if not found
func ParseName(src []byte) (Name, int, error)
Offset16 is an offset into the input byte slice
Offset32 is an offset into the input byte slice
OS/2 and Windows Metrics Table
See https://learn.microsoft.com/en-us/typography/opentype/spec/os2
FsSelection uint16
HigherVersionData []byte
STypoAscender int16
STypoDescender int16
STypoLineGap int16
USFirstCharIndex uint16
USLastCharIndex uint16
USWeightClass uint16
USWidthClass uint16
Version uint16
XAvgCharWidth uint16
YStrikeoutPosition int16
YStrikeoutSize int16
YSubscriptXOffset int16
YSubscriptXSize int16
YSubscriptYOffset int16
YSubscriptYSize int16
YSuperscriptXOffset int16
YSuperscriptXSize int16
YSuperscriptYSize int16
(*Os2) FontPage() FontPage
func ParseOs2(src []byte) (Os2, int, error)
// What type of information is contained in this table.
( OTKernSubtableHeader) Data() KernData
OTKernSubtableHeader : KernSubtable
func ParseOTKernSubtableHeader(src []byte) (OTKernSubtableHeader, int, error)
(format 11)
// Glyph ID for a BaseGlyphList base glyph.
PaintColrGlyph : PaintTable
func ParsePaintColrGlyph(src []byte) (PaintColrGlyph, int, error)
(format 1)
// Index (base 0) into the LayerList.
// Number of offsets to paint tables to read from LayerList.
PaintColrLayers : PaintTable
func ParsePaintColrLayers(src []byte) (PaintColrLayers, int, error)
func LayerList.Resolve(paint PaintColrLayers) ([]PaintTable, error)
PaintColrLayersResolved is a simili PaintTable, build
from COLR version 0 table.
PaintColrLayersResolved : PaintTable
(format 32)
// Offset to a backdrop Paint table, from beginning of PaintComposite table.
// A CompositeMode enumeration value.
// Offset to a source Paint table, from beginning of PaintComposite table.
PaintComposite : PaintTable
func ParsePaintComposite(src []byte) (PaintComposite, int, error)
(format 10)
// Glyph ID for the source outline.
// Offset to a Paint table, from beginning of PaintGlyph table.
PaintGlyph : PaintTable
func ParsePaintGlyph(src []byte) (PaintGlyph, int, error)
(format 4)
// Offset to ColorLine table, from beginning of PaintLinearGradient table.
// Start point (p₀) x coordinate.
// End point (p₁) x coordinate.
// Rotation point (p₂) x coordinate.
// Start point (p₀) y coordinate.
// End point (p₁) y coordinate.
// Rotation point (p₂) y coordinate.
PaintLinearGradient : PaintTable
func ParsePaintLinearGradient(src []byte) (PaintLinearGradient, int, error)
(format 6)
// Offset to ColorLine table, from beginning of PaintRadialGradient table.
// Start circle radius.
// End circle radius.
// Start circle center x coordinate.
// End circle center x coordinate.
// Start circle center y coordinate.
// End circle center y coordinate.
PaintRadialGradient : PaintTable
func ParsePaintRadialGradient(src []byte) (PaintRadialGradient, int, error)
(format 24)
// Rotation angle, 180° in counter-clockwise degrees per 1.0 of value.
// Offset to a Paint subtable, from beginning of PaintRotate table.
PaintRotate : PaintTable
func ParsePaintRotate(src []byte) (PaintRotate, int, error)
(format 26)
// Rotation angle, 180° in counter-clockwise degrees per 1.0 of value.
// x coordinate for the center of rotation.
// y coordinate for the center of rotation.
// Offset to a Paint subtable, from beginning of PaintRotateAroundCenter table.
PaintRotateAroundCenter : PaintTable
func ParsePaintRotateAroundCenter(src []byte) (PaintRotateAroundCenter, int, error)
(format 16)
// Offset to a Paint subtable, from beginning of PaintScale table.
// Scale factor in x direction.
// Scale factor in y direction.
PaintScale : PaintTable
func ParsePaintScale(src []byte) (PaintScale, int, error)
(format 18)
// x coordinate for the center of scaling.
// y coordinate for the center of scaling.
// Offset to a Paint subtable, from beginning of PaintScaleAroundCenter table.
// Scale factor in x direction.
// Scale factor in y direction.
PaintScaleAroundCenter : PaintTable
func ParsePaintScaleAroundCenter(src []byte) (PaintScaleAroundCenter, int, error)
(format 20)
// Offset to a Paint subtable, from beginning of PaintScaleUniform table.
// Scale factor in x and y directions.
PaintScaleUniform : PaintTable
func ParsePaintScaleUniform(src []byte) (PaintScaleUniform, int, error)
(format 22)
// x coordinate for the center of scaling.
// y coordinate for the center of scaling.
// Offset to a Paint subtable, from beginning of PaintScaleUniformAroundCenter table.
// Scale factor in x and y directions.
PaintScaleUniformAroundCenter : PaintTable
func ParsePaintScaleUniformAroundCenter(src []byte) (PaintScaleUniformAroundCenter, int, error)
(format 28)
// Offset to a Paint subtable, from beginning of PaintSkew table.
// Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value.
// Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value.
PaintSkew : PaintTable
func ParsePaintSkew(src []byte) (PaintSkew, int, error)
(format 30)
// x coordinate for the center of rotation.
// y coordinate for the center of rotation.
// Offset to a Paint subtable, from beginning of PaintSkewAroundCenter table.
// Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value.
// Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value.
PaintSkewAroundCenter : PaintTable
func ParsePaintSkewAroundCenter(src []byte) (PaintSkewAroundCenter, int, error)
(format 2)
// Alpha value.
// Index for a CPAL palette entry.
PaintSolid : PaintTable
func ParsePaintSolid(src []byte) (PaintSolid, int, error)
(format 8)
// Center x coordinate.
// Center y coordinate.
// Offset to ColorLine table, from beginning of PaintSweepGradient table.
// End of the angular range of the gradient: add 1.0 and multiply by 180° to retrieve counter-clockwise degrees.
// Start of the angular range of the gradient: add 1.0 and multiply by 180° to retrieve counter-clockwise degrees.
PaintSweepGradient : PaintTable
func ParsePaintSweepGradient(src []byte) (PaintSweepGradient, int, error)
PaintColrGlyph
PaintColrLayers
PaintColrLayersResolved
PaintComposite
PaintGlyph
PaintLinearGradient
PaintRadialGradient
PaintRotate
PaintRotateAroundCenter
PaintScale
PaintScaleAroundCenter
PaintScaleUniform
PaintScaleUniformAroundCenter
PaintSkew
PaintSkewAroundCenter
PaintSolid
PaintSweepGradient
PaintTransform
PaintTranslate
PaintVarLinearGradient
PaintVarRadialGradient
PaintVarRotate
PaintVarRotateAroundCenter
PaintVarScale
PaintVarScaleAroundCenter
PaintVarScaleUniform
PaintVarScaleUniformAroundCenter
PaintVarSkew
PaintVarSkewAroundCenter
PaintVarSolid
PaintVarSweepGradient
PaintVarTransform
PaintVarTranslate
func ParsePaintTable(src []byte) (PaintTable, int, error)
func (*COLR1).Search(gid GlyphID) (PaintTable, bool)
func LayerList.Resolve(paint PaintColrLayers) ([]PaintTable, error)
(format 12)
// Offset to a Paint subtable, from beginning of PaintTransform table.
// Offset to an Affine2x3 table, from beginning of PaintTransform table.
PaintTransform : PaintTable
func ParsePaintTransform(src []byte) (PaintTransform, int, error)
(format 14)
// Translation in x direction.
// Translation in y direction.
// Offset to a Paint subtable, from beginning of PaintTranslate table.
PaintTranslate : PaintTable
func ParsePaintTranslate(src []byte) (PaintTranslate, int, error)
(format 5)
// Offset to VarColorLine table, from beginning of PaintVarLinearGradient table.
// Base index into DeltaSetIndexMap.
// Start point (p₀) x coordinate. For variation, use varIndexBase + 0.
// End point (p₁) x coordinate. For variation, use varIndexBase + 2.
// Rotation point (p₂) x coordinate. For variation, use varIndexBase + 4.
// Start point (p₀) y coordinate. For variation, use varIndexBase + 1.
// End point (p₁) y coordinate. For variation, use varIndexBase + 3.
// Rotation point (p₂) y coordinate. For variation, use varIndexBase + 5.
PaintVarLinearGradient : PaintTable
func ParsePaintVarLinearGradient(src []byte) (PaintVarLinearGradient, int, error)
(format 7)
// Offset to VarColorLine table, from beginning of PaintVarRadialGradient table.
// Start circle radius. For variation, use varIndexBase + 2.
// End circle radius. For variation, use varIndexBase + 5.
// Base index into DeltaSetIndexMap.
// Start circle center x coordinate. For variation, use varIndexBase + 0.
// End circle center x coordinate. For variation, use varIndexBase + 3.
// Start circle center y coordinate. For variation, use varIndexBase + 1.
// End circle center y coordinate. For variation, use varIndexBase + 4.
PaintVarRadialGradient : PaintTable
func ParsePaintVarRadialGradient(src []byte) (PaintVarRadialGradient, int, error)
(format 25)
// Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.
// Offset to a Paint subtable, from beginning of PaintVarRotate table.
// Base index into DeltaSetIndexMap.
PaintVarRotate : PaintTable
func ParsePaintVarRotate(src []byte) (PaintVarRotate, int, error)
(format 27)
// Rotation angle, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.
// x coordinate for the center of rotation. For variation, use varIndexBase + 1.
// y coordinate for the center of rotation. For variation, use varIndexBase + 2.
// Offset to a Paint subtable, from beginning of PaintVarRotateAroundCenter table.
// Base index into DeltaSetIndexMap.
PaintVarRotateAroundCenter : PaintTable
func ParsePaintVarRotateAroundCenter(src []byte) (PaintVarRotateAroundCenter, int, error)
(format 17)
// Offset to a Paint subtable, from beginning of PaintVarScale table.
// Scale factor in x direction. For variation, use varIndexBase + 0.
// Scale factor in y direction. For variation, use varIndexBase + 1.
// Base index into DeltaSetIndexMap.
PaintVarScale : PaintTable
func ParsePaintVarScale(src []byte) (PaintVarScale, int, error)
(format 19)
// x coordinate for the center of scaling. For variation, use varIndexBase + 2.
// y coordinate for the center of scaling. For variation, use varIndexBase + 3.
// Offset to a Paint subtable, from beginning of PaintVarScaleAroundCenter table.
// Scale factor in x direction. For variation, use varIndexBase + 0.
// Scale factor in y direction. For variation, use varIndexBase + 1.
// Base index into DeltaSetIndexMap.
PaintVarScaleAroundCenter : PaintTable
func ParsePaintVarScaleAroundCenter(src []byte) (PaintVarScaleAroundCenter, int, error)
(format 21)
// Offset to a Paint subtable, from beginning of PaintVarScaleUniform table.
// Scale factor in x and y directions. For variation, use varIndexBase + 0.
// Base index into DeltaSetIndexMap.
PaintVarScaleUniform : PaintTable
func ParsePaintVarScaleUniform(src []byte) (PaintVarScaleUniform, int, error)
(format 23)
// x coordinate for the center of scaling. For variation, use varIndexBase + 1.
// y coordinate for the center of scaling. For variation, use varIndexBase + 2.
// Offset to a Paint subtable, from beginning of PaintVarScaleUniformAroundCenter table.
// Scale factor in x and y directions. For variation, use varIndexBase + 0.
// Base index into DeltaSetIndexMap.
PaintVarScaleUniformAroundCenter : PaintTable
func ParsePaintVarScaleUniformAroundCenter(src []byte) (PaintVarScaleUniformAroundCenter, int, error)
(format 29)
// Offset to a Paint subtable, from beginning of PaintVarSkew table.
// Base index into DeltaSetIndexMap.
// Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.
// Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1.
PaintVarSkew : PaintTable
func ParsePaintVarSkew(src []byte) (PaintVarSkew, int, error)
(format 31)
// x coordinate for the center of rotation. For variation, use varIndexBase + 2.
// y coordinate for the center of rotation. For variation, use varIndexBase + 3.
// Offset to a Paint subtable, from beginning of PaintVarSkewAroundCenter table.
// Base index into DeltaSetIndexMap.
// Angle of skew in the direction of the x-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 0.
// Angle of skew in the direction of the y-axis, 180° in counter-clockwise degrees per 1.0 of value. For variation, use varIndexBase + 1.
PaintVarSkewAroundCenter : PaintTable
func ParsePaintVarSkewAroundCenter(src []byte) (PaintVarSkewAroundCenter, int, error)
(format 3)
// Alpha value. For variation, use varIndexBase + 0.
// Index for a CPAL palette entry.
// Base index into DeltaSetIndexMap.
PaintVarSolid : PaintTable
func ParsePaintVarSolid(src []byte) (PaintVarSolid, int, error)
(format 9)
// Center x coordinate. For variation, use varIndexBase + 0.
// Center y coordinate. For variation, use varIndexBase + 1.
// Offset to VarColorLine table, from beginning of PaintVarSweepGradient table.
// End of the angular range of the gradient: add 1.0 and multiply by 180° to retrieve counter-clockwise degrees. For variation, use varIndexBase + 3.
// Start of the angular range of the gradient: add 1.0 and multiply by 180° to retrieve counter-clockwise degrees. For variation, use varIndexBase + 2.
// Base index into DeltaSetIndexMap.
PaintVarSweepGradient : PaintTable
func ParsePaintVarSweepGradient(src []byte) (PaintVarSweepGradient, int, error)
(format 13)
// Offset to a Paint subtable, from beginning of PaintVarTransform table.
// Offset to a VarAffine2x3 table, from beginning of PaintVarTransform table.
PaintVarTransform : PaintTable
func ParsePaintVarTransform(src []byte) (PaintVarTransform, int, error)
(format 15)
// Translation in x direction. For variation, use varIndexBase + 0.
// Translation in y direction. For variation, use varIndexBase + 1.
// Offset to a Paint subtable, from beginning of PaintVarTranslate table.
// Base index into DeltaSetIndexMap.
PaintVarTranslate : PaintTable
func ParsePaintVarTranslate(src []byte) (PaintVarTranslate, int, error)
Data PairPosData
( PairPos) Cov() Coverage
(*PairPos) Sanitize() error
PairPos : GPOSLookup
func ParsePairPos(src []byte) (PairPos, int, error)
( PairPosData) Cov() Coverage
PairPosData1
PairPosData2
func ParsePairPosData(src []byte) (PairPosData, int, error)
// [pairSetCount] Array of offsets to PairSet tables. Offsets are from beginning of PairPos subtable, ordered by Coverage Index.
// Defines the types of data in valueRecord1 — for the first glyph in the pair (may be zero).
// Defines the types of data in valueRecord2 — for the second glyph in the pair (may be zero).
( PairPosData1) Cov() Coverage
PairPosData1 : PairPosData
func ParsePairPosData1(src []byte) (PairPosData1, int, error)
// Offset to ClassDef table, from beginning of PairPos subtable — for the first glyph of the pair.
// Offset to ClassDef table, from beginning of PairPos subtable — for the second glyph of the pair.
// Defines the types of data in valueRecord1 — for the first glyph in the pair (may be zero).
// Defines the types of data in valueRecord2 — for the second glyph in the pair (may be zero).
( PairPosData2) Cov() Coverage
Record returns the record for the given classes, which must come from ClassDef1
and ClassDef2
PairPosData2 : PairPosData
func ParsePairPosData2(src []byte) (PairPosData2, int, error)
binarygen: argument=valueFormat1 ValueFormat
binarygen: argument=valueFormat2 ValueFormat
FindGlyph performs a binary search in the list, returning the record for `secondGlyph`,
or `nil` if not found.
func ParsePairSet(src []byte, valueFormat1 ValueFormat, valueFormat2 ValueFormat) (PairSet, int, error)
// Glyph ID of second glyph in the pair (first glyph is listed in the Coverage table).
// Positioning data for the first glyph in the pair.
// Positioning data for the second glyph in the pair.
func PairSet.FindGlyph(secondGlyph GlyphID) (PairValueRecord, bool)
PlatformID represents the platform id for entries in the name table.
const PlatformAdobe
const PlatformCustom
const PlatformIso
const PlatformMac
const PlatformMicrosoft
const PlatformUnicode
PostScript table
See https://learn.microsoft.com/en-us/typography/opentype/spec/post
IsFixedPitch indicates that the font is not proportionally spaced
(i.e. monospaced).
Names PostNames
UnderlinePosition is the suggested distance of the top of the
underline from the baseline (negative values indicate below baseline).
Suggested values for the underline thickness.
func ParsePost(src []byte) (Post, int, error)
PostNames10 : PostNames
func ParsePostNames10([]byte) (PostNames10, int, error)
// size numGlyph
Strings []string
PostNames20 : PostNames
func ParsePostNames20(src []byte) (PostNames20, int, error)
PostNames30 : PostNames
func ParsePostNames30([]byte) (PostNames30, int, error)
// Last glyph ID in the range
// Coverage Index of first glyph ID in range
// First glyph ID in the range
// The region end coordinate value for the current axis.
// The region peak coordinate value for the current axis.
// The region start coordinate value for the current axis.
// [backtrackGlyphCount] Array of offsets to coverage tables in backtrack sequence, in glyph sequence order.
// [lookaheadGlyphCount] Array of offsets to coverage tables in lookahead sequence, in glyph sequence order.
// [glyphCount] Array of substitute glyph IDs — ordered by Coverage index.
( ReverseChainSingleSubs) Cov() Coverage
( ReverseChainSingleSubs) Sanitize() error
ReverseChainSingleSubs : GSUBLookup
func ParseReverseChainSingleSubs(src []byte) (ReverseChainSingleSubs, int, error)
Sbix is the Standard Bitmap Graphics Table
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/sbix
Bit 0: Set to 1.
Bit 1: Draw outlines.
Bits 2 to 15: reserved (set to 0).
// [numStrikes] Offsets from the beginning of the 'sbix' table to data for each individual bitmap strike.
func ParseSbix(src []byte, numGlyphs int) (Sbix, int, error)
// Offset to default LangSys table, from beginning of Script table — may be NULL
// same length as langSysRecords
// [langSysCount] Array of LangSysRecords, listed alphabetically by LangSys tag
FindLanguage looks for [language] and return its index into the [LangSys] slice,
or -1 if the tag is not found.
GetLangSys return the language at [index]. It [index] is out of range (for example with 0xFFFF),
it returns [DefaultLangSys] (which may be empty)
func ParseScript(src []byte) (Script, int, error)
// Array of ScriptRecords, listed alphabetically by script tag
Scripts []Script
func ParseScriptList(src []byte) (ScriptList, int, error)
[positionMapCount] The array of axis value map records for this axis.
Each axis value map record provides a single axis-value mapping correspondence.
( SegmentMaps) Map(value Coord) Coord
func ParseSegmentMaps(src []byte) (SegmentMaps, int, error)
// [glyphCount] String of glyph IDs to substitute
func ParseSequence(src []byte) (Sequence, int, error)
// [seqRuleSetCount] Array of offsets to SequenceRuleSet tables, from beginning of SequenceContextFormat1 table (offsets may be NULL)
// Offset to ClassDef table, from beginning of SequenceContextFormat2 table
// [classSeqRuleSetCount] Array of offsets to ClassSequenceRuleSet tables, from beginning of SequenceContextFormat2 table (may be NULL)
// [glyphCount] Array of offsets to Coverage tables, from beginning of SequenceContextFormat3 subtable
// [seqLookupCount] Array of SequenceLookupRecords
// Index (zero-based) into the LookupList
// Index (zero-based) into the input glyph sequence
// [glyphCount - 1] Array of input glyph IDs—starting with the second glyph
// [seqLookupCount] Array of Sequence lookup records
func ParseSequenceRule(src []byte) (SequenceRule, int, error)
// Array of offsets to SequenceRule tables, from beginning of the SequenceRuleSet table
func ParseSequenceRuleSet(src []byte) (SequenceRuleSet, int, error)
// Last character code in this group
// First character code in this group
// Glyph index corresponding to the starting character code
// [numberOfContours] Array of point indices for the last point of each contour, in increasing numeric order.
// [instructionLength] Array of instruction byte code for the glyph.
Points []GlyphContourPoint
SimpleGlyph : GlyphData
func ParseSimpleGlyph(src []byte, endPtsOfContoursCount int) (SimpleGlyph, int, error)
Data SinglePosData
( SinglePos) Cov() Coverage
(*SinglePos) Sanitize() error
SinglePos : GPOSLookup
func ParseSinglePos(src []byte) (SinglePos, int, error)
( SinglePosData) Cov() Coverage
SinglePosData1
SinglePosData2
func ParseSinglePosData(src []byte) (SinglePosData, int, error)
// Defines the types of data in the ValueRecord.
// Defines positioning value(s) — applied to all glyphs in the Coverage table.
( SinglePosData1) Cov() Coverage
SinglePosData1 : SinglePosData
func ParseSinglePosData1(src []byte) (SinglePosData1, int, error)
// Defines the types of data in the ValueRecords.
// [valueCount] Array of ValueRecords — positioning values applied to glyphs.
( SinglePosData2) Cov() Coverage
SinglePosData2 : SinglePosData
func ParseSinglePosData2(src []byte) (SinglePosData2, int, error)
Data SingleSubstData
( SingleSubs) Cov() Coverage
SingleSubs : GSUBLookup
func ParseSingleSubs(src []byte) (SingleSubs, int, error)
( SingleSubstData) Cov() Coverage
SingleSubstData1
SingleSubstData2
func ParseSingleSubstData(src []byte) (SingleSubstData, int, error)
// Offset to Coverage table, from beginning of substitution subtable
// Add to original glyph ID to get substitute glyph ID
( SingleSubstData1) Cov() Coverage
SingleSubstData1 : SingleSubstData
func ParseSingleSubstData1(src []byte) (SingleSubstData1, int, error)
// Offset to Coverage table, from beginning of substitution subtable
// [glyphCount] Array of substitute glyph IDs — ordered by Coverage index
( SingleSubstData2) Cov() Coverage
SingleSubstData2 : SingleSubstData
func ParseSingleSubstData2(src []byte) (SingleSubstData2, int, error)
// Horizontal advance width in pixels.
// Distance in pixels from the horizontal origin to the left edge of the bitmap.
// Distance in pixels from the horizontal origin to the top edge of the bitmap.
// Number of rows of data.
// Number of columns of data.
STAT is the Style Attributes Table
See https://learn.microsoft.com/en-us/typography/opentype/spec/stat
( STAT) Value(tag Tag) (float32, bool)
func ParseSTAT(src []byte) (STAT, int, error)
Strike stores one size of bitmap glyphs in the 'sbix' table.
binarygen: argument=numGlyphs int
// [numGlyphs+1] Offset from the beginning of the strike data header to bitmap data for an individual glyph ID.
// The PPEM size for which this strike was designed.
// The device pixel density (in PPI) for which this strike was designed. (E.g., 96 PPI, 192 PPI.)
func ParseStrike(src []byte, numGlyphs int) (Strike, int, error)
Substitutions []AATLookup
func ParseSubstitutionsTable(src []byte, substitutionsCount int, valuesCount int) (SubstitutionsTable, int, error)
SVG is the SVG (Scalable Vector Graphics) table.
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/svg
// Offset to the SVG Document List, from the start of the SVG table. Must be non-zero.
func ParseSVG(src []byte) (SVG, int, error)
// [numEntries] Array of SVG document records.
SVGRawData []byte
func ParseSVGDocumentList(src []byte) (SVGDocumentList, int, error)
Each SVG document record specifies a range of glyph IDs (from startGlyphID to endGlyphID, inclusive), and the location of its associated SVG document in the SVG table.
// The last glyph ID for the range covered by this record.
// The first glyph ID for the range covered by this record.
// Length of the SVG document data. Must be non-zero.
// Offset from the beginning of the SVGDocumentList to an SVG document. Must be non-zero.
// Offset to object from beginning of list
// 4-byte script tag identifier
// Offset from start of the tracking table to the start of the size subtable.
// Array[nTracks] of TrackTableEntry records.
GetTracking selects the tracking for the given `track` and applies it
for `ptem`. It returns 0 if not found.
func ParseTrackData(src []byte, parentSrc []byte) (TrackData, int, error)
// The 'name' table index for this track (a short word or phrase like "loose" or "very tight"). NameIndex has a value greater than 255 and less than 32768.
// in font units, with length len(SizeTable)
// Track value for this record.
func ParseTrackTableEntry(src []byte, grandParentSrc []byte, perSizeTrackingCount int) (TrackTableEntry, int, error)
Trak is the tracking table.
See - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6trak.html
// Offset from start of tracking table to TrackData for horizontal text (or 0 if none).
// Offset from start of tracking table to TrackData for vertical text (or 0 if none).
IsEmpty return `true` it the table has no entries.
func ParseTrak(src []byte) (Trak, int, error)
// [axisCount] Coordinate array specifying a position within the font’s variation space. The number of elements must match the axisCount specified in the 'fvar' table.
func ParseTuple(src []byte, valuesCount int) (Tuple, int, error)
binarygen: argument=axisCount int
// Intermediate start/end tuple record for this tuple variation table — optional, determined by flags in the tupleIndex value.
Peak tuple record for this tuple variation table — optional, determined by flags in the tupleIndex value.
Note that this must always be included in the 'cvar' table.
// The size in bytes of the serialized data for this tuple variation table.
HasPrivatePointNumbers returns true if the flag 'privatePointNumbers' is on
Index returns the tuple index, after masking
func ParseTupleVariationHeader(src []byte, axisCount int) (TupleVariationHeader, int, error)
// Number of additional values in this range
// uint24 First value in this range
// Glyph ID of the UVS
// uint24 Base Unicode value of the UVS
UVSMappingTable is used in Cmap format 14
See https://learn.microsoft.com/en-us/typography/opentype/spec/cmap#non-default-uvs-table
Ranges []UvsMappingRecord
func ParseUVSMappingTable(src []byte) (UVSMappingTable, int, error)
ValueFormat is a mask indicating which field
are set in a GPOS [ValueRecord].
It is often shared between many records.
func ParsePairSet(src []byte, valueFormat1 ValueFormat, valueFormat2 ValueFormat) (PairSet, int, error)
func ParsePairSet(src []byte, valueFormat1 ValueFormat, valueFormat2 ValueFormat) (PairSet, int, error)
const Devices
const XAdvance
const XAdvDevice
const XPlacement
const XPlaDevice
const YAdvance
const YAdvDevice
const YPlacement
const YPlaDevice
ValueRecord has optional fields
// Offset to Device table (non-variable font) / VariationIndex table (variable font) for horizontal advance, from beginning of the immediate parent table (SinglePos or PairPosFormat2 lookup subtable, PairSet table within a PairPosFormat1 lookup subtable) — may be NULL.
// Horizontal adjustment for advance, in design units — only used for horizontal layout.
// Offset to Device table (non-variable font) / VariationIndex table (variable font) for horizontal placement, from beginning of the immediate parent table (SinglePos or PairPosFormat2 lookup subtable, PairSet table within a PairPosFormat1 lookup subtable) — may be NULL.
// Horizontal adjustment for placement, in design units.
// Offset to Device table (non-variable font) / VariationIndex table (variable font) for vertical advance, from beginning of the immediate parent table (SinglePos or PairPosFormat2 lookup subtable, PairSet table within a PairPosFormat1 lookup su
// Vertical adjustment for advance, in design units — only used for vertical layout.
// Offset to Device table (non-variable font) / VariationIndex table (variable font) for vertical placement, from beginning of the immediate parent table (SinglePos or PairPosFormat2 lookup subtable, PairSet table within a PairPosFormat1 lookup subtable) — may be NULL.
// Vertical adjustment for placement, in design units.
// Translation in x direction. For variation, use varIndexBase + 4.
// Translation in y direction. For variation, use varIndexBase + 5.
// Base index into DeltaSetIndexMap.
// x-component of transformed x-basis vector. For variation, use varIndexBase + 0.
// x-component of transformed y-basis vector. For variation, use varIndexBase + 2.
// y-component of transformed x-basis vector. For variation, use varIndexBase + 1.
// y-component of transformed y-basis vector. For variation, use varIndexBase + 3.
func ParseVarAffine2x3(src []byte) (VarAffine2x3, int, error)
// [numStops] Allows for variations.
// An Extend enum value.
func ParseVarColorLine(src []byte) (VarColorLine, int, error)
// Alpha value. For variation, use varIndexBase + 1.
// Index for a CPAL palette entry.
// Position on a color line. For variation, use varIndexBase + 0.
// Base index into DeltaSetIndexMap
// default position on the axis
// maximum value on the variation axis that the font covers
// mininum value on the variation axis that the font covers
// Tag identifying the design variation for the axis.
Array of region axis coordinates records, in the order of axes given in the 'fvar' table.
Each RegionAxisCoordinates record provides coordinate values for a region along a single axis:
// [axisCount]
Evaluate returns the scalar factor of the region
func ParseVariationRegion(src []byte, regionAxesCount int) (VariationRegion, int, error)
// [regionCount] Array of variation regions.
func ParseVariationRegionList(src []byte) (VariationRegionList, int, error)
// Offset from the start of the format 14 subtable to Default UVS Table. May be 0.
// Offset from the start of the format 14 subtable to Non-Default UVS Table. May be 0.
// uint24 Variation selector
func ParseVariationSelector(src []byte, parentSrc []byte) (VariationSelector, int, error)
VariationStoreIndex reference an item in the variation store
DeltaSetInner uint16
DeltaSetOuter uint16
func DeltaSetMapping.Index(glyph GlyphID) VariationStoreIndex
func ItemVarStore.GetDelta(index VariationStoreIndex, coords []Coord) float32
// A delta-set index — used to select an item variation data subtable within the item variation store.
// Four-byte tag identifying a font-wide measure.
func ParseVarValueRecord(src []byte) (VarValueRecord, int, error)
// Glyph index.
// Y coordinate, in the font’s design coordinate system, of the vertical origin of glyph with index glyphIndex.
VORG is the Vertical Origin Table
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/vorg
// The y coordinate of a glyph’s vertical origin, in the font’s design coordinate system, to be used if no entry is present for the glyph in the vertOriginYMetrics array.
VertOriginYMetrics []VertOriginYMetric
YOrigin returns the vertical origin for [glyph].
func ParseVORG(src []byte) (VORG, int, error)
See - https://learn.microsoft.com/fr-fr/typography/opentype/spec/vvar
HVAR HVAR
// Offset in bytes from the start of this table to the delta-set index mapping for advance widths (may be NULL).
// Offset in bytes from the start of this table to the item variation store table.
// Offset in bytes from the start of this table to the delta-set index mapping for left side bearings (may be NULL).
// Offset in bytes from the start of this table to the delta-set index mapping for right side bearings (may be NULL).
// Offset in bytes from the start of this table to the delta-set index mapping for Y coordinates of vertical origins (may be NULL).
(*VVAR) AdvanceDelta(glyph GlyphID, coords []Coord) float32
(*VVAR) VorgDelta(glyph GlyphID, coords []Coord) float32
func ParseVVAR(src []byte) (VVAR, int, error)
Package-Level Functions (total 273)
DecodeMacintosh decode a Macintosh encoded string
DecodeMacintoshByte returns the rune for the given byte
func Float1616FromUint(v uint32) Float1616 func Float1616ToUint(f Float1616) uint32 func Float214FromUint(v uint16) float32 func ParseAATKernSubtableHeader(src []byte) (AATKernSubtableHeader, int, error) func ParseAATLookupExt(src []byte, valuesCount int) (AATLookupExt, int, error) func ParseAATLookupRecord4(src []byte, parentSrc []byte) (AATLookupRecord4, int, error) func ParseAATLoopkup0(src []byte, valuesCount int) (AATLoopkup0, int, error) func ParseAATLoopkup10(src []byte) (AATLoopkup10, int, error) func ParseAATLoopkup2(src []byte) (AATLoopkup2, int, error) func ParseAATLoopkup4(src []byte) (AATLoopkup4, int, error) func ParseAATLoopkup6(src []byte) (AATLoopkup6, int, error) func ParseAATLoopkup8(src []byte) (AATLoopkup8, int, error) func ParseAATLoopkup8Data(src []byte) (AATLoopkup8Data, int, error) func ParseAATLoopkupExt0(src []byte, valuesCount int) (AATLoopkupExt0, int, error) func ParseAATLoopkupExt10(src []byte) (AATLoopkupExt10, int, error) func ParseAATLoopkupExt2(src []byte) (AATLoopkupExt2, int, error) func ParseAATLoopkupExt4(src []byte) (AATLoopkupExt4, int, error) func ParseAATLoopkupExt6(src []byte) (AATLoopkupExt6, int, error) func ParseAATLoopkupExt8(src []byte) (AATLoopkupExt8, int, error) func ParseAATStateTable(src []byte) (AATStateTable, int, error) func ParseAATStateTableExt(src []byte, valuesCount int, entryDataSize int) (AATStateTableExt, int, error) func ParseAffine2x3(src []byte) (Affine2x3, int, error) func ParseAlternateSet(src []byte) (AlternateSet, int, error) func ParseAlternateSubs(src []byte) (AlternateSubs, int, error) func ParseAnchor(src []byte) (Anchor, int, error) func ParseAnchorFormat1(src []byte) (AnchorFormat1, int, error) func ParseAnchorFormat2(src []byte) (AnchorFormat2, int, error) func ParseAnchorFormat3(src []byte) (AnchorFormat3, int, error) func ParseAnkrAnchor(src []byte) (AnkrAnchor, int, error) func ParseAttachList(src []byte) (AttachList, int, error) func ParseAttachPoint(src []byte) (AttachPoint, int, error) func ParseAxisValue(src []byte) (AxisValue, int, error) func ParseAxisValue1(src []byte) (AxisValue1, int, error) func ParseAxisValue2(src []byte) (AxisValue2, int, error) func ParseAxisValue3(src []byte) (AxisValue3, int, error) func ParseAxisValue4(src []byte) (AxisValue4, int, error) func ParseAxisValueArray(src []byte, valuesCount int) (AxisValueArray, int, error) func ParseBitmapData17(src []byte) (BitmapData17, int, error) func ParseBitmapData18(src []byte) (BitmapData18, int, error) func ParseBitmapData19(src []byte) (BitmapData19, int, error) func ParseBitmapData2(src []byte) (BitmapData2, int, error) func ParseBitmapData5(src []byte) (BitmapData5, int, error) func ParseBitmapGlyphData(src []byte) (BitmapGlyphData, int, error) func ParseCaretValue(src []byte) (CaretValue, int, error) func ParseCaretValue1(src []byte) (CaretValue1, int, error) func ParseCaretValue2(src []byte) (CaretValue2, int, error) func ParseCaretValue3(src []byte) (CaretValue3, int, error) func ParseChainedContextualPos(src []byte) (ChainedContextualPos, int, error) func ParseChainedContextualPos1(src []byte) (ChainedContextualPos1, int, error) func ParseChainedContextualPos2(src []byte) (ChainedContextualPos2, int, error) func ParseChainedContextualPos3(src []byte) (ChainedContextualPos3, int, error) func ParseChainedContextualPosITF(src []byte) (ChainedContextualPosITF, int, error) func ParseChainedContextualSubs(src []byte) (ChainedContextualSubs, int, error) func ParseChainedContextualSubs1(src []byte) (ChainedContextualSubs1, int, error) func ParseChainedContextualSubs2(src []byte) (ChainedContextualSubs2, int, error) func ParseChainedContextualSubs3(src []byte) (ChainedContextualSubs3, int, error) func ParseChainedContextualSubsITF(src []byte) (ChainedContextualSubsITF, int, error) func ParseChainedSequenceRule(src []byte) (ChainedSequenceRule, int, error) func ParseChainedSequenceRuleSet(src []byte) (ChainedSequenceRuleSet, int, error) func ParseClassDef(src []byte) (ClassDef, int, error) func ParseClassDef1(src []byte) (ClassDef1, int, error) func ParseClassDef2(src []byte) (ClassDef2, int, error) func ParseClassTable(src []byte) (ClassTable, int, error) func ParseClipBox(src []byte) (ClipBox, int, error) func ParseClipBoxFormat1(src []byte) (ClipBoxFormat1, int, error) func ParseClipBoxFormat2(src []byte) (ClipBoxFormat2, int, error) func ParseClipList(src []byte) (ClipList, int, error) func ParseCmapSubtable(src []byte) (CmapSubtable, int, error) func ParseCmapSubtable0(src []byte) (CmapSubtable0, int, error) func ParseCmapSubtable10(src []byte) (CmapSubtable10, int, error) func ParseCmapSubtable12(src []byte) (CmapSubtable12, int, error) func ParseCmapSubtable13(src []byte) (CmapSubtable13, int, error) func ParseCmapSubtable14(src []byte) (CmapSubtable14, int, error) func ParseCmapSubtable2(src []byte) (CmapSubtable2, int, error) func ParseCmapSubtable4(src []byte) (CmapSubtable4, int, error) func ParseCmapSubtable6(src []byte) (CmapSubtable6, int, error) func ParseColorLine(src []byte) (ColorLine, int, error) func ParseCOLR1(src []byte) (COLR1, int, error) func ParseCompositeGlyph(src []byte) (CompositeGlyph, int, error) func ParseCompositeGlyphPart(src []byte) (CompositeGlyphPart, int, error) func ParseConditionFormat1(src []byte) (ConditionFormat1, int, error) func ParseConditionSet(src []byte) (ConditionSet, int, error) func ParseContextualPos(src []byte) (ContextualPos, int, error) func ParseContextualPos1(src []byte) (ContextualPos1, int, error) func ParseContextualPos2(src []byte) (ContextualPos2, int, error) func ParseContextualPos3(src []byte) (ContextualPos3, int, error) func ParseContextualPosITF(src []byte) (ContextualPosITF, int, error) func ParseContextualSubs(src []byte) (ContextualSubs, int, error) func ParseContextualSubs1(src []byte) (ContextualSubs1, int, error) func ParseContextualSubs2(src []byte) (ContextualSubs2, int, error) func ParseContextualSubs3(src []byte) (ContextualSubs3, int, error) func ParseContextualSubsITF(src []byte) (ContextualSubsITF, int, error) func ParseCoverage(src []byte) (Coverage, int, error) func ParseCoverage1(src []byte) (Coverage1, int, error) func ParseCoverage2(src []byte) (Coverage2, int, error) func ParseCursivePos(src []byte) (CursivePos, int, error) func ParseDefaultUVSTable(src []byte) (DefaultUVSTable, int, error) func ParseDeltaSetMapping(src []byte) (DeltaSetMapping, int, error) func ParseDeviceTableHeader(src []byte) (DeviceTableHeader, int, error) func ParseEncodingRecord(src []byte, parentSrc []byte) (EncodingRecord, int, error) func ParseEntryExit(src []byte) (EntryExit, int, error) func ParseExtensionPos(src []byte) (ExtensionPos, int, error) func ParseExtensionSubs(src []byte) (ExtensionSubs, int, error) func ParseFeature(src []byte) (Feature, int, error) func ParseFeatureList(src []byte) (FeatureList, int, error) func ParseFeatureName(src []byte, parentSrc []byte) (FeatureName, int, error) func ParseFeatureTableSubstitution(src []byte) (FeatureTableSubstitution, int, error) func ParseFeatureTableSubstitutionRecord(src []byte, parentSrc []byte) (FeatureTableSubstitutionRecord, int, error) func ParseFeatureVariation(src []byte) (FeatureVariation, int, error) func ParseFeatureVariationRecord(src []byte, parentSrc []byte) (FeatureVariationRecord, int, error) func ParseFvarRecords(src []byte, axisCount int, instanceCount int, instanceSize int) (FvarRecords, int, error)
ParseGlyf parses the 'glyf' table.
locaOffsets has length numGlyphs + 1, and is returned by ParseLoca
func ParseGlyph(src []byte) (Glyph, int, error) func ParseGlyphContourPoint(src []byte) (GlyphContourPoint, int, error) func ParseGlyphVariationData(src []byte, axisCount int) (GlyphVariationData, int, error) func ParseIndexData1(src []byte, sbitOffsetsCount int) (IndexData1, int, error) func ParseIndexData2(src []byte) (IndexData2, int, error) func ParseIndexData3(src []byte, sbitOffsetsCount int) (IndexData3, int, error) func ParseIndexData4(src []byte) (IndexData4, int, error) func ParseIndexData5(src []byte) (IndexData5, int, error) func ParseIndexSubHeader(src []byte, sbitOffsetsCount int) (IndexSubHeader, int, error) func ParseIndexSubTableArray(src []byte, subtablesCount int) (IndexSubTableArray, int, error) func ParseInstanceRecord(src []byte, coordinatesCount int) (InstanceRecord, int, error) func ParseItemVariationData(src []byte) (ItemVariationData, int, error) func ParseItemVarStore(src []byte) (ItemVarStore, int, error)
We apply the following logic:
- read the first uint16 -> it's always the major version
- if it's 0, we have a Miscrosoft table
- if it's 1, we have an Apple table. We read the next uint16,
to differentiate between the old and the new Apple format.
func ParseKernData0(src []byte) (KernData0, int, error) func ParseKernData1(src []byte) (KernData1, int, error) func ParseKernData3(src []byte) (KernData3, int, error) func ParseKerxAnchorAnchors(src []byte, anchorsCount int) (KerxAnchorAnchors, int, error) func ParseKerxAnchorControls(src []byte, anchorsCount int) (KerxAnchorControls, int, error) func ParseKerxAnchorCoordinates(src []byte, anchorsCount int) (KerxAnchorCoordinates, int, error) func ParseKerxData6(src []byte, parentSrc []byte, tupleCount int, valuesCount int) (KerxData6, int, error) func ParseKerxSubtable(src []byte, valuesCount int) (KerxSubtable, int, error) func ParseLangSys(src []byte) (LangSys, int, error) func ParseLayerList(src []byte) (LayerList, int, error) func ParseLayout(src []byte) (Layout, int, error) func ParseLigature(src []byte) (Ligature, int, error) func ParseLigatureArray(src []byte, offsetsCount int) (LigatureArray, int, error) func ParseLigatureAttach(src []byte, offsetsCount int) (LigatureAttach, int, error) func ParseLigatureSet(src []byte) (LigatureSet, int, error) func ParseLigatureSubs(src []byte) (LigatureSubs, int, error) func ParseLigCaretList(src []byte) (LigCaretList, int, error) func ParseLigGlyph(src []byte) (LigGlyph, int, error)
shared with gvar, sbix, eblc
return an error only if data is not long enough
func ParseLookup(src []byte) (Lookup, int, error) func ParseMark2Array(src []byte, offsetsCount int) (Mark2Array, int, error) func ParseMarkArray(src []byte) (MarkArray, int, error) func ParseMarkBasePos(src []byte) (MarkBasePos, int, error) func ParseMarkGlyphSets(src []byte) (MarkGlyphSets, int, error) func ParseMarkLigPos(src []byte) (MarkLigPos, int, error) func ParseMarkMarkPos(src []byte) (MarkMarkPos, int, error) func ParseMorxChainSubtable(src []byte, valuesCount int) (MorxChainSubtable, int, error) func ParseMorxSubtableContextual(src []byte, valuesCount int) (MorxSubtableContextual, int, error) func ParseMorxSubtableInsertion(src []byte, valuesCount int) (MorxSubtableInsertion, int, error) func ParseMorxSubtableLigature(src []byte, valuesCount int) (MorxSubtableLigature, int, error) func ParseMorxSubtableNonContextual(src []byte, valuesCount int) (MorxSubtableNonContextual, int, error) func ParseMorxSubtableRearrangement(src []byte, valuesCount int) (MorxSubtableRearrangement, int, error) func ParseMultipleSubs(src []byte) (MultipleSubs, int, error) func ParseOTKernSubtableHeader(src []byte) (OTKernSubtableHeader, int, error) func ParsePaintColrGlyph(src []byte) (PaintColrGlyph, int, error) func ParsePaintColrLayers(src []byte) (PaintColrLayers, int, error) func ParsePaintComposite(src []byte) (PaintComposite, int, error) func ParsePaintGlyph(src []byte) (PaintGlyph, int, error) func ParsePaintLinearGradient(src []byte) (PaintLinearGradient, int, error) func ParsePaintRadialGradient(src []byte) (PaintRadialGradient, int, error) func ParsePaintRotate(src []byte) (PaintRotate, int, error) func ParsePaintRotateAroundCenter(src []byte) (PaintRotateAroundCenter, int, error) func ParsePaintScale(src []byte) (PaintScale, int, error) func ParsePaintScaleAroundCenter(src []byte) (PaintScaleAroundCenter, int, error) func ParsePaintScaleUniform(src []byte) (PaintScaleUniform, int, error) func ParsePaintScaleUniformAroundCenter(src []byte) (PaintScaleUniformAroundCenter, int, error) func ParsePaintSkew(src []byte) (PaintSkew, int, error) func ParsePaintSkewAroundCenter(src []byte) (PaintSkewAroundCenter, int, error) func ParsePaintSolid(src []byte) (PaintSolid, int, error) func ParsePaintSweepGradient(src []byte) (PaintSweepGradient, int, error) func ParsePaintTable(src []byte) (PaintTable, int, error) func ParsePaintTransform(src []byte) (PaintTransform, int, error) func ParsePaintTranslate(src []byte) (PaintTranslate, int, error) func ParsePaintVarLinearGradient(src []byte) (PaintVarLinearGradient, int, error) func ParsePaintVarRadialGradient(src []byte) (PaintVarRadialGradient, int, error) func ParsePaintVarRotate(src []byte) (PaintVarRotate, int, error) func ParsePaintVarRotateAroundCenter(src []byte) (PaintVarRotateAroundCenter, int, error) func ParsePaintVarScale(src []byte) (PaintVarScale, int, error) func ParsePaintVarScaleAroundCenter(src []byte) (PaintVarScaleAroundCenter, int, error) func ParsePaintVarScaleUniform(src []byte) (PaintVarScaleUniform, int, error) func ParsePaintVarScaleUniformAroundCenter(src []byte) (PaintVarScaleUniformAroundCenter, int, error) func ParsePaintVarSkew(src []byte) (PaintVarSkew, int, error) func ParsePaintVarSkewAroundCenter(src []byte) (PaintVarSkewAroundCenter, int, error) func ParsePaintVarSolid(src []byte) (PaintVarSolid, int, error) func ParsePaintVarSweepGradient(src []byte) (PaintVarSweepGradient, int, error) func ParsePaintVarTransform(src []byte) (PaintVarTransform, int, error) func ParsePaintVarTranslate(src []byte) (PaintVarTranslate, int, error) func ParsePairPos(src []byte) (PairPos, int, error) func ParsePairPosData(src []byte) (PairPosData, int, error) func ParsePairPosData1(src []byte) (PairPosData1, int, error) func ParsePairPosData2(src []byte) (PairPosData2, int, error) func ParsePairSet(src []byte, valueFormat1 ValueFormat, valueFormat2 ValueFormat) (PairSet, int, error) func ParsePostNames10([]byte) (PostNames10, int, error) func ParsePostNames20(src []byte) (PostNames20, int, error) func ParsePostNames30([]byte) (PostNames30, int, error) func ParseReverseChainSingleSubs(src []byte) (ReverseChainSingleSubs, int, error) func ParseScript(src []byte) (Script, int, error) func ParseScriptList(src []byte) (ScriptList, int, error) func ParseSegmentMaps(src []byte) (SegmentMaps, int, error) func ParseSequence(src []byte) (Sequence, int, error) func ParseSequenceRule(src []byte) (SequenceRule, int, error) func ParseSequenceRuleSet(src []byte) (SequenceRuleSet, int, error) func ParseSimpleGlyph(src []byte, endPtsOfContoursCount int) (SimpleGlyph, int, error) func ParseSinglePos(src []byte) (SinglePos, int, error) func ParseSinglePosData(src []byte) (SinglePosData, int, error) func ParseSinglePosData1(src []byte) (SinglePosData1, int, error) func ParseSinglePosData2(src []byte) (SinglePosData2, int, error) func ParseSingleSubs(src []byte) (SingleSubs, int, error) func ParseSingleSubstData(src []byte) (SingleSubstData, int, error) func ParseSingleSubstData1(src []byte) (SingleSubstData1, int, error) func ParseSingleSubstData2(src []byte) (SingleSubstData2, int, error) func ParseSubstitutionsTable(src []byte, substitutionsCount int, valuesCount int) (SubstitutionsTable, int, error) func ParseSVGDocumentList(src []byte) (SVGDocumentList, int, error) func ParseTrackTableEntry(src []byte, grandParentSrc []byte, perSizeTrackingCount int) (TrackTableEntry, int, error) func ParseTupleVariationHeader(src []byte, axisCount int) (TupleVariationHeader, int, error)
ParseUint16s interprets data as a (big endian) uint16 slice.
It returns an error if [data] is not long enough for the given [count].
func ParseUVSMappingTable(src []byte) (UVSMappingTable, int, error) func ParseVarAffine2x3(src []byte) (VarAffine2x3, int, error) func ParseVarColorLine(src []byte) (VarColorLine, int, error) func ParseVariationRegion(src []byte, regionAxesCount int) (VariationRegion, int, error) func ParseVariationRegionList(src []byte) (VariationRegionList, int, error) func ParseVariationSelector(src []byte, parentSrc []byte) (VariationSelector, int, error) func ParseVarValueRecord(src []byte) (VarValueRecord, int, error)
Package-Level Constants (total 89)
Porter-Duff modes
const CompositeColorBurn CompositeMode = 18 // color-burn const CompositeColorDodge CompositeMode = 17 // color-dodge const CompositeDarken CompositeMode = 15 // darken const CompositeDest CompositeMode = 2 // Destination const CompositeDestAtop CompositeMode = 10 // Destination Atop const CompositeDestIn CompositeMode = 6 // Destination In const CompositeDestOut CompositeMode = 8 // Destination Out const CompositeDestOver CompositeMode = 4 // Destination Over const CompositeDifference CompositeMode = 21 // difference const CompositeExclusion CompositeMode = 22 // exclusion const CompositeHardLight CompositeMode = 19 // hard-light const CompositeHslColor CompositeMode = 26 // color
Non-separable color blend modes:
const CompositeHslLuminosity CompositeMode = 27 // luminosity const CompositeHslSaturation CompositeMode = 25 // saturation const CompositeLighten CompositeMode = 16 // lighten const CompositeMultiply CompositeMode = 23 // multiply const CompositeOverlay CompositeMode = 14 // overlay const CompositePlus CompositeMode = 12 // Plus (“Lighter” in Composition & Blending Level 1)
Separable color blend modes:
const CompositeSoftLight CompositeMode = 20 // soft-light const CompositeSrc CompositeMode = 1 // Source (“Copy” in Composition & Blending Level 1) const CompositeSrcAtop CompositeMode = 9 // Source Atop const CompositeSrcIn CompositeMode = 5 // Source In const CompositeSrcOut CompositeMode = 7 // Source Out const CompositeSrcOver CompositeMode = 3 // Source Over const CompositeXor CompositeMode = 11 // XOR
Mask for having any Device table
const ExtendReflect Extend = 2 // Mirror color line from nearest end. const ExtendRepeat Extend = 1 // Repeat from farthest color stop. const FPOemArabic FontPage = 46080 // OEM Arabic Windows 3.1 font page const FPSimpArabic FontPage = 45568 // Simplified Arabic Windows 3.1 font page const FPSimpFarsi FontPage = 47616 // Simplified Farsi Windows 3.1 font page const FPTradArabic FontPage = 45824 // Traditional Arabic Windows 3.1 font page const FPTradFarsi FontPage = 47872 // Traditional Farsi Windows 3.1 font page const GPBaseGlyph GlyphProps = 2 const GPLigature GlyphProps = 4 const GPMark GlyphProps = 8
Kernx1 state entry flags
Kernx1 state entry flags
Kernx1 state entry flags
Kernx1 state entry flags
If set, specifies that insertions are to be made
to the left of the current glyph. If clear,
they're made to the right of the current glyph.
This 5-bit field is treated as a count of the
number of glyphs to insert at the current
position. Since zero means no insertions, the
largest number of insertions at any given
current location is 31 glyphs.
If set, and the currentInsertList is nonzero,
then the specified glyph list will be inserted
as a kashida-like insertion, either before or
after the current glyph (depending on the state
of the currentInsertBefore flag). If clear, and
the currentInsertList is nonzero, then the
specified glyph list will be inserted as a
split-vowel-like insertion, either before or
after the current glyph (depending on the state
of the currentInsertBefore flag).
If set, don't advance to the next glyph before
going to the new state. This does not mean
that the glyph pointed to is the same one as
before. If you've made insertions immediately
downstream of the current glyph, the next glyph
processed would in fact be the first one
inserted.
If set, specifies that insertions are to be
made to the left of the marked glyph. If clear,
they're made to the right of the marked glyph.
This 5-bit field is treated as a count of the
number of glyphs to insert at the marked
position. Since zero means no insertions, the
largest number of insertions at any given
marked location is 31 glyphs.
If set, and the markedInsertList is nonzero,
then the specified glyph list will be inserted
as a kashida-like insertion, either before or
after the marked glyph (depending on the state
of the markedInsertBefore flag). If clear, and
the markedInsertList is nonzero, then the
specified glyph list will be inserted as a
split-vowel-like insertion, either before or
after the marked glyph (depending on the state
of the markedInsertBefore flag).
If set, mark the current glyph.
This is the last action in the list. This also
implies storage.
A 30-bit value which is sign-extended to 32-bits
and added to the glyph ID, resulting in an index
into the component table.
Store the ligature at the current cumulated index
in the ligature table in place of the marked
(i.e. currently-popped) glyph.
Leave the glyph pointer at this glyph for the
next iteration.
Byte offset from beginning of subtable to the
ligature action list. This value must be a
multiple of 4.
Use the ligActionIndex to process a ligature group.
Push this glyph onto the component stack for
eventual processing.
const PEMacRoman EncodingID = 0 const PEMicrosoftSymbolCs EncodingID = 0 const PEMicrosoftUcs4 EncodingID = 10 const PEMicrosoftUnicodeCs EncodingID = 1 const PEUnicodeBMP EncodingID = 3 const PEUnicodeDefault EncodingID = 0 const PEUnicodeFull EncodingID = 4 const PEUnicodeFull13 EncodingID = 6 const PlatformAdobe PlatformID = 7 // artificial const PlatformCustom PlatformID = 4 const PlatformIso PlatformID = 2 // deprecated const PlatformMac PlatformID = 1 const PlatformMicrosoft PlatformID = 3 const PlatformUnicode PlatformID = 0 const XAdvance ValueFormat = 4 // Includes horizontal adjustment for advance const XAdvDevice ValueFormat = 64 // Includes horizontal Device table for advance const XPlacement ValueFormat = 1 // Includes horizontal adjustment for placement const XPlaDevice ValueFormat = 16 // Includes horizontal Device table for placement const YAdvance ValueFormat = 8 // Includes vertical adjustment for advance const YAdvDevice ValueFormat = 128 // Includes vertical Device table for advance const YPlacement ValueFormat = 2 // Includes vertical adjustment for placement const YPlaDevice ValueFormat = 32 // Includes vertical Device table for placement
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |