@pdfa-lab/fontkit / GlyphRun
Class: GlyphRun ​
Defined in: src/layout/glyph-run.ts:14
Represents a run of Glyph and GlyphPosition objects. Returned by the font layout method.
Constructors ​
Constructor ​
new GlyphRun(
glyphs,features,script?,language?,direction?):GlyphRun
Defined in: src/layout/glyph-run.ts:34
Create a glyph run.
The script was either passed in or detected automatically.
If no language is passed, the default language for the script is used
Parameters ​
| Parameter | Type | Description |
|---|---|---|
glyphs | Glyph[] | an array of Glyph objects in the run. |
features | Features | keyof Features[] | - |
script? | OpenTypeTag | the script that was requested for shaping |
language? | string | the language as requested for shaping |
direction? | "ltr" | "rtl" | - |
Returns ​
GlyphRun
Properties ​
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
direction | readonly | BidiDirection | - | src/layout/glyph-run.ts:18 |
features | readonly | Features | - | src/layout/glyph-run.ts:17 |
glyphs | public | Glyph[] | an array of Glyph objects in the run. | src/layout/glyph-run.ts:35 |
language | readonly | string | null | - | src/layout/glyph-run.ts:19 |
script? | readonly | OpenTypeTag | the script that was requested for shaping | src/layout/glyph-run.ts:37 |
Accessors ​
advanceHeight ​
Get Signature ​
get advanceHeight():
number
Defined in: src/layout/glyph-run.ts:96
The total advance height of the run.
Returns ​
number
advanceWidth ​
Get Signature ​
get advanceWidth():
number
Defined in: src/layout/glyph-run.ts:81
The total advance width of the run.
Returns ​
number
bbox ​
Get Signature ​
get bbox():
BoundingBox
Defined in: src/layout/glyph-run.ts:108
The bounding box containing all glyphs in the run.
Returns ​
positions ​
Get Signature ​
get positions():
GlyphPosition[]
Defined in: src/layout/glyph-run.ts:59
Returns ​
Set Signature ​
set positions(
value):void
Defined in: src/layout/glyph-run.ts:68
Parameters ​
| Parameter | Type |
|---|---|
value | GlyphPosition[] |
Returns ​
void