Text


Inheritance Text View Module hilo/view/Text Requires hilo/core/Class, hilo/core/Hilo, hilo/view/View, hilo/view/CacheMixin Source Text.js
Text class provide basic text-display function, use DOMElement for complex text-display.

Properties

Show Inherited Properties
Property Defined
color:String
Color of the text.
Text
font:String
Text's CSS font style, readonly! Use setFont function to set text font.
Text
lineSpacing:Number
The spacing between lines.
Text
maxWidth:Number
The max length of the text, default value is 200.
Text
outline:Boolean
Draw the outline of the text or fill the text.
Text
text:String
Text to display.
Text
textAlign:String
Horizontal alignment way of the text.
Text
textHeight:Number
Height of the text, readonly! Works only on canvas mode.
Text
textVAlign:String
Vertical alignment way of the text.
Text
textWidth:Number
Width of the text, readonly! Works only on canvas mode.
Text

Methods

Show Inherited Methods
Method Defined
Text(properties:Object)
Constructor
Text
setFont(font:String):Text
Text
measureFontHeight(font:String):Number
static
Text

Property Detail

color:String
Color of the text.
font:String
Text's CSS font style, readonly! Use setFont function to set text font.
lineSpacing:Number
The spacing between lines. Measured in px, default value is 0.
maxWidth:Number
The max length of the text, default value is 200.
outline:Boolean
Draw the outline of the text or fill the text.
text:String
Text to display.
textAlign:String
Horizontal alignment way of the text. May be one of the following value:'start', 'end', 'left', 'right', and 'center'。
textHeight:Number
Height of the text, readonly! Works only on canvas mode.
textVAlign:String
Vertical alignment way of the text. May be one of the following value:'top', 'middle', 'bottom'。
textWidth:Number
Width of the text, readonly! Works only on canvas mode.

Constructor

Text(properties:Object)
parameters
properties:Object — Properties parameters for the object. Includes all writable properties.

Method Detail

[Static] measureFontHeight(font:String):Number
parameters
font:String — Font style to measure.
return
Number — Return line height of the assigned font style.
setFont(font:String):Text
parameters
font:String — Text CSS font style to set.
return
Text — the Text object, chained call supported.