object

Text

Contains the information needed to draw the text.

Properties
PropertyTypeRequired
idstringRequired
namestringOptional
isLockedbooleanRequired
visiblebooleanRequired
contextSettingsGraphicsContextSettingsRequired
styleStyleRequired
boundsRectRequired
frameRectRequired
matrixMatrixRequired
alphaMaskByArray<AlphaMask>Required
outlineMaskByArray<string>Required
maskTypeintegerRequired
styleEffectMaskAreaintegerRequired
maskShowTypeintegerOptional
maskBoundsBorderBorderOptional
overflowintegerRequired
classconstRequired
contentstringRequired
textOnPathTextOnPathOptional
frameModeintegerRequired
truncatedHeightnumberOptional
verticalAlignmentintegerRequired
attrArray<FontAttr>Required
lineTypeArray<LineType>Optional
verticalTrimbooleanOptional

id

Required

Description

Object identifier, unique.

Type

string

name

Optional

Description

Name of object (utf-8).

Type

string

isLocked

Required

Description

Describes whether the object is locked.

Type

boolean

visible

Required

Description

Describes the visibility of the object.

Type

boolean

contextSettings

Required

Description

This property of path itself is meaningless, and is represented by its style, such as stroke, fill, etc.

style

Required

Description

Object styles descriptor.

Type

Style

bounds

Required

Description

This property records the bounds information of the object before it is matrixed.

Type

Rect

frame

Required

Description

An enclosing rectangle for the object. This property stores information about the object after the matrix transformation.

Type

Rect

matrix

Required

Description

Matrix, as defined in PostScript Language Reference Manual, Second Edition.

Type

Matrix

alphaMaskBy

Required

Description

no description

Type

Array<AlphaMask>

outlineMaskBy

Required

Description

The result of the outline mask area is the intersection of multiple outline mask object results.

Type

Array<string>

maskType

Required

Description

Describes the mask type of the object.

Type

integer

Value

enum: the value of this property must be equal to one of the following values:

ValueExplanation
0not mask
1outline mask
2alpha mask

styleEffectMaskArea

Required

Description

no description

Type

integer

Value

enum: the value of this property must be equal to one of the following values:

ValueExplanation
0The style and visible of the object not affects the area of the mask. The area of mask depends on bound.
1The style of the object not affects the area of the mask. The visible of the object affects the area of the mask.
2The style and visible of the object affects the area of the mask.

maskShowType

Optional

Description

Decide how the mask object should be displayed.

Type

integer

Value

enum: the value of this property must be equal to one of the following values:

ValueExplanation
0depends on the style. (default value for outline mask)
1only show bounds. (default value for alpha mask when it alphaType equal 0)
2not show. (default for other condition)

maskBoundsBorder

Optional

Description

Used to draw the bounds of the mask. Only applies if the mask show type is 1. if omit, use r = g = b = 1 position = outside thickness = 1 opacity = 1 blend-mode = normal style = solid

Type

Border

overflow

Required

Description

Sets what happens when a child element of a parent overflows its space.

Type

integer

Value

enum: the value of this property must be equal to one of the following values:

ValueExplanation
1hidden: Anything outside the scope of the container will be cropped and invisible.
2visible: Contents outside the scope of the container will not be cropped and will be visible.
3scroll: Content that is out of scope of the container is cropped and a scroll bar is displayed to view the content that is out of scope.

class

Required

Description

no description

Type

const

Value

constant: the value of this property must be equal to:

json
"text"

content

Required

Description

Text content of the text object. The encoding format is utf-8.

Type

string

textOnPath

Optional

Description

If this item exists, the text is on the path.

frameMode

Required

Description

Specifies the text frame semantics. fixed mode strictly sets the typeset area according to the frame. auto width and auto height mode expands associated bounds as needed.

Type

integer

Value

enum: the value of this property must be equal to one of the following values:

ValueExplanation
0fixed
1auto width
2auto height

truncatedHeight

Optional

Description

Text truncation height. omit represents no such attribute.

Type

number

verticalAlignment

Required

Description

Text vertical alignment.

Type

integer

Value

enum: the value of this property must be equal to one of the following values:

ValueExplanation
0top
1center
2bottom

attr

Required

Description

An array containing font style ranges. Note: Arrays are ordered.

Type

Array<FontAttr>

lineType

Optional

Description

no description

Type

Array<LineType>

verticalTrim

Optional

Description

True: cap height to baseline. False: do nothing.(default value)

Type

boolean

Daruma Feedback