qnx.fuse.ui.text.TextFormat

TextFormat

Properties | Methods


Packageqnx.fuse.ui.text
Classpublic final class TextFormat
InheritanceTextFormat Inheritance Object

The TextFormat object applies text formatting to the TextField of a control.

The following listing creates an EditableText instance and a TextFormat instance. The TextFormat instance is applied to the EditableText object.

             var myEditableText:EditableText = new EditableText();
            myEditableText.x = 150;
            myEditableText.y = 200;
            myEditableText.setActualSize(400, 200);
            myEditableText.text = "Lorem ipsum dolor sit amet, consectetur " +
                "adipiscing elit. In blandit, erat euismod sagittis semper," +
                " libero mi semper orci, vel suscipit purus lectus nec velit.";
            myEditableText.autoCapitalize = AutoCapitalize.SENTENCE;
            
            var myFormat:TextFormat = new TextFormat();        
            myFormat.bold = true;
            myFormat.size = 42;
            myEditableText.format = myFormat;            
            this.addChild(myEditableText);
     


Class information:
PlayBook Tablet OS Version:   1.0.6

See also

EditableText
TextArea
TextInput



Public Properties

 PropertyDefined By
  align : String = start
Specifies the alignment of the text.
TextFormat
  bold : Boolean = false
Specifies bolded font.
TextFormat
  color : uint = 0x000000
Specifies the color of the text.
TextFormat
  font : String = Myriad Pro
Specifies the font of the text.
TextFormat
  italic : Boolean = false
Specifies italicized font.
TextFormat
  size : int = 20
Specifies the size of the text.
TextFormat

Public Methods

 MethodDefined By
  
Creates a clone of the current TextFormat instance.
TextFormat
  
isEqual(format:TextFormat):Boolean
Determines if the specified format is the same as the current instance.
TextFormat

Property Detail

align


public var align:String = start

Specifies the alignment of the text.

The default value is start.

See also

TextAlign

bold


public var bold:Boolean = false

Specifies bolded font.

The default value is false.

color


public var color:uint = 0x000000

Specifies the color of the text.

The default value is 0x000000.

font


public var font:String = Myriad Pro

Specifies the font of the text.

The default value is Myriad Pro.

italic


public var italic:Boolean = false

Specifies italicized font.

The default value is false.

size


public var size:int = 20

Specifies the size of the text.

The default value is 20.

Method Detail

clone()


public function clone():TextFormat

Creates a clone of the current TextFormat instance.

Returns

TextFormat

isEqual()


public function isEqual(format:TextFormat):Boolean

Determines if the specified format is the same as the current instance.

Parameters

format:TextFormat — The format instance to check against.

Returns

Boolean