title | page_title | res_type |
---|---|---|
Text |
API reference for methods and fields of Kendo UI Drawing Text |
api |
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.
Represents an object containing the configuration options. All of the options are available in Configuration.
The element clipping path. Inherited from Element.clip
The element cursor. Inherited from Element.cursor
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"
<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, {
font: "italic 18px 'Open Sans', sans-serif"
});
var surface = draw.Surface.create($("#surface"));
surface.draw(text);
</script>
The element opacity. Inherited from Element.opacity
The stroke options of the text.
<div id="container"></div>
<script>
var svg = kendo.drawing.Surface.create($("#container"), { type: "svg" });
var text = new kendo.drawing.Text("Some Text", [100, 100], {
stroke: {
color: '#E4141B',
dashType: "dash"
}
})
svg.draw(text);
</script>
The tooltip options of the shape.
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.
Returns true if the shape contains the specified point.
The point that should be checked.
Boolean
value indicating if the shape contains the point.
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.