Skip to content

Interface: TextMetrics ​

Defined in: types/desktop-engine.d.ts:1513

The size of a text as fillText draws it, from the point it's drawn at (its textAlign and textBaseline). The font's ascent and descent are Safari's: whole pixels, Helvetica, Times and Courier a little taller; textBaseline "top" and "hanging" are at the ascent, "bottom" and "ideographic" at the descent, "middle" halfway between them, as in Safari (Chrome puts them on the font's em box, a pixel or two inside)

Properties ​

actualBoundingBoxAscent ​

ts
readonly actualBoundingBoxAscent: number;

Defined in: types/desktop-engine.d.ts:1517

How far the glyphs reach above the textBaseline


actualBoundingBoxDescent ​

ts
readonly actualBoundingBoxDescent: number;

Defined in: types/desktop-engine.d.ts:1519

How far the glyphs reach below the textBaseline


actualBoundingBoxLeft ​

ts
readonly actualBoundingBoxLeft: number;

Defined in: types/desktop-engine.d.ts:1521

How far the glyphs reach to the left of the textAlign's point (negative when they start to its right) (API 5)


actualBoundingBoxRight ​

ts
readonly actualBoundingBoxRight: number;

Defined in: types/desktop-engine.d.ts:1523

How far the glyphs reach to the right of the textAlign's point (API 5)


alphabeticBaseline ​

ts
readonly alphabeticBaseline: number;

Defined in: types/desktop-engine.d.ts:1531

Where textBaseline "alphabetic" draws, as hangingBaseline (API 5)


fontBoundingBoxAscent ​

ts
readonly fontBoundingBoxAscent: number;

Defined in: types/desktop-engine.d.ts:1525

The font's ascent above the textBaseline, the same for any text (API 5)


fontBoundingBoxDescent ​

ts
readonly fontBoundingBoxDescent: number;

Defined in: types/desktop-engine.d.ts:1527

The font's descent below the textBaseline (API 5)


hangingBaseline ​

ts
readonly hangingBaseline: number;

Defined in: types/desktop-engine.d.ts:1529

Where textBaseline "hanging" draws: above the textBaseline, below it if negative (API 5)


ideographicBaseline ​

ts
readonly ideographicBaseline: number;

Defined in: types/desktop-engine.d.ts:1533

Where textBaseline "ideographic" draws (the bottom of the font's descent), as hangingBaseline (API 5)


width ​

ts
readonly width: number;

Defined in: types/desktop-engine.d.ts:1515

Text width

The SDK is released under the Apache License 2.0