Skip to content

@pdfa-lab/fontkit / ShapingPlan

Class: ShapingPlan<T> ​

Defined in: src/open-type/shaping-plan.ts:32

ShapingPlans are used by the OpenType shapers to store which features should by applied, and in what order to apply them. The features are applied in groups called stages. A feature can be applied globally to all glyphs, or locally to only specific glyphs.

Type Parameters ​

Type ParameterDefault type
Tnull

Constructors ​

Constructor ​

new ShapingPlan<T>(font, script?, direction?): ShapingPlan<T>

Defined in: src/open-type/shaping-plan.ts:41

Parameters ​

ParameterTypeDefault value
fontTrueTypeFontundefined
script?OpenTypeTagundefined
direction?BidiDirection'ltr'

Returns ​

ShapingPlan<T>

Properties ​

PropertyModifierTypeDefined in
allFeaturesreadonlyRecord<FeatureTag, number>src/open-type/shaping-plan.ts:35
fontpublicTrueTypeFontsrc/open-type/shaping-plan.ts:42
indicConfig?publicIndicConfigsrc/open-type/shaping-plan.ts:38
isOldSpec?publicbooleansrc/open-type/shaping-plan.ts:39
script?readonlyOpenTypeTagsrc/open-type/shaping-plan.ts:43
unicodeScript?public"Caucasian_Albanian" | "Arabic" | "Imperial_Aramaic" | "Armenian" | "Avestan" | "Balinese" | "Bamum" | "Bassa_Vah" | "Batak" | "Bengali" | "Bopomofo" | "Brahmi" | "Braille" | "Buginese" | "Buhid" | "Chakma" | "Canadian_Aboriginal" | "Carian" | "Cham" | "Cherokee" | "Coptic" | "Cypriot" | "Cyrillic" | "Devanagari" | "Deseret" | "Duployan" | "Egyptian_Hieroglyphs" | "Elbasan" | "Ethiopic" | "Georgian" | "Glagolitic" | "Gothic" | "Grantha" | "Greek" | "Gujarati" | "Gurmukhi" | "Hangul" | "Han" | "Hanunoo" | "Hebrew" | "Hiragana" | "Pahawh_Hmong" | "Katakana_Or_Hiragana" | "Old_Italic" | "Javanese" | "Kayah_Li" | "Katakana" | "Kharoshthi" | "Khmer" | "Khojki" | "Kannada" | "Kaithi" | "Tai_Tham" | "Lao" | "Latin" | "Lepcha" | "Limbu" | "Linear_A" | "Linear_B" | "Lisu" | "Lycian" | "Lydian" | "Mahajani" | "Mandaic" | "Manichaean" | "Mende_Kikakui" | "Meroitic_Cursive" | "Meroitic_Hieroglyphs" | "Malayalam" | "Modi" | "Mongolian" | "Mro" | "Meetei_Mayek" | "Myanmar" | "Old_North_Arabian" | "Nabataean" | "Nko" | "Ogham" | "Ol_Chiki" | "Old_Turkic" | "Oriya" | "Osmanya" | "Palmyrene" | "Pau_Cin_Hau" | "Old_Permic" | "Phags_Pa" | "Inscriptional_Pahlavi" | "Psalter_Pahlavi" | "Phoenician" | "Miao" | "Inscriptional_Parthian" | "Rejang" | "Runic" | "Samaritan" | "Old_South_Arabian" | "Saurashtra" | "Shavian" | "Sharada" | "Siddham" | "Khudawadi" | "Sinhala" | "Sora_Sompeng" | "Sundanese" | "Syloti_Nagri" | "Syriac" | "Tagbanwa" | "Takri" | "Tai_Le" | "New_Tai_Lue" | "Tamil" | "Tai_Viet" | "Telugu" | "Tifinagh" | "Tagalog" | "Thaana" | "Thai" | "Tibetan" | "Tirhuta" | "Ugaritic" | "Vai" | "Warang_Citi" | "Old_Persian" | "Cuneiform" | "Yi" | "Inherited" | "Common" | "Unknown"src/open-type/shaping-plan.ts:37

Accessors ​

direction ​

Get Signature ​

get direction(): BidiDirection

Defined in: src/open-type/shaping-plan.ts:52

Returns ​

BidiDirection

Methods ​

add() ​

add(arg, global?): void

Defined in: src/open-type/shaping-plan.ts:78

Add features to the last stage

Parameters ​

ParameterTypeDefault value
argFeatureShapeundefined
globalbooleantrue

Returns ​

void


addStage() ​

addStage(arg, global?): void

Defined in: src/open-type/shaping-plan.ts:100

Add a new stage

Parameters ​

ParameterType
argFeatureShape | ShapingFunction<T>
global?boolean

Returns ​

void


assignGlobalFeatures() ​

assignGlobalFeatures(glyphs): void

Defined in: src/open-type/shaping-plan.ts:138

Assigns the global features to the given glyphs

Parameters ​

ParameterType
glyphsGlyphInfo<T>[]

Returns ​

void


process() ​

process(processor, glyphs, positions?): void

Defined in: src/open-type/shaping-plan.ts:149

Executes the planned stages using the given OTProcessor

Parameters ​

ParameterType
processorOpenTypeProcessor<T>
glyphsGlyphInfo<T>[]
positions?GlyphPosition[]

Returns ​

void


setFeatureOverrides() ​

setFeatureOverrides(features): void

Defined in: src/open-type/shaping-plan.ts:111

Parameters ​

ParameterType
featuresPartial<Record<keyof Features, boolean>> | keyof Features[]

Returns ​

void