@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 Parameter | Default type |
|---|---|
T | null |
Constructors ​
Constructor ​
new ShapingPlan<
T>(font,script?,direction?):ShapingPlan<T>
Defined in: src/open-type/shaping-plan.ts:41
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
font | TrueTypeFont | undefined |
script? | OpenTypeTag | undefined |
direction? | BidiDirection | 'ltr' |
Returns ​
ShapingPlan<T>
Properties ​
| Property | Modifier | Type | Defined in |
|---|---|---|---|
allFeatures | readonly | Record<FeatureTag, number> | src/open-type/shaping-plan.ts:35 |
font | public | TrueTypeFont | src/open-type/shaping-plan.ts:42 |
indicConfig? | public | IndicConfig | src/open-type/shaping-plan.ts:38 |
isOldSpec? | public | boolean | src/open-type/shaping-plan.ts:39 |
script? | readonly | OpenTypeTag | src/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 ​
Methods ​
add() ​
add(
arg,global?):void
Defined in: src/open-type/shaping-plan.ts:78
Add features to the last stage
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
arg | FeatureShape | undefined |
global | boolean | true |
Returns ​
void
addStage() ​
addStage(
arg,global?):void
Defined in: src/open-type/shaping-plan.ts:100
Add a new stage
Parameters ​
| Parameter | Type |
|---|---|
arg | FeatureShape | 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 ​
| Parameter | Type |
|---|---|
glyphs | GlyphInfo<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 ​
| Parameter | Type |
|---|---|
processor | OpenTypeProcessor<T> |
glyphs | GlyphInfo<T>[] |
positions? | GlyphPosition[] |
Returns ​
void
setFeatureOverrides() ​
setFeatureOverrides(
features):void
Defined in: src/open-type/shaping-plan.ts:111
Parameters ​
| Parameter | Type |
|---|---|
features | Partial<Record<keyof Features, boolean>> | keyof Features[] |
Returns ​
void