Skip to content

@pdfa-lab/fontkit / GSUBProcessor

Class: GSUBProcessor<T> ​

Defined in: src/open-type/gsub-processor.ts:11

Applies OpenType GSUB lookups (substitutions) to a glyph buffer. Supports lookup types 1–7, delegating contextual (5) and chaining contextual (6) lookups to OTProcessor, and recursively resolving extension substitutions (7).

Extends ​

Type Parameters ​

Type Parameter
T

Constructors ​

Constructor ​

new GSUBProcessor<T>(font, table): GSUBProcessor<T>

Defined in: src/open-type/open-type-processor.ts:35

Parameters ​

ParameterType
fontTrueTypeFont
tableGPOS | GSUB

Returns ​

GSUBProcessor<T>

Inherited from ​

OpenTypeProcessor.constructor

Properties ​

PropertyModifierTypeInherited fromDefined in
directionprotectedBidiDirection | undefinedOpenTypeProcessor.directionsrc/open-type/open-type-processor.ts:32
featurespublicPartial<Record<FeatureTag, Feature>>OpenTypeProcessor.featuressrc/open-type/open-type-processor.ts:26
fontprotectedTrueTypeFontOpenTypeProcessor.fontsrc/open-type/open-type-processor.ts:20
glyphIteratorprotectedGlyphIterator<T> | undefinedOpenTypeProcessor.glyphIteratorsrc/open-type/open-type-processor.ts:33
glyphsprotectedGlyphInfo<T>[]OpenTypeProcessor.glyphssrc/open-type/open-type-processor.ts:28
ligatureIDprotectednumberOpenTypeProcessor.ligatureIDsrc/open-type/open-type-processor.ts:30
positions?protectedGlyphPosition[]OpenTypeProcessor.positionssrc/open-type/open-type-processor.ts:29

Methods ​

applyChainingContext() ​

protected applyChainingContext(table): boolean

Defined in: src/open-type/open-type-processor.ts:491

Parameters ​

ParameterType
tableChainingContext

Returns ​

boolean

Inherited from ​

OpenTypeProcessor.applyChainingContext


applyContext() ​

protected applyContext(table): boolean

Defined in: src/open-type/open-type-processor.ts:439

Parameters ​

ParameterType
tableContext

Returns ​

boolean

Inherited from ​

OpenTypeProcessor.applyContext


applyFeatures() ​

applyFeatures(userFeatures, glyphs, advances?): void

Defined in: src/open-type/open-type-processor.ts:242

Parameters ​

ParameterType
userFeatureskeyof Features[]
glyphsGlyphInfo<T>[]
advances?GlyphPosition[]

Returns ​

void

Inherited from ​

OpenTypeProcessor.applyFeatures


applyLookup() ​

applyLookup(lookupType, table): boolean

Defined in: src/open-type/gsub-processor.ts:12

Parameters ​

ParameterType
lookupTypenumber
tableLookupTable

Returns ​

boolean

Overrides ​

OpenTypeProcessor.applyLookup


coverageIndex() ​

protected coverageIndex(coverage, glyph?): number

Defined in: src/open-type/open-type-processor.ts:317

Parameters ​

ParameterType
coverageCoverage
glyph?number

Returns ​

number

Inherited from ​

OpenTypeProcessor.coverageIndex


getClassID() ​

getClassID(glyph, classDef): number

Defined in: src/open-type/open-type-processor.ts:402

Parameters ​

ParameterType
glyphnumber
classDefClassDef

Returns ​

number

Inherited from ​

OpenTypeProcessor.getClassID


selectScript() ​

selectScript(script?, language?, direction?): string | null

Defined in: src/open-type/open-type-processor.ts:82

Parameters ​

ParameterType
script?string
language?string | null
direction?BidiDirection

Returns ​

string | null

Inherited from ​

OpenTypeProcessor.selectScript


sequenceMatchIndices() ​

protected sequenceMatchIndices(sequenceIndex, sequence): boolean | number[]

Defined in: src/open-type/open-type-processor.ts:374

Parameters ​

ParameterType
sequenceIndexnumber
sequencenumber[]

Returns ​

boolean | number[]

Inherited from ​

OpenTypeProcessor.sequenceMatchIndices