Text
A text shape
Name | Type | Default | Description |
---|---|---|---|
options |
|
The configuration of this element. |
Constructors
Text
(content: string, position: Point | number[], options?: TextOptions)
Creates a new Text instance
Parameters
content
string
The content of the text. Control characters are not supported.
position
Point | number[]
The position of the text upper left corner.
options?
The configuration options.
Methods
bbox | ||||
---|---|---|---|---|
Returns the bounding box of the element with applied transformations. | ||||
|
className | ||||
---|---|---|---|---|
Gets the class attribute of the element. The class will be rendered only for SVG output. | ||||
|
className | ||||||
---|---|---|---|---|---|---|
Sets the class attribute of the element. The class will be rendered only for SVG output. | ||||||
|
clip | ||||||
---|---|---|---|---|---|---|
Sets the clipping path for this element. The Path instance will be monitored for changes. Can be replaced by calling the The following example demonstrates how to set a clipping path on a Circle. Change Theme Theme Loading ... The following example demonstrates how to clear a clipping path. Change Theme Theme Loading ... | ||||||
|
clippedBBox | ||||
---|---|---|---|---|
Returns the bounding box of the element with clipping and transformations applied. This is the rectangle that will fit around the actual rendered element. | ||||
|
containsPoint | ||||||
---|---|---|---|---|---|---|
Returns | ||||||
| ||||||
|
content | ||||
---|---|---|---|---|
Gets the text content. | ||||
|
content | ||||||
---|---|---|---|---|---|---|
Sets the text content. | ||||||
|
fill | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the fill of the Shape (see the basic usage example). | |||||||||
| |||||||||
|
opacity | ||||
---|---|---|---|---|
Gets the element opacity. | ||||
|
opacity | ||||||
---|---|---|---|---|---|---|
Sets the opacity of the element. Change Theme Theme Loading ... | ||||||
|
position | ||||
---|---|---|---|---|
Gets the position of the text upper left corner. | ||||
|
position | ||||||
---|---|---|---|---|---|---|
Sets the the position of the text upper left corner. | ||||||
|
stroke | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the stroke of the Shape. | ||||||||||||
| ||||||||||||
|
transform | ||||
---|---|---|---|---|
Gets the transformation of the element. | ||||
|
transform | ||||||
---|---|---|---|---|---|---|
Sets the transformation of the element. Change Theme Theme Loading ... | ||||||
|
visible | ||||
---|---|---|---|---|
Gets the visibility of the element. | ||||
|
visible | ||||||
---|---|---|---|---|---|---|
Sets the visibility of the element. Change Theme Theme Loading ... | ||||||
|