Skip to content

@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 ​

ParameterTypeDescription
glyphsGlyph[]an array of Glyph objects in the run.
featuresFeatures | keyof Features[]-
script?OpenTypeTagthe script that was requested for shaping
language?stringthe language as requested for shaping
direction?"ltr" | "rtl"-

Returns ​

GlyphRun

Properties ​

PropertyModifierTypeDescriptionDefined in
directionreadonlyBidiDirection-src/layout/glyph-run.ts:18
featuresreadonlyFeatures-src/layout/glyph-run.ts:17
glyphspublicGlyph[]an array of Glyph objects in the run.src/layout/glyph-run.ts:35
languagereadonlystring | null-src/layout/glyph-run.ts:19
script?readonlyOpenTypeTagthe script that was requested for shapingsrc/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 ​

BoundingBox


positions ​

Get Signature ​

get positions(): GlyphPosition[]

Defined in: src/layout/glyph-run.ts:59

Returns ​

GlyphPosition[]

Set Signature ​

set positions(value): void

Defined in: src/layout/glyph-run.ts:68

Parameters ​
ParameterType
valueGlyphPosition[]
Returns ​

void