User Guide

Label component 215
autoSize indicates how the label sizes and aligns to fit the text. The default value is none. The
parameter can be any of the following four values:
none—the label doesnt resize or align to fit the text.
left—the right and bottom sides of the label resize to fit the text. The left and top sides
dont resize.
center—the bottom side of the label resizes to fit the text. The horizontal center of the label
stays anchored at the its original horizontal center position.
right—the left and bottom sides of the label resize to fit the text. The top and right side
dont resize.
Using styles with the Label component
You can set style properties to change the appearance of a label instance. All text in a Label
component instance must share the same style. For example, you cant set the
color style to
"blue" for one word in a label and to "red" for the second word in the same label.
If the name of a style property ends in “Color”, it is a color style property and behaves differently
than non-color style properties. A Label component supports the following styles:
Property summary for the Label class
Style Description
color
The default color for text.
embedFonts
The fonts to embed in the document.
fontFamily
The font name for text.
fontSize
The point size for the font.
fontStyle
The font style, either "normal",or "italic".
fontWeight
The font weight, either "normal" or "bold".
textAlign
The text alignment: either "left", "right", or "center".
textDecoration
The text decoration, either "none" or "underline".
Property Description
Label.autoSize
A string that indicates how a label sizes and aligns to fit the value of its text
property. There are four possible values:
"none", "left", "center", and "right".
The default value is
"none".
Label.html
A Boolean value that indicates whether a label can be formatted with HTML (true)
or not (
false).
Label.text
The text on the label.