Package | mx.core |
Class | public class UITextFormat |
Inheritance | UITextFormat ![]() ![]() |
The UITextFormat class extends the flash.text.TextFormat class
to add the text measurement methods measureText()
and measureHTMLText()
and to add properties for
controlling the advanced anti-aliasing of fonts.
See also
Property | Defined By | ||
---|---|---|---|
![]() | align : String
Indicates the alignment of the paragraph. | TextFormat | |
antiAliasType : String
Defines the anti-aliasing setting for the UITextField class. | UITextFormat | ||
![]() | blockIndent : Object
Indicates the block indentation in pixels. | TextFormat | |
![]() | bold : Object
Specifies whether the text is boldface. | TextFormat | |
![]() | bullet : Object
Indicates that the text is part of a bulleted list. | TextFormat | |
![]() | color : Object
Indicates the color of the text. | TextFormat | |
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object | |
![]() | font : String
The name of the font for text in this text format, as a string. | TextFormat | |
gridFitType : String
Defines the grid-fitting setting for the UITextField class. | UITextFormat | ||
![]() | indent : Object
Indicates the indentation from the left
margin to the first character in the paragraph. | TextFormat | |
![]() | italic : Object
Indicates whether text in this text format is italicized. | TextFormat | |
![]() | kerning : Object
A Boolean value that indicates whether kerning is enabled (true)
or disabled (false). | TextFormat | |
![]() | leading : Object
An integer representing the amount of vertical space (called leading)
between lines. | TextFormat | |
![]() | leftMargin : Object
The left margin of the paragraph, in pixels. | TextFormat | |
![]() | letterSpacing : Object
A number representing the amount of space that is uniformly distributed between all characters. | TextFormat | |
moduleFactory : IFlexModuleFactory
The moduleFactory used to create TextFields for embedded fonts. | UITextFormat | ||
![]() | prototype : Object [static]
A reference to the prototype object of a class or function object. | Object | |
![]() | rightMargin : Object
The right margin of the paragraph, in pixels. | TextFormat | |
sharpness : Number
Defines the sharpness setting for the UITextField class. | UITextFormat | ||
![]() | size : Object
The size in pixels of text in this text format. | TextFormat | |
![]() | tabStops : Array
Specifies custom tab stops as an array of non-negative integers. | TextFormat | |
![]() | target : String
Indicates the target window where the hyperlink is displayed. | TextFormat | |
thickness : Number
Defines the thickness setting for the UITextField class. | UITextFormat | ||
![]() | underline : Object
Indicates whether the text that uses this text format is underlined (true)
or not (false). | TextFormat | |
![]() | url : String
Indicates the target URL for the text in this text format. | TextFormat |
Method | Defined By | ||
---|---|---|---|
UITextFormat(systemManager:ISystemManager, font:String = null, size:Object = null, color:Object = null, bold:Object = null, italic:Object = null, underline:Object = null, url:String = null, target:String = null, align:String = null, leftMargin:Object = null, rightMargin:Object = null, indent:Object = null, leading:Object = null)
Constructor. | UITextFormat | ||
![]() |
Indicates whether an object has a specified property defined. | Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
Returns measurement information for the specified HTML text,
which may contain HTML tags such as <font>
and <b>, assuming that it is displayed
in a single-line UITextField, and using this UITextFormat object
to define the text format. | UITextFormat | ||
Returns measurement information for the specified text,
assuming that it is displayed in a single-line UITextField component,
and using this UITextFormat object to define the text format. | UITextFormat | ||
![]() |
Indicates whether the specified property exists and is enumerable. | Object | |
![]() |
Sets the availability of a dynamic property for loop operations. | Object | |
![]() |
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | |
![]() |
Returns the string representation of the specified object. | Object | |
![]() |
Returns the primitive value of the specified object. | Object |
antiAliasType | property |
public var antiAliasType:String
Defines the anti-aliasing setting for the UITextField class.
The possible values are "normal"
(flash.text.AntiAliasType.NORMAL
)
and "advanced"
(flash.text.AntiAliasType.ADVANCED
).
The default value is "advanced"
,
which enables advanced anti-aliasing
for the embedded font.
Set this property to "normal"
to disable the advanced anti-aliasing.
This property has no effect for system fonts.
This property applies to all the text in a UITextField object; you cannot apply it to some characters and not others.
The default value is "advanced".
See also
gridFitType | property |
public var gridFitType:String
Defines the grid-fitting setting for the UITextField class.
The possible values are "none"
(flash.text.GridFitType.NONE
),
"pixel"
(flash.text.GridFitType.PIXEL
),
and "subpixel"
(flash.text.GridFitType.SUBPIXEL
).
This property only applies when you are using an
embedded font and the fontAntiAliasType
property is set to "advanced"
.
This property has no effect for system fonts.
This property applies to all the text in a UITextField object; you cannot apply it to some characters and not others.
The default value is "pixel".
See also
moduleFactory | property |
moduleFactory:IFlexModuleFactory
The moduleFactory used to create TextFields for embedded fonts.
public function get moduleFactory():IFlexModuleFactory
public function set moduleFactory(value:IFlexModuleFactory):void
sharpness | property |
public var sharpness:Number
Defines the sharpness setting for the UITextField class. This property specifies the sharpness of the glyph edges. The possible values are Numbers from -400 through 400.
This property only applies when you are using an
embedded font and the fontAntiAliasType
property is set to "advanced"
.
This property has no effect for system fonts.
This property applies to all the text in a UITextField object; you cannot apply it to some characters and not others.
The default value is 0.
See also
thickness | property |
public var thickness:Number
Defines the thickness setting for the UITextField class. This property specifies the thickness of the glyph edges. The possible values are Numbers from -200 to 200.
This property only applies when you are using an
embedded font and the fontAntiAliasType
property is set to "advanced"
.
This property has no effect for system fonts.
This property applies to all the text in a UITextField object; you cannot apply it to some characters and not others.
The default value is 0.
See also
UITextFormat | () | Constructor |
public function UITextFormat(systemManager:ISystemManager, font:String = null, size:Object = null, color:Object = null, bold:Object = null, italic:Object = null, underline:Object = null, url:String = null, target:String = null, align:String = null, leftMargin:Object = null, rightMargin:Object = null, indent:Object = null, leading:Object = null)
Constructor.
ParameterssystemManager:ISystemManager — A SystemManager object.
The SystemManager keeps track of which fonts are embedded.
Typically this is the SystemManager obtained from the
systemManager property of UIComponent.
| |
font:String (default = null ) — A String specifying the name of a font,
or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
size:Object (default = null ) — A Number specifying a font size in pixels,
or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
color:Object (default = null ) — An unsigned integer specifying the RGB color of the text,
such as 0xFF0000 for red, or null to indicate
that is UITextFormat doesn't specify this property.
This parameter is optional, with a default value of null .
| |
bold:Object (default = null ) — A Boolean flag specifying whether the text is bold,
or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
italic:Object (default = null ) — A Boolean flag specifying whether the text is italic,
or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
underline:Object (default = null ) — A Boolean flag specifying whether the text is underlined,
or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
url:String (default = null ) — A String specifying the URL to which the text is
hyperlinked, or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
target:String (default = null ) — A String specifying the target window
where the hyperlinked URL is displayed.
If the target window is null or an empty string,
the hyperlinked page is displayed in the same browser window.
If the urlString parameter is null
or an empty string, this property has no effect.
This parameter is optional, with a default value of null .
| |
align:String (default = null ) — A String specifying the alignment of the paragraph,
as a flash.text.TextFormatAlign value, or null to indicate
that this UITextFormat doesn't specify this property.
This parameter is optional, with a default value of null .
| |
leftMargin:Object (default = null ) — A Number specifying the left margin of the paragraph,
in pixels, or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
rightMargin:Object (default = null ) — A Number specifying the right margin of the paragraph,
in pixels, or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
indent:Object (default = null ) — A Number specifying the indentation from the left
margin to the first character in the paragraph, in pixels,
or null to indicate that this UITextFormat
doesn't specify this property.
This parameter is optional, with a default value of null .
| |
leading:Object (default = null ) — A Number specifying the amount of additional vertical
space between lines, or null to indicate
that this UITextFormat doesn't specify this property.
This parameter is optional, with a default value of null .
|
See also
measureHTMLText | () | method |
public function measureHTMLText(htmlText:String, roundUp:Boolean = true):flash.text:TextLineMetrics
Returns measurement information for the specified HTML text,
which may contain HTML tags such as <font>
and <b>
, assuming that it is displayed
in a single-line UITextField, and using this UITextFormat object
to define the text format.
Parameters
htmlText:String — A String specifying the HTML text to measure.
| |
roundUp:Boolean (default = true ) — A Boolean flag specifying whether to round up the
the measured width and height to the nearest integer.
Rounding up is appropriate in most circumstances.
|
flash.text:TextLineMetrics — A TextLineMetrics object containing the text measurements.
|
See also
measureText | () | method |
public function measureText(text:String, roundUp:Boolean = true):flash.text:TextLineMetrics
Returns measurement information for the specified text, assuming that it is displayed in a single-line UITextField component, and using this UITextFormat object to define the text format.
Parameters
text:String — A String specifying the text to measure.
| |
roundUp:Boolean (default = true ) — A Boolean flag specifying whether to round up the
the measured width and height to the nearest integer.
Rounding up is appropriate in most circumstances.
|
flash.text:TextLineMetrics — A TextLineMetrics object containing the text measurements.
|
See also