title | page_title |
---|---|
Text |
API reference for methods and fields of Kendo UI Drawing Text |
Draws a single line of text at the given position.
<div id="surface"></div>
<script>
var draw = kendo.drawing;
var geom = kendo.geometry;
var position = new geom.Point(10, 10);
var text = new draw.Text("Foo", position);
var surface = draw.Surface.create($("#surface"));
surface.draw(text);
</script>
The content of the text. Special characters are not supported.
The position of the text upper left corner.
The configuration options.
The element clipping path. Inherited from Element.clip
The fill options of the text.
The font to use for rendering the text. Accepts the standard CSS font syntax.
Examples of valid font values:
- Size and family: "2em 'Open Sans', sans-serif"
- Style, size and family: "italic 2em 'Open Sans', sans-serif"
The element opacity. Inherited from Element.opacity
The stroke options of the text.
The transformation to apply to this element. Inherited from Element.transform
A flag, indicating if the element is visible. Inherited from Element.visible
Returns the bounding box of the element with transformations applied. Inherited from Element.bbox
kendo.geometry.Rect
The bounding box of the element with transformations applied.
Gets or sets the element clipping path. Inherited from Element.clip
The element clipping path.
kendo.drawing.Path
The current element clipping path.
Returns the bounding box of the element with clipping and transformations applied. Inherited from Element.clippedBBox
kendo.geometry.Rect
The bounding box of the element with clipping transformations applied.
Gets or sets the text content.
<div id="surface"></div>
<script>
var draw = kendo.drawing;
var geom = kendo.geometry;
var position = new geom.Point(10, 10);
var text = new draw.Text("", position);
var surface = draw.Surface.create($("#surface"));
surface.draw(text);
setInterval(function() {
text.content(kendo.toString(new Date(), "T"));
}, 1000);
</script>
The new text content to set.
String
The current content of the text.
Sets the text fill.
The fill color to set.
The fill opacity to set.
kendo.drawing.Text
The current instance to allow chaining.
Gets or sets the element opacity. Inherited from Element.opacity
If set, the stroke and fill opacity will be multiplied by the element opacity.
The element opacity. Ranges from 0 (completely transparent) to 1 (completely opaque).
Number
The current element opacity.
Gets or sets the position of the text upper left corner.
<div id="surface"></div>
<script>
var draw = kendo.drawing;
var geom = kendo.geometry;
var position = new geom.Point(10, 10);
var text = new draw.Text("Foo", position);
var surface = draw.Surface.create($("#surface"));
surface.draw(text);
setTimeout(function() {
text.position([20, 20]);
}, 1000);
</script>
The new position of the text upper left corner.
kendo.geometry.Point
The current position of the text upper left corner.
Sets the text stroke.
The stroke color to set.
The stroke width to set.
The stroke opacity to set.
kendo.drawing.Text
The current instance to allow chaining.
Gets or sets the transformation of the element. Inherited from Element.transform
The transformation to apply to the element.
kendo.geometry.Transformation
The current transformation on the element.
Gets or sets the visibility of the element. Inherited from Element.visible
A flag indicating if the element should be visible.
Boolean
true if the element is visible; false otherwise.