object

FontAttr

Text Attr defined for particular fragments of the text (text ranges).

Properties
PropertyTypeRequired
classconstRequired
lengthintegerOptional
bordersArray<Border>Optional
fillsArray<Fill>Optional
fillUseTypeintegerOptional
horizontalAlignmentintegerRequired
namestringOptional
subFamilyNamestringOptional
sizenumberRequired
kerningbooleanRequired
letterSpacingnumberRequired
lineSpacenumberRequired
underlineintegerRequired
linethroughbooleanRequired
boldbooleanOptional
italicbooleanOptional
lettertransformintegerRequired
baselineShiftnumberRequired
baselineintegerRequired
horizontalScalenumberRequired
verticalScalenumberRequired
proportionalSpacingnumberRequired
rotatenumberRequired
textParagraphTextParagraphRequired

class

Required

Description

no description

Type

const

Value

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

json
"fontAttr"

length

Optional

Description

The number of characters(utf-8) that the current attribute acts on. If this item omit, it means current attribute acts on all remainder characters. note: If a utf8 character is 4 bytes, its length counts as 2 If a utf8 character is 1 ~ 3 bytes, its length counts as 1

Type

integer

borders

Optional

Description

An array containing the border styles of the character. Take precedence over the corresponding property of the object. If the entry is not exists, the corresponding property of the object itself is used.

Type

Array<Border>

fills

Optional

Description

An array containing the fill effects of the character.

Type

Array<Fill>

fillUseType

Optional

Description

no description

Type

integer

Value

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

ValueExplanation
0fills take precedence over the corresponding property of the object, unless fills not exists.(default value)
1The corresponding property of the object take precedence over fills. When style.fills only has one valid solid color object and fills only has one valid solid color object, the opacity of the two solid color objects is added to the solid color object of style.fills.

horizontalAlignment

Required

Description

Horizontal alignment of the text.

Type

integer

Value

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

ValueExplanation
0Left
1Right
2Centered
3Justified
4Natural

name

Optional

Description

Common name of font. The font name may contain subfamily, in which case the subFamilyName will not appear. If this item does not exist, the font name cannot be obtained.

Type

string

subFamilyName

Optional

Description

Font type (called 'subfamily' in OpenType specification).

Type

string

size

Required

Description

Font's size.

Type

number

kerning

Required

Description

Describes if kerning feature is enabled in the text.

Type

boolean

letterSpacing

Required

Description

Text letter spacing (can be negative).

Type

number

lineSpace

Required

Description

Describes the line spacing values of the text.

Type

number

underline

Required

Description

Text underline type.

Type

integer

Value

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

ValueExplanation
0none
1single line
2double line

linethrough

Required

Description

Describes if the text has line through.

Type

boolean

bold

Optional

Description

Describes if the text is bold. If missing the information is not known.

Type

boolean

italic

Optional

Description

Describes if the text is italic. If missing the information is not known.

Type

boolean

lettertransform

Required

Description

no description

Type

integer

Value

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

ValueExplanation
0do nothing.
1open smallcaps.
2open uppercase.
3open lowercase.
4force smallcaps.
5title

baselineShift

Required

Description

Describes baselineShift value.

Type

number

baseline

Required

Description

Describes baseline's position type.

Type

integer

Value

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

ValueExplanation
0normal
1superScript
2subScript

horizontalScale

Required

Description

Describes the horizontal scaling value of text. Value example: 1: not scale 1.75: 175% 2: 200% 0.5: 50%

Type

number

verticalScale

Required

Description

Describes the vertical scaling value of text. Value example reference horizontalScale.

Type

number

proportionalSpacing

Required

Description

Describes the proportional spacing of text. Value example: 1: 100% 0.5: 50% 0: 0%

Type

number

Value

maximum: the value of this number must smaller than or equal to: 1

minimum: the value of this number must greater than or equal to: 0

rotate

Required

Description

Describes the value of text rotation(in degree).

Type

number

Value

maximum: the value of this number must smaller than or equal to: 180

minimum: the value of this number must greater than or equal to: -180

textParagraph

Required

Description

no description

Daruma Feedback