<< Click to Display Table of Contents >>
new sg.symbols.TextSymbol(text, font, color)
Description
create a new TextSymbol object (with parameters).
Position
Symbol.js
Parameters
Parameter |
Type |
Description |
text_or_json |
String |
text content |
font |
sg.Font |
text font |
color |
sg.Font |
text color |
Constants
Constants |
Description |
ALIGN_END |
align to end |
ALIGN_MIDDLE |
align to middle |
ALIGN_START |
align to start |
DECORATION_LINETHROUGH |
linethrough decoration |
DECORATION_OVERLINE |
overline decoration |
DECORATION_UNDERLINE |
underline decoration |
Properties
Properties |
Type |
Description |
align |
String |
definition of text alignment. |
angle |
Number |
definition of rotation angle. |
decoration |
sg.Color |
definition of text decoration |
font |
sg.Font |
definition of font |
kerning |
String |
determine whether to adjust the spacing between characters |
rotated |
Boolean |
determine whether every character in the text string is rotated |
text |
String |
definition of text content |
type |
String |
The type of symbol. |
xoffset |
Number |
definition of the x offset. |
yoffset |
Number |
definition of the y offset. |
Methods
Methods |
Type |
Description |
|||||||||
setAlign(align) |
String |
define text alignment. See the Constants table for valid values. The default value: ALIGN_MIDDLE
|
|||||||||
setAngle(angle) |
Number |
define rotation angle
|
|||||||||
setColor(color) |
sg.Color |
define text color
|
|||||||||
setFont(font) |
sg.Font |
define text font
|
|||||||||
setKerning(kerning) |
String |
define whether to adjust characters spacing.
|
|||||||||
setOffset(x,y) |
Number |
define offset in x and y direction
|
|||||||||
setRotated(rotated) |
Boolean |
define whether every character in the text string is rotated
|
|||||||||
setText(text) |
String |
define text content
|
Example
|
©2015 Supergeo Technologies Inc.