適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隱藏篩選
flash.text.engine 

FontDescription  - AS3

套件x

最上層
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

語言元素

全域常數
全域函數
運算子
陳述式、關鍵字和指令
特殊類型

附錄

新增內容
編譯器錯誤
編譯器警告
執行階段錯誤
移轉至 ActionScript 3
支援的字元集
僅限 MXML 標籤
移動 XML 元素
Timed Text 標籤
不建議元素清單
AccessibilityImplementation 常數
如何使用 ActionScript 範例
法律聲明
套件flash.text.engine
類別public final class FontDescription
繼承FontDescription Inheritance Object

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

FontDescription 類別代表描述字體所需的資訊。

FontDescription 物件會套用到 ElementFormat,再接著套用到 TextBlock 中的 ContentElement。將 FontDescription 套用到 ElementFormat 之後,其 locked 屬性會設為 true。已鎖定的 FontDescription 物件的屬性不得變更。請改用 clone() 方法建立物件的未鎖定副本,就可以修改副本並將它指定給 ElementFormat。

注意:FTE (Flash 文字引擎) 不支援 Type 1 字體或點陣圖字體,例如 Type 3、ATC、sfnt-wrapped CID 或 Naked CID。

檢視範例

相關 API 元素



公用屬性
 屬性定義自
  cffHinting : String
用於此文字的 CFF 提示類型。
FontDescription
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
  fontLookup : String
指定字體查詢的方式。
FontDescription
  fontName : String
要使用的字體名稱,或是以逗號分隔的字體名稱清單。
FontDescription
  fontPosture : String
指定字體型態。
FontDescription
  fontWeight : String
指定字體粗細。
FontDescription
  locked : Boolean
指出 FontDescription 是否已鎖定。
FontDescription
  renderingMode : String
用於此文字的顯示模式。
FontDescription
公用方法
 方法定義自
  
FontDescription(fontName:String = "_serif", fontWeight:String = "normal", fontPosture:String = "normal", fontLookup:String = "device", renderingMode:String = "cff", cffHinting:String = "horizontalStem")
建立 FontDescription 物件。
FontDescription
  
建構 FontDescription 的未鎖定、已複製副本。
FontDescription
 Inherited
指出物件是否有已定義的指定屬性。
Object
  
isDeviceFontCompatible(fontName:String, fontWeight:String, fontPosture:String):Boolean
[靜態] 如果可使用的裝置字體可以使用指定的 fontName、fontWeight 以及 fontPosture,則傳回 true。
FontDescription
  
isFontCompatible(fontName:String, fontWeight:String, fontPosture:String):Boolean
[靜態] 如果指定的 fontName、fontWeight 和 fontPosture 提供內嵌字體,而 Font.fontType 為 flash.text.FontType.EMBEDDED_CFF 時,則傳回 true。
FontDescription
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
屬性詳細資訊

cffHinting

屬性
cffHinting:String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

用於此文字的 CFF 提示類型。請針對此屬性使用 CFFHinting 常數。只有在文字的 RenderingMode 屬性設定為 RenderingMode.CFF 時,才會套用這個屬性。

使用的 CFF (壓縮字體格式) 提示類型決定 Flash 執行階段是否讓強制水平詞幹符合子像素格線。

只套用到內嵌字體。

預設值為 CFFHinting.HORIZONTAL_STEM

對於 CFFHinting 屬性,您可以使用以下 CFFHinting 類別的值:

字串值說明
CFFHinting.NONE指定不使用 CFF 提示。不強制字符中的水平詞幹符合子像素格線。這個設定適用於動畫或大型字體。
CFFHinting.HORIZONTAL_STEM指定使用 CFF 提示。強制水平詞幹符合螢幕上子像素格線若要使用這個設定,RenderingMode 屬性必須設定為 RenderingMode.CFF



實作
    public function get cffHinting():String
    public function set cffHinting(value:String):void

擲回值
ArgumentError — 如果設為不屬於 CFFHinting 成員的任何一個值。
 
IllegalOperationError — 如果於 FontDescription 物件已鎖定後設定 (lockedtrue)。

相關 API 元素

fontLookup

屬性 
fontLookup:String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

指定字體查詢的方式。

預設值是 FontLookup.DEVICE

若要設定此屬性,請使用下列字串值:

字串值說明
FontLookup.DEVICE執行階段會在本機系統上使用指定的 name 來查詢裝置字體並將文字顯示在該系統上。
FontLookup.EMBEDDED_CFF執行階段會使用指定的 name 來查詢內嵌 CFF 字體並顯示文字。只會考量 flash.text.Font.fontType.EMBEDDED_CFF 類型的字體。如果指定的 CFF 字體並未內嵌在應用程式中,則執行階段會嘗試為每個字符使用後援裝置字體。如果您一開始就選取了裝置字體,就不用使用這個方法,因為這個方法比較沒有效率。



實作
    public function get fontLookup():String
    public function set fontLookup(value:String):void

擲回值
IllegalOperationError — 如果於 FontDescription 物件已鎖定後設定 (lockedtrue)。

相關 API 元素

fontName

屬性 
fontName:String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5

要使用的字體名稱,或是以逗號分隔的字體名稱清單。執行階段會以清單中的第一個可用字體來顯示元素。例如,"Arial, Helvetica, _sans" 會讓 Player 先搜尋 Arial,如果找不到 Arial 則搜尋 Helvetica,如果這兩項都找不到,則搜尋 _sans。

Flash 執行階段支援三個一般裝置字體名稱:_sans (對於 sans serif 字體)、 _serif (對於 serif 字體) 以及 _typewriter (對於 mono-space 字體)。這些會對應到特定的裝置字體 (視平台而定)。

預設值為 "_serif"

Flash 執行階段會針對未在選取的字體清單中提供的文字提供後援字體。不管使用中的字體是內嵌字體或是裝置字體,如果在字體中找不到要顯示的字符,則執行階段會嘗試使用另一個可能包含該字符的裝置字體來加以顯示。



實作
    public function get fontName():String
    public function set fontName(value:String):void

擲回值
IllegalOperationError — 如果於 FontDescription 物件已鎖定後設定 (lockedtrue)。

相關 API 元素

fontPosture

屬性 
fontPosture:String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

指定字體型態。

預設值是 FontPosture.NORMAL

若要設定這個屬性的值,使用以下在 FontPosture 類別的常數。

說明
FontPosture.NORMAL正常的字體型態。
FontPosture.ITALIC斜體的字體型態。



實作
    public function get fontPosture():String
    public function set fontPosture(value:String):void

擲回值
ArgumentError — 如果設為不屬於 FontPosture 成員的任何一個值。
 
IllegalOperationError — 如果於 FontDescription 物件已鎖定後設定 (lockedtrue)。

相關 API 元素

fontWeight

屬性 
fontWeight:String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

指定字體粗細。

預設值是 FontWeight.NORMAL

若要設定這個屬性的值,使用以下在 FontWeight 類別的常數。

字串值說明
FontWeight.NORMAL正常的字體粗細。
FontWeight.BOLD粗體的字體粗細。



實作
    public function get fontWeight():String
    public function set fontWeight(value:String):void

擲回值
ArgumentError — 如果設為不屬於 FontWeight 成員的任何一個值。
 
IllegalOperationError — 如果於 FontDescription 物件已鎖定後設定 (lockedtrue)。

相關 API 元素

locked

屬性 
locked:Boolean

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5., Flash Lite 4

指出 FontDescription 是否已鎖定。如果是 true,則 FontDescription 不得修改。呼叫 FontDescription.clone() 取得 FontDescription 物件的未鎖定副本。



實作
    public function get locked():Boolean
    public function set locked(value:Boolean):void

擲回值
IllegalOperationError — 如果於 FontDescription 物件已鎖定後設定 (lockedtrue)。

renderingMode

屬性 
renderingMode:String

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

用於此文字的顯示模式。請針對此屬性使用 RenderingMode 常數。

只套用到內嵌字體。

預設值是 RenderingMode.CFF

若要設定這個屬性的值,使用以下在 RenderingMode 類別的常數。

字串值說明
RenderingMode.NORMAL套用一般文字顯示方式,符合 Flash Player 7 和舊版使用的顯示類型。
RenderingMode.CFF套用 CFF (壓縮字體格式) 顯示,讓文字更易於辨識。(這項功能從 Flash Player 10 開始提供)。 CFF 顯示方式允許高品質顯示小字體外觀。



實作
    public function get renderingMode():String
    public function set renderingMode(value:String):void

擲回值
ArgumentError — 如果設為不屬於 RenderingMode 成員的任何一個值。
 
IllegalOperationError — 如果於 FontDescription 物件已鎖定後設定 (lockedtrue)。

相關 API 元素

建構函式詳細資料

FontDescription

()建構函式
public function FontDescription(fontName:String = "_serif", fontWeight:String = "normal", fontPosture:String = "normal", fontLookup:String = "device", renderingMode:String = "cff", cffHinting:String = "horizontalStem")

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

建立 FontDescription 物件。

參數
fontName:String (default = "_serif") — 要使用的字體名稱,或是以逗號分隔的字體名稱清單。
 
fontWeight:String (default = "normal") — 指定字體粗細。
 
fontPosture:String (default = "normal") — 指定字體型態。
 
fontLookup:String (default = "device") — 指定如何查詢字體。
 
renderingMode:String (default = "cff") — 用於此文字的顯示模式。請針對此屬性使用 RenderingMode 常數。
 
cffHinting:String (default = "horizontalStem") — 用於此文字的 CFF (壓縮字體格式) 提示類型。請針對此屬性使用 CFFHinting 常數。

擲回值
ArgumentError — 指定的 fontWeight 不是 FontWeight 的成員。
 
ArgumentError — 指定的 fontPosture 不是 FontPosture 的成員。
 
ArgumentError — 指定的 fontLookup 不是 FontLookup 的成員。
 
ArgumentError — 指定的 renderingMode 不是 RenderingMode 的成員。
 
ArgumentError — 指定的 cffHinting 不是 CFFHinting 的成員。
方法詳細資訊

clone

()方法
public function clone():FontDescription

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

建構 FontDescription 的未鎖定、已複製副本。

傳回值
FontDescriptionFontDescription 物件的未鎖定副本。

範例  ( 如何使用本範例 )

此範例會建立 FontDescription 物件、為其指定裝置字體、設定不同的字體屬性,並將新物件指定給 ElementFormat 物件 (因而鎖定它)。此範例中會使用 ElementFormat 來建立新的 TextElement,而且會使用 TextElement 做為 TextBlock 的內容。接著會從 TextBlock 建立文字行。

若要修改 FontDescription 物件,請先檢查其 locked 屬性。如果是 true,請使用 clone() 方法建立 FontDescription 的未鎖定副本,變更其屬性,並將它指定給新的 ElementFormat 物件。然後,將新的 ElementFormat 重新連結到 TextBlock。當這些文字行重新斷行時,新文字行會有新的字體設定。

package {

    import flash.display.Sprite;
    import flash.text.engine.*;

    
    public class FontDescription_cloneExample extends Sprite {
        private var fd:FontDescription;
        private var fd2:FontDescription;
        
        public function FontDescription_cloneExample():void {
            fd = new FontDescription();
            fd.fontLookup = flash.text.engine.FontLookup.DEVICE;
            fd.fontName = "Palatino";
            fd.fontWeight = flash.text.engine.FontWeight.BOLD;
            fd.fontPosture = flash.text.engine.FontPosture.ITALIC;

            var ef1:ElementFormat = new ElementFormat(fd);
            
            var str:String = "This is flash text 0123456789";
            var tb:TextBlock = new TextBlock();
            var te1:TextElement = new TextElement(str, ef1);
            tb.content = te1;
            var line1:TextLine = tb.createTextLine(null, 600);
            addChild(line1);
            
            fd2 = (fd.locked) ? fd.clone() : fd;    
            fd2.fontWeight = flash.text.engine.FontWeight.NORMAL;
            var ef2:ElementFormat = new ElementFormat(fd2);

            tb.content.elementFormat=ef2;
            var line2:TextLine = tb.createTextLine(null, 600);
            addChild(line2);
            
        }
    }    
}

isDeviceFontCompatible

()方法 
public static function isDeviceFontCompatible(fontName:String, fontWeight:String, fontPosture:String):Boolean

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10.1, AIR 2

如果可使用的裝置字體可以使用指定的 fontNamefontWeightfontPosture,則傳回 true。

flash.text.engine 類別僅能使用 OpenType 與 TrueType 裝置字體。如果使用較舊字體技術的字體,執行階段會逐字退回到已知良好狀態以顯示文字。

參數

fontName:String — 要檢查的裝置字體名稱。
 
fontWeight:String — 指定字體粗細。使用 FontWeight
 
fontPosture:String — 指定字體型態。使用 FontPosture

傳回值
Boolean — 如果有相容的裝置字體可供使用,則為 true,否則為 false

擲回值
ArgumentError — 指定的 fontWeight 不是 FontWeight 的成員。
 
ArgumentError — 指定的 fontPosture 不是 FontPosture 的成員。

相關 API 元素

isFontCompatible

()方法 
public static function isFontCompatible(fontName:String, fontWeight:String, fontPosture:String):Boolean

語言版本: ActionScript 3.0
執行階段版本: Flash Player 10, AIR 1.5, Flash Lite 4

如果指定的 fontNamefontWeightfontPosture 提供內嵌字體,而 Font.fontTypeflash.text.FontType.EMBEDDED_CFF 時,則傳回 true。從 Flash Player 10 開始,可以出現在應用程式內容中的內嵌字體有兩種:一般內嵌字體只由 TextField 使用。CFF 內嵌字體只由 flash.text.engine 類別使用。這兩種類型是由 enumerateFonts() 函數所傳回之 Font 類別的 fontType 屬性所辨別。

flash.text.engine 類別無法使用 EMBEDDED 類型的字體。如果 fontLookup 是設定為 FontLookup.EMBEDDED_CFF,而且在執行階段對於指定的名稱、粗細和型態所能提供的字體屬於類型 EMBEDDED,執行階段就會針對個別字符改使用裝置字體以顯示文字,就像是未提供指定名稱和樣式的內嵌字體一樣。

如果相同的名稱、粗細和型態提供 EMBEDDEDEMBEDDED_CFF 字體,則會選取 EMBEDDED_CFF 字體並使用 EMBEDDED_CFF 字體來顯示文字。

參數

fontName:String — 要檢查的內嵌字體名稱。
 
fontWeight:String — 指定字體粗細。使用 FontWeight
 
fontPosture:String — 指定字體型態。使用 FontPosture

傳回值
Boolean — 如果有相容的內嵌字體可供使用,則為 true,否則為 false

擲回值
ArgumentError — 指定的 fontWeight 不是 FontWeight 的成員。
 
ArgumentError — 指定的 fontPosture 不是 FontPosture 的成員。

相關 API 元素

FontDescriptionExample.as

此範例會建立 FontDescription 物件、為其指定裝置字體、設定不同的字體屬性,並將新物件指定給 ElementFormat 物件。其他字體格式化作業則會在 ElementFormat 內完成。此範例中會使用 ElementFormat 來建立新的 TextElement,而且會使用 TextElement 做為 TextBlock 的內容。接著會從 TextBlock 建立文字行。

package {

    import flash.display.Sprite;
    import flash.text.engine.*;

    
    public class FontDescriptionExample extends Sprite {
        
        public function FontDescriptionExample():void {
            var fd:FontDescription = new FontDescription();
            fd.fontLookup = flash.text.engine.FontLookup.DEVICE;
            fd.fontName = "Palatino";
            fd.fontWeight = flash.text.engine.FontWeight.BOLD;
            fd.fontPosture = flash.text.engine.FontPosture.ITALIC;

            var ef1:ElementFormat = new ElementFormat(fd);
            ef1.fontSize = 30;
            ef1.color = 0xFF0000;
            
            var str:String = "This is flash text 0123456789";
            var tb:TextBlock = new TextBlock();
            var te1:TextElement = new TextElement(str, ef1);
            tb.content = te1;
            var line1:TextLine = tb.createTextLine(null, 600);
            addChild(line1);
            
        }
    }    
}




[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。