Skip to content

Documentation / @finchart/core / index / TextParams

Interface: TextParams ​

Defined in: packages/core/src/render/types.ts:31

Where and how to place a piece of text. It doesn't take a size — measuring is the renderer's job, so the caller only states an anchor and an alignment.

Properties ​

align ​

readonly align: "left" | "center" | "right"

Defined in: packages/core/src/render/types.ts:35


at ​

readonly at: Point

Defined in: packages/core/src/render/types.ts:34

The point to place it at. Which side of this point it lands on is decided by align and baseline.


baseline ​

readonly baseline: "top" | "middle" | "bottom"

Defined in: packages/core/src/render/types.ts:36


box? ​

readonly optional box?: object

Defined in: packages/core/src/render/types.ts:39

If present, lays a box behind the text. Its size comes from the measured result.

fill ​

fill: string

padding ​

padding: number


style ​

readonly style: TextStyle

Defined in: packages/core/src/render/types.ts:37


text ​

readonly text: string

Defined in: packages/core/src/render/types.ts:32


within? ​

readonly optional within?: object

Defined in: packages/core/src/render/types.ts:48

If present, the horizontal range the text — box and padding included — should stay inside. The caller can't measure, so the renderer that draws does: text that would cross an edge slides back in, keeping its alignment; text wider than the range sits on left and overflows right. A renderer that only records commands passes it on; one that replays them and ignores it draws the text where the anchor put it.

left ​

readonly left: number

readonly right: number