套件 | mx.core |
類別 | public class UITextFormat |
繼承 | UITextFormat TextFormat Object |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
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.
相關 API 元素
屬性 | 定義自 | ||
---|---|---|---|
align : String
指出段落的對齊方式。 | TextFormat | ||
antiAliasType : String
Defines the anti-aliasing setting for the UITextField class. | UITextFormat | ||
blockIndent : Object
指出區塊縮排,以像素為單位。 | TextFormat | ||
bold : Object
會指定文字是否為粗體。 | TextFormat | ||
bullet : Object
指出文字是項目清單的一部分。 | TextFormat | ||
color : Object
指出文字的顏色。 | TextFormat | ||
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | Object | ||
direction : String
The directionality of the text. | UITextFormat | ||
font : String
這個文字格式的文字字體名稱,以字串表示。 | TextFormat | ||
gridFitType : String
Defines the grid-fitting setting for the UITextField class. | UITextFormat | ||
indent : Object
指出段落中從左方邊界到第一個字元的縮排。 | TextFormat | ||
italic : Object
指出在此文字格式中的文字是否為斜體。 | TextFormat | ||
kerning : Object
Boolean 值,指出啟用字距微調 (true) 或停用字距微調 (false)。 | TextFormat | ||
leading : Object
整數,表示行與行之間垂直空間的量 (稱為「行距」)。 | TextFormat | ||
leftMargin : Object
段落的左方邊界,以像素為單位。 | TextFormat | ||
letterSpacing : Object
數字,代表在所有字元之間平均分佈的空間量。 | TextFormat | ||
locale : String
The locale of the text. | UITextFormat | ||
moduleFactory : IFlexModuleFactory
The moduleFactory used to create TextFields for embedded fonts. | UITextFormat | ||
rightMargin : Object
段落的右方邊界,以像素為單位。 | TextFormat | ||
sharpness : Number
Defines the sharpness setting for the UITextField class. | UITextFormat | ||
size : Object
這個文字格式的文字像素大小。 | TextFormat | ||
tabStops : Array
指定自訂定位停駐點為非負值整數的陣列。 | TextFormat | ||
target : String
指出顯示超連結的目標視窗。 | TextFormat | ||
thickness : Number
Defines the thickness setting for the UITextField class. | UITextFormat | ||
underline : Object
指出使用此文字格式的文字有加底線 (true) 或未加底線 (false)。 | TextFormat | ||
url : String
指出此文字格式中之文字的目標 URL。 | TextFormat | ||
useFTE : Boolean = false
Determines how the measureText()
and measureHTMLText() methods do text measurement. | UITextFormat |
方法 | 定義自 | ||
---|---|---|---|
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 | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | 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 | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
antiAliasType | 屬性 |
public var antiAliasType:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
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.
預設值為 "advanced"。
相關 API 元素
direction | 屬性 |
public var direction:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The directionality of the text.
The allowed values are "ltr"
for left-to-right text,
as in Latin-style scripts,
and "rtl"
for right-to-left text,
as in Arabic and Hebrew.
FTE and TLF use this value in their bidirectional text layout algorithm, which maps Unicode character order to glyph order.
Note: This style only applies when this UITextFormat is used with a UIFTETextField rather than a UITextField.
預設值為 null。
gridFitType | 屬性 |
public var gridFitType:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
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.
預設值為 "pixel"。
相關 API 元素
locale | 屬性 |
public var locale:String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
The locale of the text.
FTE and TLF use this locale to map Unicode characters to font glyphs and to find fallback fonts.
Note: This style only applies when this UITextFormat is used with a UIFTETextField rather than a UITextField.
預設值為 null。
moduleFactory | 屬性 |
moduleFactory:IFlexModuleFactory
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
The moduleFactory used to create TextFields for embedded fonts.
實作
public function get moduleFactory():IFlexModuleFactory
public function set moduleFactory(value:IFlexModuleFactory):void
sharpness | 屬性 |
public var sharpness:Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
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.
預設值為 0。
相關 API 元素
thickness | 屬性 |
public var thickness:Number
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
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.
預設值為 0。
相關 API 元素
useFTE | 屬性 |
public var useFTE:Boolean = false
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Determines how the measureText()
and measureHTMLText()
methods do text measurement.
If true
, they use an offscreen instance
of the FTETextField class in the Text Layout Framework.
If false
, they use an offscreen instance
of the TextField class in the Flash Player.
預設值為 false。
UITextFormat | () | 建構函式 |
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)
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
Constructor.
參數systemManager: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 .
|
相關 API 元素
measureHTMLText | () | 方法 |
public function measureHTMLText(htmlText:String, roundUp:Boolean = true):flash.text:TextLineMetrics
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
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.
參數
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.
|
相關 API 元素
measureText | () | 方法 |
public function measureText(text:String, roundUp:Boolean = true):flash.text:TextLineMetrics
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | Flash Player 9, AIR 1.1 |
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.
參數
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.
|
相關 API 元素
Tue Jun 12 2018, 03:47 PM Z