Text
Details of a text.
contextSettings​
RequiredDescription
The opacity and blending-related configurations of the object.
transformedBounds​
OptionalDescription
An enclosing rectangle for the object. This property stores information about the object after the matrix transformation.
Type
outlineMaskBy​
RequiredDescription
A list of outline masks applied to the object, clipped by the intersection of their outlines. The items in the list are object IDs of the masks.
Type
Array<string>
maskType​
RequiredDescription
The mask type of the object.
Type
integer
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
0 | not a mask |
1 | outline mask |
2 | alpha mask |
styleEffectMaskArea​
RequiredDescription
How the style
and visible
of the mask object affect the area of the mask.
Type
integer
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
0 | The style and visible of the mask object do not affect the area of the mask, which depends on its bounds. |
1 | The style of the mask object does not affect the area of the mask, while the visible does. |
2 | The style and visible of the mask object do affect the area of the mask. |
maskShowType​
OptionalDescription
How the mask object is displayed.
Type
integer
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
0 | depend on its style . (Default value for outline mask .) |
1 | only display its bounds. (Default value for alpha mask when its alphaType equals 0 .) |
2 | do not display. (Default value for other conditions.) |
overflow​
RequiredDescription
How to display the child element of the object when it overflows its container.
Type
integer
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
1 | hidden. Anything outside the scope of the container will be cropped and invisible. |
2 | visible. Contents outside the scope of the container will not be cropped and will be visible. |
3 | scrolled. Content that is outside the container's scope is cropped, and a scrollbar is displayed to view the content that is beyond the container's boundaries. |
cornerSmoothing​
OptionalDescription
Smoothness of rounded corners. Range: [0, 1]
.
0
is the default value, indicating no smoothing for rounded corners.
Type
number
overrideKey​
OptionalDescription
Used to be associated with the object by symbol instances for overriding its attributes. Check the objectId
in the OverrideValue
for details.
If overrideKey
exists, find a symbol master through upward traversal (which could be the object itself); overrideKey
is unique within the symbol master.
Type
string
horizontalConstraint​
OptionalDescription
Horizontal constraints for the object.
Default value is 1
.
Type
verticalConstraint​
OptionalDescription
Vertical constraints for the object.
Default value is 1
.
Type
resizesContent​
OptionalDescription
How child objects behave when the object is resized.
Type
integer
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
0 | If the current object contains children (suitable for paths with boolean operations), the current object serves as the starting point. For each child, if the object chain includes a frame or symbol without a layout, the constraints on the child object are applied (ignoring constraints for groups and top-level paths with boolean operations). Otherwise, scaling is applied. |
1 | Force child objects to have fixed positions and sizes. |
2 | Apply child object constraints. (Default value.) |
keepShapeWhenResize​
OptionalDescription
False
: When resizing occurs, the object scales according to the horizontalConstraint
and verticalConstraint
. (Default value.)
True
: When resizing occurs, the object itself maintains its angle, and the center position is scaled. The scaling occurs along both the length and width directions.
Type
boolean
variableDefs​
OptionalDescription
A list of variables that can be used by children.
Type
Array<VariableDef>
styleEffectBoolean​
OptionalDescription
How the style
of the object affects the region participating in a Boolean operation with another object.
Type
integer
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
0 | ignore style(default value): The region in which an object participates in a Boolean operation is independent of its style . |
1 | If the object is a path and the path has borders without fills , then the borders will be used as a region to participate in the Boolean operation calculation. If the object is a text and the text has borders without fills , then the object will be ignored during the Boolean operation. In other cases, it behaves the same as ignore style . |
content​
RequiredDescription
The text content of the text object. The encoding format is UTF-8.
Type
string
anchorPoint​
OptionalDescription
The position of the first character baseline when text is drawn.
Horizontal and vertical alignments have been considered. The given coordinates are in the object's own coordinate system.
If this property doesn't exist, text is drawn using bounds
.
Type
frameMode​
RequiredDescription
The mode of the text frame size.
Type
integer
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
0 | fixed. The size of the text frame is fixed. |
1 | auto width. The width and height of the text frame are both adaptive. |
2 | auto height. The height of the text frame is adaptive, and the width is fixed. |
truncatedHeight​
OptionalDescription
The maximum height that can be displayed inside the text frame, with any text exceeding this height being truncated.
Type
number
verticalAlignment​
RequiredDescription
The type of vertical alignment for the text.
Type
integer
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
0 | top |
1 | center |
2 | bottom |
horizontalAlignment​
RequiredDescription
The type of horizontal alignment for the text. When the number of items is less than the number of rows, the last value is reused.
Type
Array<integer>
Value
enum: the value of this property must be equal to one of the following values:
Value | Explanation |
---|---|
0 | left |
1 | right |
2 | center |
3 | justified |
4 | natural |
5 | justified, and the last line to the left |
6 | justified, and the last line to the center |
7 | justified, and the last line to the right |
defaultFontAttr​
OptionalDescription
The default font attributes of the text. If some font attributes are missing in fontAttr
, take the font attributes here.
The value of length
in this field is meaningless.
Type
fontAttr​
RequiredDescription
An ordered list, where each item sequentially describes the font attributes of a text fragment.
If some font attributes are missing in an item, take the font attributes from defaultFontAttr
.
Type
Array<FontAttr>
textLineType​
OptionalDescription
A list with a length equals to the number of text lines, where each item describes the index preceding each line of text.
Type
Array<TextLineType>
verticalTrim​
OptionalDescription
If true, trim the text portion that extends beyond the text frame starting from the baseline, based on verticalAlignment
Default value is false
.
Type
boolean