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
readonlyalign:"left"|"center"|"right"
Defined in: packages/core/src/render/types.ts:35
at
readonlyat: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
readonlybaseline:"top"|"middle"|"bottom"
Defined in: packages/core/src/render/types.ts:36
box?
readonlyoptionalbox?: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
readonlystyle:TextStyle
Defined in: packages/core/src/render/types.ts:37
text
readonlytext:string
Defined in: packages/core/src/render/types.ts:32
within?
readonlyoptionalwithin?: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
readonlyleft:number
right
readonlyright:number