| 包 | flash.text |
| 类 | public class Font |
| 继承 | Font Object |
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
| 属性 | 定义方 | ||
|---|---|---|---|
![]() | constructor : Object
对类对象或给定对象实例的构造函数的引用。
| Object | |
| fontName : String
[read-only]
嵌入字体的名称。
| Font | ||
| fontStyle : String
[read-only]
字体的样式。
| Font | ||
| fontType : String
[read-only]
字体的类型。
| Font | ||
![]() | prototype : Object
[static]
对类或函数对象的原型对象的引用。
| Object | |
| 方法 | 定义方 | ||
|---|---|---|---|
|
[static]
指定是否提供当前可用嵌入字体列表。
| Font | ||
|
指定能否使用当前指定的字体显示提供的字符串。
| Font | ||
![]() |
指示对象是否已经定义了指定的属性。
| Object | |
![]() |
指示 Object 类的实例是否在指定为参数的对象的原型链中。
| Object | |
![]() |
指示指定的属性是否存在、是否可枚举。
| Object | |
|
[static]
在全局字体列表中注册一个字体类。
| Font | ||
![]() |
设置循环操作动态属性的可用性。
| Object | |
![]() |
返回指定对象的字符串表示形式。
| Object | |
![]() |
返回指定对象的原始值。
| Object | |
| fontName | 属性 |
fontName:String [read-only]
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
嵌入字体的名称。
public function get fontName():String
| fontStyle | 属性 |
fontStyle:String [read-only]
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
字体的样式。 此值可以是 FontStyle 类中定义的任何值。
public function get fontStyle():String
另请参见
| fontType | 属性 |
fontType:String [read-only]
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
字体的类型。 此值可以是 FontType 类中定义的任何常数。
public function get fontType():String
另请参见
| enumerateFonts | () | 方法 |
public static function enumerateFonts(enumerateDeviceFonts:Boolean = false):Array
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
指定是否提供当前可用嵌入字体列表。
参数
enumerateDeviceFonts:Boolean (default = false) — 指示是否要将列表限制为仅当前可用的嵌入字体。 如果设置为 true,则返回一个包括所有字体(设备字体和嵌入字体)的列表。 如果设置为 false,则返回一个只包括嵌入字体的列表。
|
Array — 一个作为 Font 对象数组的可用字体列表。
|
Font.enumerateFonts() 来获取包括所有设备字体和嵌入字体的列表。 然后此示例按 fontName 属性对生成的 Array 的 Font 对象进行排序。
接下来,此示例显示如何调用 enumerateDeviceFonts 参数设置为 false 时的 Font.enumerateFonts() 方法。 生成的 Array 只包括嵌入的 Font 对象。 (如果在不包含任何嵌入字体的应用程序中运行此代码,则 embeddedFonts 数组将为空。)
import flash.text.Font;
var allFonts:Array = Font.enumerateFonts(true);
allFonts.sortOn("fontName", Array.CASEINSENSITIVE);
var embeddedFonts:Array = Font.enumerateFonts(false);
embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);| hasGlyphs | () | 方法 |
public function hasGlyphs(str:String):Boolean
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
指定能否使用当前指定的字体显示提供的字符串。
参数
str:String — 要针对当前字体进行测试的字符串。
|
Boolean — 如果可使用此字体完全显示指定的字符串,则值为 true。
|
| registerFont | () | 方法 |
public static function registerFont(font:Class):void
| 语言版本 : | ActionScript 3.0 |
| Player 版本 : | Flash Player 9 |
在全局字体列表中注册一个字体类。
参数
font:Class — 要添加到全局字体列表中的类。
|
当前页: http://livedocs.adobe.com/flash/9.0_cn/ActionScriptLangRefV3/flash/text/Font.html