Hide menu
Loading...
Searching...
No Matches
Text

Defines a text element for a drawing.

Extends

Constructors

Constructor

new Text(text?): Text

Creates a text element.

Parameters

text?

string = ‘’'`

Text content.

Returns

Text

Overrides

Element.constructor

Properties

properties

properties: TextProperties

Properties of the drawing text.


text

text: string = ‘’'`

Text content.

Accessors

fontSize

Get Signature

get fontSize(): number

Font size in points.

Deprecated

Use Text.properties and `properties.fontSize` instead.

Returns

number

Set Signature

set fontSize(fontSize): void

Sets the font size in points.

Deprecated

Use Text.properties and `properties.fontSize` instead.

Parameters

fontSize

number

Size of the font in points.

Returns

void


id

Get Signature

get id(): bigint

Returns the unique identifier of the object.

Returns

bigint

Inherited from

Element.id


origin

Get Signature

get origin(): Point2d

Position of the text on the 2D plane.

Returns

Point2d

Set Signature

set origin(origin): void

Sets the position of the text on the 2D plane.

The coordinates are copied from the provided point.

Parameters

origin

Point2d

Position of the text.

Returns

void


uuid

Get Signature

get uuid(): `${string}-${string}-${string}-${string}-${string}` | null

UUID of the drawing element.

The value is null if no UUID is assigned.

Returns

`${string}-${string}-${string}-${string}-${string}` | null

Set Signature

set uuid(uuid): void

Sets the UUID of the drawing element.

Parameters

uuid

`${string}-${string}-${string}-${string}-${string}` | null

UUID to assign to the drawing element.

Returns

void

Inherited from

Element.uuid

Methods

accept()

accept(visitor): void

Accepts an element visitor.

Parameters

visitor

ElementVisitor

Element visitor to accept.

Returns

void

Overrides

Element.accept