| 包 | flashx.textLayout.formats |
| 类 | public class TextLayoutFormat |
| 继承 | TextLayoutFormat Object |
| 实现 | ITextLayoutFormat |
| 子类 | ListMarkerFormat |
| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
format 属性,允许您将一个 TextLayoutFormat 实例指定给这些类。将 TextLayoutFormat 对象指定给一个容器,以影响该容器全部内容的格式。将 TextLayoutFormat 对象指定给一个 FlowElement 后代,以便为该特定元素指定格式:TextFlow、ParagraphElement、DivElement、SpanElement、InlineGraphicElement、LinkElement 和 TCYElement。除了 format 属性之外,这些类还定义各个 TextLayoutFormat 属性,使您可以在需要时覆盖该元素的特定样式属性的设置。 由于您可以在多个级别设置给定样式,因此可能会发生冲突。例如,TextFlow 级别的文本颜色可能设置为黑色,而 SpanElement 对象将其设置为蓝色。一般规则是对于文本流树最低级别的设置优先级最高。因此,如果为 TextFlow 实例及 DivElement 都设置了连字级别,则 DivElement 设置优先级高。
层叠样式是指如果在较低级别未定义样式值,则采用文本流中更高级别样式的过程。如果在即将呈示的点处的元素上未定义样式,则该样式使用默认值或基于父元素上的值的值级联或后代。例如,如果文本透明度(textAlpha 属性)在 SpanElement 对象中未定义,但是在 TextFlow 上进行了定义,则 TextFlow.textAlpha 属性的值会层叠到 SpanElement 对象,并应用于该跨距的文本。层叠的结果,或应用于元素的样式之和,将存储在元素的 computedFormat 属性中。
以相同的方法,您可以使用 ContainerController 和 FlowElement 类的 userStyles 属性应用用户样式。使用该属性,您可以读写用户样式字典,并将其设置应用于一个容器或文本流元素。用户样式字典是由样式名-值对组成的对象。userStyles 属性指定的样式优先级高于其它所有样式。
未定义的大多数样式将在层叠时继承其直接父项的值。不过,少数样式不会继承父项的值,而是采用默认值来替代。
采用默认值(如果未定义)的样式属性包括:
backgroundAlpha、backgroundColor、columnCount、columnGap、columnWidth、lineBreak、paddingBottom、paddingLeft、paddingRight、paddingTop 和 verticalAlign
相关 API 元素
| 属性 | 由以下参数定义 | ||
|---|---|---|---|
| alignmentBaseline : *
指定主要基线对齐到的基线。 | TextLayoutFormat | ||
| backgroundAlpha : *
背景的 Alpha(透明度)值(如果在层叠期间未定义,则使用默认值)。 | TextLayoutFormat | ||
| backgroundColor : *
文本的背景颜色(如果在层叠期间未定义,则使用默认值)。 | TextLayoutFormat | ||
| baselineShift : *
从 dominantBaseline 值偏移基线的数量。 | TextLayoutFormat | ||
| blockProgression : *
指定线位置的垂直或水平行进。 | TextLayoutFormat | ||
| breakOpportunity : *
控制在将连续文本断开为多行时允许行断开的位置。 | TextLayoutFormat | ||
| cffHinting : *
用于此文本的 CFF 提示的类型。 | TextLayoutFormat | ||
| clearFloats : *
控制文本在浮点周围的环绕方式。 | TextLayoutFormat | ||
| color : *
文本的颜色。 | TextLayoutFormat | ||
| columnCount : *
文本列数(如果在层叠期间未定义,则使用默认值)。 | TextLayoutFormat | ||
| columnGap : *
指定要在列之间留出的装订线空间量(以像素为单位),如果在层叠期间未定义,则使用默认值。 | TextLayoutFormat | ||
| columnWidth : *
列宽(以像素为单位)(如果在层叠期间未定义,则使用默认值)。 | TextLayoutFormat | ||
![]() | constructor : Object
对类对象或给定对象实例的构造函数的引用。 | Object | |
| coreStyles : Object [只读] 返回此 TextLayoutFormat 的 coreStyles。 | TextLayoutFormat | ||
| defaultFormat : flashx.textLayout.formats:ITextLayoutFormat [静态] [只读]
返回使用默认设置的 TextLayoutFormat 对象。 | TextLayoutFormat | ||
| digitCase : *
用于此文本的数字大小写类型。 | TextLayoutFormat | ||
| digitWidth : *
用于此文本的数字宽度类型。 | TextLayoutFormat | ||
| direction : *
指定文本在文本块中的默认双向嵌入级别。 | TextLayoutFormat | ||
| dominantBaseline : *
指定该元素的哪条基线紧贴到 alignmentBaseline 以确定元素在该行上的垂直位置。 | TextLayoutFormat | ||
| firstBaselineOffset : *
指定容器中第一行的基线位置。 | TextLayoutFormat | ||
| fontFamily : *
要使用的字体的名称或用逗号分隔的字体名称列表。 | TextLayoutFormat | ||
| fontLookup : *
要使用的字体查找。 | TextLayoutFormat | ||
| fontSize : *
文本的大小(以像素为单位)。 | TextLayoutFormat | ||
| fontStyle : *
文本的样式。 | TextLayoutFormat | ||
| fontWeight : *
文本的粗细。 | TextLayoutFormat | ||
| justificationRule : *
用于将段落文本两端对齐的规则。 | TextLayoutFormat | ||
| justificationStyle : *
段落两端对齐所用的样式。 | TextLayoutFormat | ||
| kerning : *
字距调整可调整某些字符对之间的像素以提高可读性。 | TextLayoutFormat | ||
| leadingModel : *
指定行距模型,它是行距基准和行距方向的组合。 | TextLayoutFormat | ||
| ligatureLevel : *
控制可以在该文本中使用字体中定义的哪些连字。 | TextLayoutFormat | ||
| lineBreak : *
控制容器内的换行(如果在层叠期间未定义,则使用默认值)。 | TextLayoutFormat | ||
| lineHeight : *
文本的行距控制。 | TextLayoutFormat | ||
| lineThrough : *
若为 true,则应用删除线(一条穿过文本中间的直线)。 | TextLayoutFormat | ||
| linkActiveFormat : *
定义用于处于正常状态的链接的格式属性。 | TextLayoutFormat | ||
| linkHoverFormat : *
定义当鼠标在链接边界内(悬停)时用于悬停状态链接的格式属性。 | TextLayoutFormat | ||
| linkNormalFormat : *
定义用于处于正常状态的链接的格式属性。 | TextLayoutFormat | ||
| listAutoPadding : *
指定当列表相应侧的内边距值为 auto 时,列表开始边缘的自动缩进。 | TextLayoutFormat | ||
| listMarkerFormat : *
定义列表标记的格式属性。 | TextLayoutFormat | ||
| listStylePosition : *
合法值为 ListStylePosition.INSIDE、ListStylePosition.OUTSIDE、FormatValue.INHERIT。默认值未定义,指示未设置。如果在层叠期间未定义,则此属性从一个祖代继承值。 | TextLayoutFormat | ||
| listStyleType : *
合法值为 ListStyleType.UPPER_ALPHA、ListStyleType.LOWER_ALPHA、ListStyleType.UPPER_ROMAN、ListStyleType.LOWER_ROMAN、ListStyleType.NONE、ListStyleType.DISC、ListStyleType.CIRCLE、ListStyleType.SQUARE、ListStyleType.BOX、ListStyleType.CHECK、ListStyleType.DIAMOND、ListStyleType.HYPHEN、ListStyleType.ARABIC_INDIC、ListStyleType.BENGALI、ListStyleType.DECIMAL、ListStyleType.DECIMAL_LEADING_ZERO、ListStyleType.DEVANAGARI、ListStyleType.GUJARATI、ListStyleType.GURMUKHI、ListStyleType.KANNADA、ListStyleType.PERSIAN、ListStyleType.THAI、ListStyleType.URDU、ListStyleType.CJK_EARTHLY_BRANCH、ListStyleType.CJK_HEAVENLY_STEM、ListStyleType.HANGUL、ListStyleType.HANGUL_CONSTANT、ListStyleType.HIRAGANA、ListStyleType.HIRAGANA_IROHA、ListStyleType.KATAKANA、ListStyleType.KATAKANA_IROHA、ListStyleType.LOWER_ALPHA、ListStyleType.LOWER_GREEK、ListStyleType.LOWER_LATIN、ListStyleType.UPPER_ALPHA、ListStyleType.UPPER_GREEK、ListStyleType.UPPER_LATIN、FormatValue.INHERIT。默认值未定义,指示未设置。如果在层叠期间未定义,则此属性从一个祖代继承值。 | TextLayoutFormat | ||
| locale : *
文本的区域设置。 | TextLayoutFormat | ||
| paddingBottom : *
底部边界区(像素数)。 | TextLayoutFormat | ||
| paddingLeft : *
左侧边界区(像素数)。 | TextLayoutFormat | ||
| paddingRight : *
右侧边界区(像素数)。 | TextLayoutFormat | ||
| paddingTop : *
顶部边界区(像素数)。 | TextLayoutFormat | ||
| paragraphEndIndent : *
一个数字,指定段落结束边缘的缩进量(像素数)。 | TextLayoutFormat | ||
| paragraphSpaceAfter : *
一个数字,指定在段落后留出的空白(像素数)。 | TextLayoutFormat | ||
| paragraphSpaceBefore : *
一个数字,指定在段落前留出的空白(像素数)。 | TextLayoutFormat | ||
| paragraphStartIndent : *
一个数字,指定段落开始边缘的缩进量(像素数)。 | TextLayoutFormat | ||
| renderingMode : *
用于此文本的呈现模式。 | TextLayoutFormat | ||
| styleName : *
为元素指定一个标识类,从而可以通过引用 styleName 来设置元素样式。 | TextLayoutFormat | ||
| styles : Object [只读] 返回此 TextLayoutFormat 的样式。 | TextLayoutFormat | ||
| tabStops : *
指定与段落关联的制表位。 | TextLayoutFormat | ||
| textAlign : *
段落中的行与容器的对齐方式。 | TextLayoutFormat | ||
| textAlignLast : *
两端对齐文本中段落最后一行(或唯一的一行)与容器的对齐方式。 | TextLayoutFormat | ||
| textAlpha : *
文本的 Alpha(透明度)值。 | TextLayoutFormat | ||
| textDecoration : *
文本上的装饰。 | TextLayoutFormat | ||
| textIndent : *
一个数字,指定段落第一行的缩进量(以像素为单位)。 | TextLayoutFormat | ||
| textJustify : *
指定文本两端对齐的选项。 | TextLayoutFormat | ||
| textRotation : *
确定要旋转此文本的度数。 | TextLayoutFormat | ||
| trackingLeft : *
像素数(或字体大小的百分比,如 120%),指示应用于每个字符左侧的间隙数(手动字距调整)。 | TextLayoutFormat | ||
| trackingRight : *
像素数(或字体大小的百分比,如 120%)表示要应用到每个字符右边的间距的量(手动字距调整)。 | TextLayoutFormat | ||
| typographicCase : *
用于此文本的印刷大小写的类型。 | TextLayoutFormat | ||
| userStyles : Object [只读] 返回此 TextLayoutFormat 的 userStyles。 | TextLayoutFormat | ||
| verticalAlign : *
垂直对齐或两端对齐(如果在层叠期间未定义,则使用默认值)。 | TextLayoutFormat | ||
| whiteSpaceCollapse : *
将文本导入到 TextFlow 中时压缩或保留空白。 | TextLayoutFormat | ||
| wordSpacing : *
指定在两端对齐期间使用的单词之间的最佳间距、最小间距和最大间距(作为普通间距宽度的乘数)。 | TextLayoutFormat | ||
| 方法 | 由以下参数定义 | ||
|---|---|---|---|
TextLayoutFormat(initialValues:flashx.textLayout.formats:ITextLayoutFormat = null)
创建新 TextLayoutFormat 对象。 | TextLayoutFormat | ||
使用 incoming ITextLayoutFormat 实例中设置的属性值替换该 TextLayoutFormat 对象中的属性值。 | TextLayoutFormat | ||
将 incoming ITextLayoutFormat 实例中的属性值与该 TextLayoutFormat 对象的值串联。 | TextLayoutFormat | ||
将 incoming ITextLayoutFormat 实例中的属性值与该 TextLayoutFormat 对象的值串联。 | TextLayoutFormat | ||
将 TextLayoutFormat 设置从 values ITextLayoutFormat 实例复制到该 TextLayoutFormat 对象中。 | TextLayoutFormat | ||
[静态]
创建新 TextLayoutFormat 对象。 | TextLayoutFormat | ||
返回由指定样式名称的 styleProp 参数指定的样式的值。 | TextLayoutFormat | ||
![]() |
表示对象是否已经定义了指定的属性。 | Object | |
isEqual(p1:flashx.textLayout.formats:ITextLayoutFormat, p2:flashx.textLayout.formats:ITextLayoutFormat):Boolean [静态]
将 ITextLayoutFormat 实例 p1 中的属性与 ITextLayoutFormat 实例 p2 的属性相比较,如果所有属性匹配,则返回 true。 | TextLayoutFormat | ||
![]() |
表示 Object 类的实例是否在指定为参数的对象的原型链中。 | Object | |
![]() |
表示指定的属性是否存在、是否可枚举。 | Object | |
将该 TextLayoutFormat 对象中的属性设置为 undefined(如果这些属性与 incoming ITextLayoutFormat 实例中的属性不匹配)。 | TextLayoutFormat | ||
将该 TextLayoutFormat 对象中的属性设置为 undefined(如果这些属性与 incoming ITextLayoutFormat 实例中的属性匹配)。 | TextLayoutFormat | ||
![]() |
设置循环操作动态属性的可用性。 | Object | |
将 styleProp 参数指定的样式设置为 newValue 参数指定的值。 | TextLayoutFormat | ||
![]() |
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。 | Object | |
![]() |
返回指定对象的字符串表示形式。 | Object | |
![]() |
返回指定对象的原始值。 | Object | |
alignmentBaseline | 属性 |
alignmentBaseline:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定主要基线对齐到的基线。例如,如果将 dominantBaseline 设置为 ASCENT,则将 alignmentBaseline 设置为 DESCENT 会将文本的顶部与下缘基线对齐,或在该线下面。基线通常由行中最大的元素决定。

合法值为 TextBaseline.ROMAN、TextBaseline.ASCENT、TextBaseline.DESCENT、TextBaseline.IDEOGRAPHIC_TOP、TextBaseline.IDEOGRAPHIC_CENTER、TextBaseline.IDEOGRAPHIC_BOTTOM、TextBaseline.USE_DOMINANT_BASELINE、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 TextBaseline.USE_DOMINANT_BASELINE。
实现
public function get alignmentBaseline():* public function set alignmentBaseline(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
示例 ( 如何使用本示例 )
dominantBaseline 设置为 ASCENT 的段落中的三个跨距,将 alignmentBaseline 设置为三个不同的值(USE_DOMINANT_BASELINE、DESCENT 和 IDEOGRAPHIC_CENTER)。
package flashx.textLayout.formats.examples {
import flash.display.Sprite;
import flash.text.engine.TextBaseline;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextAlign;
public class TextLayoutFormat_alignmentBaselineExample extends Sprite
{
public function TextLayoutFormat_alignmentBaselineExample()
{
// create text flow with dominantBaseline of ASCENT and 3 spans
var textFlow:TextFlow = new TextFlow();
var paragraph:ParagraphElement = new ParagraphElement();
paragraph.fontFamily = "Helvetica";
paragraph.fontSize = 20;
paragraph.dominantBaseline = TextBaseline.ASCENT
var spanOne:SpanElement = new SpanElement();
var spanTwo:SpanElement = new SpanElement();
var spanThree:SpanElement = new SpanElement();
spanOne.text = "Hello, World ";
spanTwo.text = "Hello, World ";
spanThree.text = "Hello, World";
// add spans to paragraph and specify alignment baseline for each
paragraph.addChild(spanOne);
spanOne.alignmentBaseline = TextBaseline.USE_DOMINANT_BASELINE;
paragraph.addChild(spanTwo);
spanTwo.alignmentBaseline = TextBaseline.DESCENT;
paragraph.addChild(spanThree);
spanThree.alignmentBaseline = TextBaseline.IDEOGRAPHIC_CENTER;
// add paragraph to TextFlow and set container position
textFlow.addChild(paragraph);
this.x = 50;
this.y = 100;
// update controller to display on stage
textFlow.flowComposer.addController(new ContainerController(this,400,300));
textFlow.flowComposer.updateAllControllers();
}
}
}
backgroundAlpha | 属性 |
backgroundAlpha:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
背景的 Alpha(透明度)值(如果在层叠期间未定义,则使用默认值)。值为 0 表示完全透明,值为 1 表示完全不透明。Alpha 设置为 0 的显示对象是活动对象,即使它们不可见。
合法值为 0 到 1 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 1。
实现
public function get backgroundAlpha():* public function set backgroundAlpha(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
backgroundColor | 属性 |
backgroundColor:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本的背景颜色(如果在层叠期间未定义,则使用默认值)。可以是常量值 BackgroundColor.TRANSPARENT,或一个指定三个 8 位 RGB(红、绿、蓝)值的十六进制值,例如 0xFF0000 表示红色,0x00FF00 表示绿色。
合法字符串值为 BackgroundColor.TRANSPARENT、FormatValue.INHERIT 和从 0x0 到 0xffffffff 范围内的非整数。
默认值未定义,指示未设置。
如果在层叠期间未定义此属性,则其值为 BackgroundColor.TRANSPARENT。
实现
public function get backgroundColor():* public function set backgroundColor(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
baselineShift | 属性 |
baselineShift:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
基线距 dominantBaseline 值的偏移量。单位是像素或者 fontSize 的百分比(此时应输入字符串值,例如 140%)。如果是正值,则将水平文本行向上(对于垂直文本行是向右)移动;如果是负值,则将水平文本行向下(对于垂直文本行是向左)移动。
合法值为 BaselineShift.SUPERSCRIPT、BaselineShift.SUBSCRIPT、FormatValue.INHERIT。
合法值为 -1000 到 1000 范围内的数字。
百分比合法值为 -1000 到 1000 范围内的数字。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0.0。
实现
public function get baselineShift():* public function set baselineShift(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
blockProgression | 属性 |
blockProgression:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定线位置的垂直或水平行进。将行按照从上至下(BlockProgression.TB,用于水平文本行)或从右至左(BlockProgression.RL,用于垂直文本行)的顺序放置。
合法值为 BlockProgression.RL、BlockProgression.TB、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置此属性,则其值为 BlockProgression.TB。
实现
public function get blockProgression():* public function set blockProgression(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
breakOpportunity | 属性 |
breakOpportunity:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
控制在将连续文本断开为多行时允许行断开的位置。设置为 BreakOpportunity.AUTO 以正常断开文本。设置为 BreakOpportunity.NONE 以不断开文本,除非文本会超出测量限度且不存在任何其它位置来断开行。设置为 BreakOpportunity.ANY 以允许该行在任意位置断开,而不是仅仅在单词之间断开。设置为 BreakOpportunity.ALL 以将每个排版群集放置在一个单独的行上(对于路径上的文本很有用)。
合法值为 BreakOpportunity.ALL、BreakOpportunity.ANY、BreakOpportunity.AUTO、BreakOpportunity.NONE、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 BreakOpportunity.AUTO。
实现
public function get breakOpportunity():* public function set breakOpportunity(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
cffHinting | 属性 |
cffHinting:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
用于此文本的 CFF 提示的类型。CFF 提示决定了 Flash 运行时是否强制让粗水平线适合子像素网格。只有当 renderingMode 属性被设置为 RenderingMode.CFF 且嵌入了字体(fontLookup 属性被设置为 FontLookup.EMBEDDED_CFF)时,才会应用此属性。对于小的屏幕尺寸,提示将生成让人易于阅读的清晰文本。
合法值为 CFFHinting.NONE、CFFHinting.HORIZONTAL_STEM、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 CFFHinting.HORIZONTAL_STEM。
实现
public function get cffHinting():* public function set cffHinting(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
clearFloats | 属性 |
clearFloats:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
控制文本在浮点周围的环绕方式。如果值为“none”,将使得文本更紧密地环绕在浮点周围。如果值为“left”,将导致文本跳过容器中具有左侧浮点的任意部分。如果值为“right”,将导致文本跳过容器中具有右侧浮点的任意部分。如果值为“both”,将导致文本跳过所有浮点。
合法值为 ClearFloats.START、ClearFloats.END、ClearFloats.LEFT、ClearFloats.RIGHT、ClearFloats.BOTH、ClearFloats.NONE 和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 ClearFloats.NONE。
实现
public function get clearFloats():* public function set clearFloats(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时。
|
相关 API 元素
color | 属性 |
color:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本的颜色。一个十六进制数字,指定三个 8 位 RGB(红、绿、蓝)值,例如 0xFF0000 表示红色,0x00FF00 表示绿色。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0。
实现
public function get color():* public function set color(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
columnCount | 属性 |
columnCount:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本列数(如果在层叠期间未定义,则使用默认值)。该列数会覆盖其它列设置。该值是一个整数,如果未指定,则为 FormatValue.AUTO。如果未指定 columnCount,则系统使用 columnWidth 创建容器可容纳的尽可能多的列。
合法字符串值为 FormatValue.AUTO、FormatValue.INHERIT 和从 1 到 50 范围内的整数。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 FormatValue.AUTO。
实现
public function get columnCount():* public function set columnCount(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
columnGap | 属性 |
columnGap:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定要在列之间留出的装订线空间量(以像素为单位),如果在层叠期间未定义,则使用默认值。该值是一个数字。
合法值为 0 到 1000 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 20。
实现
public function get columnGap():* public function set columnGap(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
columnWidth | 属性 |
columnWidth:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
列宽(以像素为单位)(如果在层叠期间未定义,则使用默认值)。如果指定了列宽而没有指定列数,则 TextLayout 将根据容器宽度和 columnGap 设置,尽可能多地创建具有该宽度的列。在最后一个列之后将留出任意空格。该值是一个数字。
合法字符串值为 FormatValue.AUTO、FormatValue.INHERIT 和从 0 到 8000 范围内的数字。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 FormatValue.AUTO。
实现
public function get columnWidth():* public function set columnWidth(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
coreStyles | 属性 |
defaultFormat | 属性 |
defaultFormat:flashx.textLayout.formats:ITextLayoutFormat [只读] | 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
返回使用默认设置的 TextLayoutFormat 对象。此方法始终返回相同的对象。
实现
public static function get defaultFormat():flashx.textLayout.formats:ITextLayoutFormatdigitCase | 属性 |
digitCase:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
用于此文本的数字大小写类型。将该值设置为 DigitCase.OLD_STYLE 时接近支持不同上行字母和下行字母的小写字母形式。各位数字之间等比间隔。此样式只适用于所选的字体,最常用于 supplemental 或 expert 字体。DigitCase.LINING 设置具有 all-cap(全大写)高度,通常为等宽以便在图表中对齐。

合法值为 DigitCase.DEFAULT、DigitCase.LINING、DigitCase.OLD_STYLE、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 DigitCase.DEFAULT。
实现
public function get digitCase():* public function set digitCase(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
digitWidth | 属性 |
digitWidth:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
用于此文本的数字宽度类型。可以是 DigitWidth.PROPORTIONAL,最适用于显示单独出现的数字,或者是 DigitWidth.TABULAR,最适用于显示表、图表和垂直行中的数字。

合法值为 DigitWidth.DEFAULT、DigitWidth.PROPORTIONAL、DigitWidth.TABULAR、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 DigitWidth.DEFAULT。
实现
public function get digitWidth():* public function set digitWidth(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
direction | 属性 |
direction:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定文本在文本块中的默认双向嵌入级别。从左到右的阅读顺序,如在拉丁风格的文本中,或者从右到左的阅读顺序,如阿拉伯语或希伯来语。此属性还影响在容器级别应用时列的方向。与文本一样,列可以为从左到右或从右到左排列。下面给出了一些示例:

合法值为 Direction.LTR、Direction.RTL、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置此属性,则其值为 Direction.LTR。
实现
public function get direction():* public function set direction(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
dominantBaseline | 属性 |
dominantBaseline:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定该元素的哪条基线紧贴到 alignmentBaseline 以确定元素在该行上的垂直位置。值为 TextBaseline.AUTO 会基于父段落的 locale 属性选择主要基线。对于日语和中文,选定的基线值是 TextBaseline.IDEOGRAPHIC_CENTER;对于所有其它语言,选定的基线值是 TextBaseline.ROMAN。这些基线选项由选择的字体和字体大小决定。

合法值为 FormatValue.AUTO、TextBaseline.ROMAN、TextBaseline.ASCENT、TextBaseline.DESCENT、TextBaseline.IDEOGRAPHIC_TOP、TextBaseline.IDEOGRAPHIC_CENTER、TextBaseline.IDEOGRAPHIC_BOTTOM、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 FormatValue.AUTO。
实现
public function get dominantBaseline():* public function set dominantBaseline(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
firstBaselineOffset | 属性 |
firstBaselineOffset:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定容器中第一行的基线位置。该属性引用的基线取决于容器级别的区域设置。对于日语和中文,为 TextBaseline.IDEOGRAPHIC_BOTTOM;对于所有其它语言,为 TextBaseline.ROMAN。从容器顶部边界(如果 blockProgression 是 RL 则为右侧边界)到第一行的基线之间的偏移可以是 BaselineOffset.ASCENT,表示等于行的 ascent(文本顶端或右端到基线的距离),也可以是 BaselineOffset.LINE_HEIGHT,表示等于第一行的高度,或者是任何固定值数字,用于指定绝对距离。BaselineOffset.AUTO 可将行的 ascent 与容器顶部边界对齐。




合法字符串值为 BaselineOffset.AUTO、BaselineOffset.ASCENT、BaselineOffset.LINE_HEIGHT、FormatValue.INHERIT 和从 0 到 1000 范围内的数字。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置此属性,则其值为 BaselineOffset.AUTO。
实现
public function get firstBaselineOffset():* public function set firstBaselineOffset(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
fontFamily | 属性 |
fontFamily:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
要使用的字体的名称或用逗号分隔的字体名称列表。Flash 运行时使用列表中的第一个可用字体呈现该元素。例如,“Arial, Helvetica, _sans”使播放器搜索 Arial;如果没有找到 Arial,则搜索 Helvetica;如果两者都没找到,则搜索 _sans。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 Arial。
实现
public function get fontFamily():* public function set fontFamily(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
fontLookup | 属性 |
fontLookup:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
要使用的字体查找。指定为 FontLookup.DEVICE 时会使用运行 SWF 文件的系统上安装的字体。设备字体会减小影片大小,但是在不同系统和平台中文本的呈现方式可能不同。指定为 FontLookup.EMBEDDED_CFF 时会使用嵌入到已发布的 SWF 文件中的字体轮廓。嵌入的字体会增大 SWF 文件大小(有时程度很大),但是文本以所选的字体一致显示。
合法值为 FontLookup.DEVICE、FontLookup.EMBEDDED_CFF、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 FontLookup.DEVICE。
实现
public function get fontLookup():* public function set fontLookup(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
fontSize | 属性 |
fontSize:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本的大小(以像素为单位)。
合法值为 1 到 720 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 12。
实现
public function get fontSize():* public function set fontSize(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
fontStyle | 属性 |
fontStyle:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本的样式。可以为 FontPosture.NORMAL,用于纯文本,或者为 FontPosture.ITALIC,用于斜体。此属性只应用于设备字体(fontLookup 属性设置为 flash.text.engine.FontLookup.DEVICE 时)。
合法值为 FontPosture.NORMAL、FontPosture.ITALIC、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 FontPosture.NORMAL。
实现
public function get fontStyle():* public function set fontStyle(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
fontWeight | 属性 |
fontWeight:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本的粗细。可以为 FontWeight.NORMAL,用于纯文本,或者为 FontWeight.BOLD。只应用于设备字体(fontLookup 属性设置为 flash.text.engine.FontLookup.DEVICE 时)。
合法值为 FontWeight.NORMAL、FontWeight.BOLD、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 FontWeight.NORMAL。
实现
public function get fontWeight():* public function set fontWeight(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
justificationRule | 属性 |
justificationRule:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
用于将段落文本两端对齐的规则。默认值为 FormatValue.AUTO,它基于段落的 locale 属性将文本两端对齐。对于除了日语和中文之外的所有语言,FormatValue.AUTO 会变成 JustificationRule.SPACE,后者会向空格字符添加额外的空格。对于日语和中文,FormatValue.AUTO 会变成 JustficationRule.EAST_ASIAN。在某种程度上,两端对齐会改变标点的间距。在罗马文本中,逗号和日语句号占一个全字符的宽度,但在东亚文本中,仅占一个字符宽度的一半。另外,在东亚文本中,连续的标点符号之间的间距会变得更紧密,遵守传统东亚排版惯例。同样要注意的是,在下面的示例中,应用到段落的第二行的行距。在东亚版本中,最后两行向左推进。在罗马版本中,第二行和之后的行向左推进。

合法值为 JustificationRule.EAST_ASIAN、JustificationRule.SPACE、FormatValue.AUTO、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置了此属性,则其值为 FormatValue.AUTO。
实现
public function get justificationRule():* public function set justificationRule(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
justificationStyle | 属性 |
justificationStyle:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
段落两端对齐所用的样式。仅与 JustificationRule.EAST_ASIAN 的 justificationRule 设置一起使用。对于所有区域设置,FormatValue.AUTO 的默认值被解析为 JustificationStyle.PUSH_IN_KINSOKU。JustificationStyle 类定义的常量指定用于处理避头尾 (kinsoku) 字符的选项;避头尾字符是指不能出现在一行首尾的日语字符。如果希望文本布局更宽松,请指定 JustificationStyle.PUSH-OUT-ONLY。如果希望文本布局类似于使用 JustificationRule.SPACE 的 justificationRule 得到的结果,可使用 JustificationStyle.PRIORITIZE-LEAST-ADJUSTMENT。
合法值为 JustificationStyle.PRIORITIZE_LEAST_ADJUSTMENT、JustificationStyle.PUSH_IN_KINSOKU、JustificationStyle.PUSH_OUT_ONLY、FormatValue.AUTO、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置了此属性,则其值为 FormatValue.AUTO。
实现
public function get justificationStyle():* public function set justificationStyle(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
kerning | 属性 |
kerning:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
字距调整可调整某些字符对之间的像素以提高可读性。字距调整表的所有字体都支持字距调整。
合法值为 Kerning.ON、Kerning.OFF、Kerning.AUTO、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 Kerning.AUTO。
实现
public function get kerning():* public function set kerning(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
leadingModel | 属性 |
leadingModel:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定行距模型,它是行距基准和行距方向的组合。行距基准是 lineHeight 属性引用的基线。行距方向决定了 lineHeight 属性是引用一行基线与前一行基线之间的距离,还是与后一行基线之间的距离。默认值 FormatValue.AUTO 根据段落的 locale 属性进行解析。对于日语和中文,为 LeadingModel.IDEOGRAPHIC_TOP_DOWN,对于所有其他语言,为 LeadingModel.ROMAN_UP。
行距基准:

行距方向:

合法值为 LeadingModel.ROMAN_UP、LeadingModel.IDEOGRAPHIC_TOP_UP、LeadingModel.IDEOGRAPHIC_CENTER_UP、LeadingModel.IDEOGRAPHIC_TOP_DOWN、LeadingModel.IDEOGRAPHIC_CENTER_DOWN、LeadingModel.APPROXIMATE_TEXT_FIELD、LeadingModel.ASCENT_DESCENT_UP、LeadingModel.BOX、LeadingModel.AUTO、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置此属性,则其值为 LeadingModel.AUTO。
实现
public function get leadingModel():* public function set leadingModel(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
ligatureLevel | 属性 |
ligatureLevel:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
控制可以在该文本中使用字体中定义的哪些连字。对于每个设置显示的连字取决于字体。由两个或两个以上的字母结合在一起形成单个字型时就是连字。连字通常用于替换一些共享公共部分的连续字符,例如字母对“fi”、“fl”或“ae”。在拉丁语字符集和非拉丁语字符集中均可使用连字。LigatureLevel 类的值(MINIMUM、COMMON、UNCOMMON 和 EXOTIC)支持的连字是添加的。每个值支持一个新连字集,而且包含先前类型的那些连字。
注意:使用阿拉伯语或叙利亚语字体时,必须将 ligatureLevel 设置为 MINIMUM 或更高。

合法值为 LigatureLevel.MINIMUM、LigatureLevel.COMMON、LigatureLevel.UNCOMMON、LigatureLevel.EXOTIC、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 LigatureLevel.COMMON。
实现
public function get ligatureLevel():* public function set ligatureLevel(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
lineBreak | 属性 |
lineBreak:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
控制容器内的换行(如果在层叠期间未定义,则使用默认值)。可以将容器中的文本设置为适合容器的宽度 (LineBreak.TO_FIT),也可以设置为只在显式回车或换行符处断开 (LineBreak.EXPLICIT)。
合法值为 LineBreak.EXPLICIT、LineBreak.TO_FIT、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 LineBreak.TO_FIT。
实现
public function get lineBreak():* public function set lineBreak(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
lineHeight | 属性 |
lineHeight:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本的行距控制。上一行或下一行(取决于 LeadingModel)的基线与当前行的基线之间的距离,等于应用于该行中任意字符的最大行距。该值可以是数字或百分比。如果指定百分比,请输入字符串值,例如 140%。


合法值为 -720 到 720 范围内的数字。
合法值为 -1000% 到 1000% 范围内的百分比数字。
合法值包括 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 120%。
实现
public function get lineHeight():* public function set lineHeight(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
lineThrough | 属性 |
lineThrough:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
如果为 true,则应用删除线(贯穿文本中间绘制的线)。
合法值为 true、false 和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 false。
实现
public function get lineThrough():* public function set lineThrough(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
linkActiveFormat | 属性 |
linkActiveFormat:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
定义用于处于正常状态的链接的格式属性。此值将向下层叠层次结构,并应用于作为后代的所有链接。接受 inherit,一个 ITextLayoutFormat,或将带有键和值的对象数组作为成员转换为 TextLayoutFormat。
合法值包括 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置了此属性,则其值为 null。
实现
public function get linkActiveFormat():* public function set linkActiveFormat(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时。
|
linkHoverFormat | 属性 |
linkHoverFormat:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
定义当鼠标在链接边界内(悬停)时用于悬停状态链接的格式属性。此值将向下层叠层次结构,并应用于作为后代的所有链接。接受 inherit,一个 ITextLayoutFormat,或将带有键和值的对象数组作为成员转换为 TextLayoutFormat。
合法值包括 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 null。
实现
public function get linkHoverFormat():* public function set linkHoverFormat(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时。
|
linkNormalFormat | 属性 |
linkNormalFormat:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
定义用于处于正常状态的链接的格式属性。此值将向下层叠层次结构,并应用于作为后代的所有链接。接受 inherit,一个 ITextLayoutFormat,或将带有键和值的对象数组作为成员转换为 TextLayoutFormat。
合法值包括 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置了此属性,则其值为 null。
实现
public function get linkNormalFormat():* public function set linkNormalFormat(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时。
|
listAutoPadding | 属性 |
listAutoPadding:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定当列表相应侧的内边距值为 auto 时,列表开始边缘的自动缩进。
合法值为 -1000 到 1000 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置了此属性,则其值为 40。
实现
public function get listAutoPadding():* public function set listAutoPadding(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
listMarkerFormat | 属性 |
listMarkerFormat:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
定义列表标记的格式属性。此值将向下层叠层次结构,并应用于作为后代的所有链接。接受 inherit,一个 IListMarkerFormat,或将带有键与值的对象数组作为成员转换为 ListMarkerFormat。
合法值包括 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置了此属性,则其值为 null。
实现
public function get listMarkerFormat():* public function set listMarkerFormat(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时。
|
listStylePosition | 属性 |
listStylePosition:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
合法值为 ListStylePosition.INSIDE、ListStylePosition.OUTSIDE、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置此属性,则其值为 ListStylePosition.OUTSIDE。
实现
public function get listStylePosition():* public function set listStylePosition(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
listStyleType | 属性 |
listStyleType:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
合法值为 ListStyleType.UPPER_ALPHA、ListStyleType.LOWER_ALPHA、ListStyleType.UPPER_ROMAN、ListStyleType.LOWER_ROMAN、ListStyleType.NONE、ListStyleType.DISC、ListStyleType.CIRCLE、ListStyleType.SQUARE、ListStyleType.BOX、ListStyleType.CHECK、ListStyleType.DIAMOND、ListStyleType.HYPHEN、ListStyleType.ARABIC_INDIC、ListStyleType.BENGALI、ListStyleType.DECIMAL、ListStyleType.DECIMAL_LEADING_ZERO、ListStyleType.DEVANAGARI、ListStyleType.GUJARATI、ListStyleType.GURMUKHI、ListStyleType.KANNADA、ListStyleType.PERSIAN、ListStyleType.THAI、ListStyleType.URDU、ListStyleType.CJK_EARTHLY_BRANCH、ListStyleType.CJK_HEAVENLY_STEM、ListStyleType.HANGUL、ListStyleType.HANGUL_CONSTANT、ListStyleType.HIRAGANA、ListStyleType.HIRAGANA_IROHA、ListStyleType.KATAKANA、ListStyleType.KATAKANA_IROHA、ListStyleType.LOWER_ALPHA、ListStyleType.LOWER_GREEK、ListStyleType.LOWER_LATIN、ListStyleType.UPPER_ALPHA、ListStyleType.UPPER_GREEK、ListStyleType.UPPER_LATIN、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置此属性,则其值为 ListStyleType.DISC。
实现
public function get listStyleType():* public function set listStyleType(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
locale | 属性 |
locale:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本的区域设置。控制大小写转换和形状。使用标准区域设置标识符,如 Unicode Technical Standard #35 中所述。例如,en、en_US 和 en-US 均表示英语,ja 表示日语。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 en。
实现
public function get locale():* public function set locale(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
paddingBottom | 属性 |
paddingBottom:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
底部边界区(像素数)。如果默认值为 auto,表示为零,除非列表中的开始边缘内边距为 45。(如果在层叠期间未定义,则使用默认值)。容器底部边缘与文本之间的空间。该值是一个数字或 auto。
对于水平文本,在含有多个列的可滚动容器中,第一列和后续列将填充部分显示为容器底部的空白,但是对于最后一列,如果文本没有完全填充,可能必须进行滚动才能看到填充。
合法字符串值为 FormatValue.AUTO、FormatValue.INHERIT 和从 -8000 到 8000 范围内的数字。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 FormatValue.AUTO。
实现
public function get paddingBottom():* public function set paddingBottom(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
paddingLeft | 属性 |
paddingLeft:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
左侧边界区(像素数)。如果默认值为 auto,表示为零,除非列表中的开始边缘内边距为 45。(如果在层叠期间未定义,则使用默认值)。容器左边缘与文本之间的空间。该值是一个数字或 auto。
对于垂直文本,在含有多个列的可滚动容器中,第一列和后续列将填充部分显示为容器末尾的空白,但是对于最后一列,如果文本没有完全填充,可能必须进行滚动才能看到填充。
合法字符串值为 FormatValue.AUTO、FormatValue.INHERIT 和从 -8000 到 8000 范围内的数字。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 FormatValue.AUTO。
实现
public function get paddingLeft():* public function set paddingLeft(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
paddingRight | 属性 |
paddingRight:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
右侧边界区(像素数)。如果默认值为 auto,表示为零,除非列表中的开始边缘内边距为 45。(如果在层叠期间未定义,则使用默认值)。容器右边缘与文本之间的空间。该值是一个数字或 auto。
合法字符串值为 FormatValue.AUTO、FormatValue.INHERIT 和从 -8000 到 8000 范围内的数字。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 FormatValue.AUTO。
实现
public function get paddingRight():* public function set paddingRight(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
paddingTop | 属性 |
paddingTop:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
顶部边界区(像素数)。如果默认值为 auto,表示为零,除非列表中的开始边缘内边距为 45。(如果在层叠期间未定义,则使用默认值)。容器顶部边缘与文本之间的空间。该值是一个数字或 auto。
合法字符串值为 FormatValue.AUTO、FormatValue.INHERIT 和从 -8000 到 8000 范围内的数字。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 FormatValue.AUTO。
实现
public function get paddingTop():* public function set paddingTop(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
paragraphEndIndent | 属性 |
paragraphEndIndent:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
一个数字,指定段落结束边缘的缩进量(像素数)。是指从左到右文本中的右边缘和从右到左文本中的左边缘。
合法值为 0 到 8000 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0。
实现
public function get paragraphEndIndent():* public function set paragraphEndIndent(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
paragraphSpaceAfter | 属性 |
paragraphSpaceAfter:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
一个数字,指定在段落后留出的空白(像素数)。与 paragraphSpaceBefore 一起使用时会合并。
合法值为 0 到 8000 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0。
实现
public function get paragraphSpaceAfter():* public function set paragraphSpaceAfter(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
paragraphSpaceBefore | 属性 |
paragraphSpaceBefore:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
一个数字,指定在段落前留出的空白(像素数)。与 paragraphSpaceAfter 一起使用时会合并。
合法值为 0 到 8000 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0。
实现
public function get paragraphSpaceBefore():* public function set paragraphSpaceBefore(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
paragraphStartIndent | 属性 |
paragraphStartIndent:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
一个数字,指定段落开始边缘的缩进量(像素数)。是指从左至右文本的左边和从右至左文本的右边。
合法值为 0 到 8000 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0。
实现
public function get paragraphStartIndent():* public function set paragraphStartIndent(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
renderingMode | 属性 |
renderingMode:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
用于此文本的呈现模式。只应用于嵌入字体(fontLookup 属性设置为 FontLookup.EMBEDDED_CFF 时)。
合法值为 RenderingMode.NORMAL、RenderingMode.CFF、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 RenderingMode.CFF。
实现
public function get renderingMode():* public function set renderingMode(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
styleName | 属性 |
styleName:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将一个标识类指定给该元素,以允许通过引用 styleName 为该元素设置样式。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 null。
实现
public function get styleName():* public function set styleName(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时。
|
styles | 属性 |
tabStops | 属性 |
tabStops:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定与段落关联的制表位。Setter 可采用 TabStopFormat 数组、精简的字符串表示形式、undefined 或 FormatValue.INHERIT。精简的字符串表示形式始终转换为 TabStopFormat 的一个数组。
基于字符串的格式是一个制表位列表,其中各个制表位由一个或多个空格分隔。
制表位的形式为:<对齐类型><对齐位置>|<对齐标记>。
对齐类型由一个字符表示,可以是 S、E、C 或 D(或相应小写字母)。S 或 s 表示起始,E 或 e 表示末尾,C 或 c 表示中心,D 或 d 表示小数。对齐类型是可选的,如果未指定,将默认为 S。
对齐位置是一个数字,根据数字的 FXG 规范(小数或科学表示法)指定。对齐位置是必需的。
垂直竖线用于分隔对齐位置和对齐标记,只有当存在对齐标记时才应存在。
如果对齐类型为 D,则对齐标记是可选的,如果是其它对齐类型,则对齐标记不应存在。对齐标记可以是由制表位末尾空白所终止的任何字符序列(对于最后一个制表位,末尾空白可选,默认为对齐标记的末尾)。如果空格由反斜杠进行转义 (\ ),则可以是对齐标记本身的一部分。如果反斜杠由另一个反斜杠进行转义 (\\),则可以是对齐标记本身的一部分。如果对齐类型为 D,且未指定对齐标记,则会使用默认值 null。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置了此属性,则其值为 null。
实现
public function get tabStops():* public function set tabStops(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
textAlign | 属性 |
textAlign:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
段落中的行与容器的对齐方式。TextAlign.LEFT 将文本行与容器左边缘对齐。TextAlign.RIGHT 与右边缘对齐。TextAlign.CENTER 等效于将从左至右的文本设置为左对齐,或将从右至左的文本设置为右对齐。TextAlign.JUSTIFY 会展开行,使其充满整个空间。TextAlign.START 等效于将从左至右的文本设置为左对齐,或将从右至左的文本设置为右对齐。TextAlign.END 等效于将从左至右的文本设置为右对齐,或将从右至左的文本设置为左对齐。
合法值为 TextAlign.LEFT、TextAlign.RIGHT、TextAlign.CENTER、TextAlign.JUSTIFY、TextAlign.START、TextAlign.END、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 TextAlign.START。
实现
public function get textAlign():* public function set textAlign(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
textAlignLast | 属性 |
textAlignLast:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
两端对齐文本中段落最后一行(或唯一的一行)与容器的对齐方式。如果 textAlign 设置为 TextAlign.JUSTIFY,则 textAlignLast 指定最后一行(如果是只含一行的块则为唯一一行)的对齐方式。其值类似于 textAlign。
合法值为 TextAlign.LEFT、TextAlign.RIGHT、TextAlign.CENTER、TextAlign.JUSTIFY、TextAlign.START、TextAlign.END、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 TextAlign.START。
实现
public function get textAlignLast():* public function set textAlignLast(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
textAlpha | 属性 |
textAlpha:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本的 Alpha(透明度)值。值为 0 表示完全透明,值为 1 表示完全不透明。textAlpha 设置为 0 的显示对象是活动对象,即使它们不可见。
合法值为 0 到 1 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 1。
实现
public function get textAlpha():* public function set textAlpha(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
textDecoration | 属性 |
textDecoration:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
文本上的装饰。用于应用下划线,默认值为 none。
合法值为 TextDecoration.NONE、TextDecoration.UNDERLINE、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 TextDecoration.NONE。
实现
public function get textDecoration():* public function set textDecoration(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
textIndent | 属性 |
textIndent:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
一个数字,指定段落第一行的缩进量(以像素为单位)。如果为负值,则会将行向边缘中推进,可能会推到容器之外。
合法值为 -8000 到 8000 范围内的数字和 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0。
实现
public function get textIndent():* public function set textIndent(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
textJustify | 属性 |
textJustify:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定文本两端对齐的选项。默认值为 TextJustify.INTER_WORD,表示向空格符添加额外空格。TextJustify.DISTRIBUTE 会向空格符和各字母之间添加额外空格。仅与 JustificationRule.SPACE 的 justificationRule 值一起使用。
合法值为 TextJustify.INTER_WORD、TextJustify.DISTRIBUTE、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置此属性,则其值为 TextJustify.INTER_WORD。
实现
public function get textJustify():* public function set textJustify(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
textRotation | 属性 |
textRotation:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
确定要旋转此文本的度数。
合法值为 TextRotation.ROTATE_0、TextRotation.ROTATE_180、TextRotation.ROTATE_270、TextRotation.ROTATE_90、TextRotation.AUTO、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 TextRotation.AUTO。
实现
public function get textRotation():* public function set textRotation(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
trackingLeft | 属性 |
trackingLeft:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
数字(以像素为单位)(或 fontSize 的百分比,如 120%)表示要应用到每个字符左边的间距的量(手动字距调整)。如果启用字距调整,则会将 trackingLeft 值与字体字距调整表中的值相加。如果禁用字距调整,则使用 trackingLeft 值作为手动字距调整值。同时支持正值和负值。
合法值为 -1000 到 1000 范围内的数字。
合法值为 -1000% 到 1000% 范围内的百分比数字。
合法值包括 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0。
实现
public function get trackingLeft():* public function set trackingLeft(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
trackingRight | 属性 |
trackingRight:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
数字(以像素为单位)(或 fontSize 的百分比,如 120%)表示要应用到每个字符右边的间距的量(手动字距调整)。如果启用字距调整,则会将 trackingRight 值与字体字距调整表中的值相加。如果禁用字距调整,则使用 trackingRight 值作为手动字距调整值。同时支持正值和负值。
合法值为 -1000 到 1000 范围内的数字。
合法值为 -1000% 到 1000% 范围内的百分比数字。
合法值包括 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置了此属性,则其值为 0。
实现
public function get trackingRight():* public function set trackingRight(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
typographicCase | 属性 |
typographicCase:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
用于此文本的印刷大小写的类型。下面给出了一些示例:

合法值为 TLFTypographicCase.DEFAULT、TLFTypographicCase.CAPS_TO_SMALL_CAPS、TLFTypographicCase.UPPERCASE、TLFTypographicCase.LOWERCASE、TLFTypographicCase.LOWERCASE_TO_SMALL_CAPS、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果没有祖代设置此属性,则其值为 TLFTypographicCase.DEFAULT。
实现
public function get typographicCase():* public function set typographicCase(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
userStyles | 属性 |
verticalAlign | 属性 |
verticalAlign:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
垂直对齐或两端对齐(如果在层叠期间未定义,则使用默认值)。确定 TextFlow 元素在容器内如何对齐。
合法值为 VerticalAlign.TOP、VerticalAlign.MIDDLE、VerticalAlign.BOTTOM、VerticalAlign.JUSTIFY、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性值为 VerticalAlign.TOP。
实现
public function get verticalAlign():* public function set verticalAlign(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
whiteSpaceCollapse | 属性 |
whiteSpaceCollapse:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将文本导入到 TextFlow 中时压缩或保留空白。WhiteSpaceCollapse.PRESERVE 会保留所有空白字符。如果为 WhiteSpaceCollapse.COLLAPSE,则会删除导入的文本块中的新行、制表符以及前导或结尾空格。换行标记 () 和 Unicode 行分隔符将会保留。
合法值为 WhiteSpaceCollapse.PRESERVE、WhiteSpaceCollapse.COLLAPSE、FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性将从一个祖代继承值。如果在层叠期间未定义此属性,则其值为 WhiteSpaceCollapse.COLLAPSE。
实现
public function get whiteSpaceCollapse():* public function set whiteSpaceCollapse(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
相关 API 元素
wordSpacing | 属性 |
wordSpacing:*| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
指定在两端对齐期间使用的单词之间的最佳间距、最小间距和最大间距(作为普通间距宽度的乘数)。最佳间距用于表示间距的期望大小,作为字体中定义值的一部分。在使用字母间距对齐行之前,通过分配 textJustify 来确定词间距的宽度时使用最小和最大值。
合法值为 -1000% 到 1000% 范围内的百分比数字。
合法值包括 FormatValue.INHERIT。
默认值未定义,指示未设置。
如果在层叠期间未定义,则此属性从一个祖代继承值。如果没有祖代设置了此属性,则其值为 100%、50%、150%。
实现
public function get wordSpacing():* public function set wordSpacing(value:any):void引发
RangeError — 当设置的值不在此属性的范围内时
|
TextLayoutFormat | () | 构造函数 |
public function TextLayoutFormat(initialValues:flashx.textLayout.formats:ITextLayoutFormat = null)| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
创建新 TextLayoutFormat 对象。所有设置都是空的,或通过提供的 initialValues 对象进行初始化(可选)。
initialValues:flashx.textLayout.formats:ITextLayoutFormat (default = null) — 从其复制初始值的可选实例。
|
相关 API 元素
apply | () | 方法 |
public function apply(incoming:flashx.textLayout.formats:ITextLayoutFormat):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
使用 incoming ITextLayoutFormat 实例中设置的属性值替换该 TextLayoutFormat 对象中的属性值。在 incoming ITextLayoutFormat 实例中为 undefined 的属性在该对象中不会改变。
参数
incoming:flashx.textLayout.formats:ITextLayoutFormat — 其属性值应用于该 TextLayoutFormat 对象的实例。
|
示例 ( 如何使用本示例 )
package flashx.textLayout.formats.examples {
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextLayoutFormat;
public class TextLayoutFormat_applyExample extends Sprite
{
public function TextLayoutFormat_applyExample()
{
// create a container and add it to the stage
var container:Sprite = new Sprite();
this.stage.addChild(container);
// create TextFlow, ParagraphElement, and SpanElement objects
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span:SpanElement = new SpanElement();
// create two TextLayoutFormat objects
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
var textLayoutFormat2:TextLayoutFormat = new TextLayoutFormat();
// set format attributes in the first one
textLayoutFormat.textIndent = 8;
textLayoutFormat.color = 0x336633;
textLayoutFormat.fontFamily = "Arial, Helvetica, _sans";
textLayoutFormat.fontSize = 24;
// set some of the same attributes on the second one
textLayoutFormat2.color = 0x0000CC;
textLayoutFormat2.fontSize = 12;
textLayoutFormat2.textIndent = 24;
// add text to the span, the span to the paragraph, and the paragraph to the text flow.
span.text = "Notice that fontFamily is unchanged because it was undefined in textLayoutFormat2.";
p.addChild( span);
textFlow.addChild(p);
// use apply() to apply textLayoutFormat2 format settings; assign format to the text flow
textLayoutFormat.apply(textLayoutFormat2);
textFlow.hostFormat = textLayoutFormat;
// add paragraph to textFlow and update controller to display it
textFlow.addChild(p);
var controller:ContainerController = new ContainerController(container, 200, 200 );
textFlow.flowComposer.addController(controller);
textFlow.flowComposer.updateAllControllers();
}
}
}
concat | () | 方法 |
public function concat(incoming:flashx.textLayout.formats:ITextLayoutFormat):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将 incoming ITextLayoutFormat 实例中的属性值与该 TextLayoutFormat 对象的值串联。在此(接收)TextLayoutFormat 对象中,值为 FormatValue.INHERIT 的属性和值为 undefined 的继承属性将从 incoming 对象获取新值。值为 undefined 的非继承属性将获取其默认值。所有其它属性值将保持不变。
参数
incoming:flashx.textLayout.formats:ITextLayoutFormat — 串联其值的实例。
|
相关 API 元素
示例 ( 如何使用本示例 )
package flashx.textLayout.formats.examples {
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextLayoutFormat;
public class TextLayoutFormat_concatExample extends Sprite
{
public function TextLayoutFormat_concatExample()
{
// create a container and add it to the stage
var container:Sprite = new Sprite();
this.stage.addChild(container);
// create TextFlow, ParagraphElement, and SpanElement objects
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span:SpanElement = new SpanElement();
// create two TextLayoutFormat objects
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
var textLayoutFormat2:TextLayoutFormat = new TextLayoutFormat();
// set format attributes in the first one
textLayoutFormat.textIndent = 8;
textLayoutFormat.color = 0x336633;
textLayoutFormat.fontSize = 18;
// set some of the same attributes on the second one
textLayoutFormat2.textIndent = 24;
textLayoutFormat2.color = 0x0000CC;
textLayoutFormat2.fontSize = 12;
textLayoutFormat2.fontFamily = "Arial, Helvetica, _sans";
// concat textLayoutFormat2 settings; assign format to the text flow
textLayoutFormat.concat(textLayoutFormat2);
textFlow.hostFormat = textLayoutFormat;
// add text to the span, the span to the paragraph, and the paragraph to the text flow.
span.text = "Notice that fontFamily value has been added from textLayout2 to textLayout but " +
"the other values have not been changed.";
p.addChild( span);
textFlow.addChild(p);
// update controller to display it
var controller:ContainerController = new ContainerController(container, 200, 200 );
textFlow.flowComposer.addController(controller);
textFlow.flowComposer.updateAllControllers();
}
}
}
concatInheritOnly | () | 方法 |
public function concatInheritOnly(incoming:flashx.textLayout.formats:ITextLayoutFormat):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将 incoming ITextLayoutFormat 实例中的属性值与该 TextLayoutFormat 对象的值串联。在此(接收)TextLayoutFormat 对象中,值为 FormatValue.INHERIT 的属性和值为 undefined 的继承属性将从 incoming 对象获取新值。所有其它属性值将保持不变。
参数
incoming:flashx.textLayout.formats:ITextLayoutFormat — 串联其值的实例。
|
相关 API 元素
示例 ( 如何使用本示例 )
package flashx.textLayout.formats.examples {
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextLayoutFormat;
public class TextLayoutFormat_concatInheritOnlyExample extends Sprite
{
public function TextLayoutFormat_concatInheritOnlyExample()
{
// create a container and add it to the stage
var container:Sprite = new Sprite();
this.stage.addChild(container);
// create TextFlow, ParagraphElement, and SpanElement objects
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span:SpanElement = new SpanElement();
// create two TextLayoutFormat objects
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
var textLayoutFormat2:TextLayoutFormat = new TextLayoutFormat();
// set format attributes in the first one
textLayoutFormat.color = 0xFF0000;
textLayoutFormat.fontSize = undefined;
// set attributes on the second one (fontSize set here, too)
textLayoutFormat2.color = 0x00FF00;
textLayoutFormat2.backgroundColor = 0x00CCCC;
textLayoutFormat2.fontSize = 16;
textLayoutFormat2.fontFamily = "Times Roman";
// concat textLayoutFormat2 settings; assign format to the text flow
textLayoutFormat.concatInheritOnly(textLayoutFormat2);
textFlow.hostFormat = textLayoutFormat;
// add text to the span, the span to the paragraph, and the paragraph to the text flow.
span.text = "Notice that the value of backgroundColor is "
span.text += textLayoutFormat.backgroundColor;
span.text += ", even though it is set in textLayoutFormat2. This is because " +
"this property does not inherit. Also notice that font color does not change " +
"because it is not undefined."
p.addChild( span);
textFlow.addChild(p);
// update controller to display it
var controller:ContainerController = new ContainerController(container, 200, 200 );
textFlow.flowComposer.addController(controller);
textFlow.flowComposer.updateAllControllers();
}
}
}
copy | () | 方法 |
public function copy(incoming:flashx.textLayout.formats:ITextLayoutFormat):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将 TextLayoutFormat 设置从 values ITextLayoutFormat 实例复制到该 TextLayoutFormat 对象中。如果 values 为 null,则此 TextLayoutFormat 对象使用所有属性的未定义值初始化。
参数
incoming:flashx.textLayout.formats:ITextLayoutFormat — 从其复制值的可选实例。
|
示例 ( 如何使用本示例 )
package flashx.textLayout.formats.examples {
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextLayoutFormat;
public class TextLayoutFormat_copyExample extends Sprite
{
public function TextLayoutFormat_copyExample()
{
// create a container and add it to the stage
var container:Sprite = new Sprite();
this.stage.addChild(container);
// create TextFlow, ParagraphElement, and SpanElement objects
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span:SpanElement = new SpanElement();
// create two TextLayoutFormat objects
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
var textLayoutFormat2:TextLayoutFormat = new TextLayoutFormat();
// set format attributes in the second one
textLayoutFormat2.textIndent = 8;
textLayoutFormat2.color = 0x336633;
textLayoutFormat2.fontFamily = "Times Roman";
textLayoutFormat2.fontSize = 18;
// add text to the span, the span to the paragraph, and the paragraph to the text flow.
span.text = "Notice that formatting values set in textLayoutFormat2 override " +
"the default values in textLayoutFormat.";
p.addChild(span);
textFlow.addChild(p);
// copy format settings of textLayoutFormat2; assign format to the text flow
textLayoutFormat.copy(textLayoutFormat2);
textFlow.hostFormat = textLayoutFormat;
// add paragraph to textFlow and update controller to display it
textFlow.addChild(p);
var controller:ContainerController = new ContainerController(container, 200, 200 );
textFlow.flowComposer.addController(controller);
textFlow.flowComposer.updateAllControllers();
}
}
}
createTextLayoutFormat | () | 方法 |
public static function createTextLayoutFormat(initialValues:Object):flashx.textLayout.formats:TextLayoutFormat| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
创建新 TextLayoutFormat 对象。所有设置都是空的,或通过提供的 initialValues 对象进行初始化(可选)。
参数
initialValues:Object — 如果复制 ITextLayoutFormat 对象的值,则是从其复制初始值的可选实例。否则,此参数会看作 Dictionary 或 Object,并将其迭代。
|
flashx.textLayout.formats:TextLayoutFormat |
getStyle | () | 方法 |
isEqual | () | 方法 |
public static function isEqual(p1:flashx.textLayout.formats:ITextLayoutFormat, p2:flashx.textLayout.formats:ITextLayoutFormat):Boolean| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将 ITextLayoutFormat 实例 p1 中的属性与 ITextLayoutFormat 实例 p2 的属性相比较,如果所有属性匹配,则返回 true。
参数
p1:flashx.textLayout.formats:ITextLayoutFormat — 与 p2 比较的实例。
| |
p2:flashx.textLayout.formats:ITextLayoutFormat — 与 p1 比较的实例。
|
Boolean — 如果所有属性匹配,则为 true,否则为 false。
|
removeClashing | () | 方法 |
public function removeClashing(incoming:flashx.textLayout.formats:ITextLayoutFormat):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将该 TextLayoutFormat 对象中的属性设置为 undefined(如果这些属性与 incoming ITextLayoutFormat 实例中的属性不匹配)。
参数
incoming:flashx.textLayout.formats:ITextLayoutFormat — 与该 TextLayoutFormat 对象的属性值进行比较的实例。
|
示例 ( 如何使用本示例 )
undefined,并取消已应用的值。
package flashx.textLayout.formats.examples {
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextLayoutFormat;
public class TextLayoutFormat_removeClashingExample extends Sprite
{
public function TextLayoutFormat_removeClashingExample()
{
// create a container and add it to the stage
var container:Sprite = new Sprite();
this.stage.addChild(container);
// create TextFlow, ParagraphElement, and SpanElement objects
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span:SpanElement = new SpanElement();
// create two TextLayoutFormat objects
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
var textLayoutFormat2:TextLayoutFormat = new TextLayoutFormat();
// set format attributes for textLayoutFormat2
textLayoutFormat.textIndent = 8;
textLayoutFormat.color = 0x336633;
textLayoutFormat.fontFamily = "Arial, Helvetica, _sans";
textLayoutFormat.fontSize = 24;
// set fontFamily to same value for textLayoutFormat2
textLayoutFormat2.fontFamily = "Arial, Helvetica, _sans";
// add text to the span, the span to the paragraph, and the paragraph to the text flow.
span.text = "Notice that fontFamily (Arial, Helvetica, _sans) is applied."
p.addChild( span);
textFlow.addChild(p);
// call removeClashing(), cancelling any values that clash with textLayoutFormat;
// assign it to the text flow
textLayoutFormat.removeClashing(textLayoutFormat2);
textFlow.hostFormat = textLayoutFormat;
// add paragraph to textFlow and update controller to display it
textFlow.addChild(p);
var controller:ContainerController = new ContainerController(container, 200, 200 );
textFlow.flowComposer.addController(controller);
textFlow.flowComposer.updateAllControllers();
}
}
}
removeMatching | () | 方法 |
public function removeMatching(incoming:flashx.textLayout.formats:ITextLayoutFormat):void| 语言版本: | ActionScript 3.0 |
| 运行时版本: | Flash Player 10, AIR 1.5 |
将该 TextLayoutFormat 对象中的属性设置为 undefined(如果这些属性与 incoming ITextLayoutFormat 实例中的属性匹配)。
参数
incoming:flashx.textLayout.formats:ITextLayoutFormat — 与该 TextLayoutFormat 对象的属性值进行比较的实例。
|
示例 ( 如何使用本示例 )
package flashx.textLayout.formats.examples {
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TextLayoutFormat;
public class TextLayoutFormat_removeMatchingExample extends Sprite
{
public function TextLayoutFormat_removeMatchingExample()
{
// create a container and add it to the stage
var container:Sprite = new Sprite();
this.stage.addChild(container);
// create TextFlow, ParagraphElement, and SpanElement objects
var textFlow:TextFlow = new TextFlow();
var p:ParagraphElement = new ParagraphElement();
var span:SpanElement = new SpanElement();
// create two TextLayoutFormat objects
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
var textLayoutFormat2:TextLayoutFormat = new TextLayoutFormat();
// set format attributes for textLayoutFormat
textLayoutFormat.textIndent = 8;
textLayoutFormat.color = 0x336633;
textLayoutFormat.fontFamily = "Arial, Helvetica, _sans";
textLayoutFormat.fontSize = 24;
// add text to the span, the span to the paragraph, and the paragraph to the text flow
span.text = "Notice that fontFamily (Arial, Helvetica, _sans) is not applied."
p.addChild( span);
textFlow.addChild(p);
// set fontFamily to same value for textLayoutFormat2
textLayoutFormat2.fontFamily = "Arial, Helvetica, _sans";
// call removeMatching() to remove any values that match textLayoutFormat2;
// assign textLayoutFormat to the text flow
textLayoutFormat.removeMatching(textLayoutFormat2);
textFlow.hostFormat = textLayoutFormat;
// add paragraph to textFlow and update controller to display it
textFlow.addChild(p);
var controller:ContainerController = new ContainerController(container, 200, 200 );
textFlow.flowComposer.addController(controller);
textFlow.flowComposer.updateAllControllers();
}
}
}
setStyle | () | 方法 |
lineHeight) 设置为 140%。
package flashx.textLayout.formats.examples
{
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.elements.ParagraphElement;
import flashx.textLayout.elements.SpanElement;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.TabStopFormat;
import flashx.textLayout.formats.TextLayoutFormat;
import flash.text.engine.TabAlignment;
public class TextLayoutFormatExample extends Sprite
{
public function TextLayoutFormatExample()
{
var textFlow:TextFlow = new TextFlow();
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
textLayoutFormat.paragraphStartIndent = 15;
textLayoutFormat.paragraphSpaceBefore = 15;
textLayoutFormat.paragraphEndIndent = 15;
textLayoutFormat.paragraphSpaceAfter = 15;
textLayoutFormat.textIndent = 20;
textLayoutFormat.color = 0x336633;
textLayoutFormat.fontFamily = "Arial, Helvetica, _sans";
textLayoutFormat.fontSize = 14;
textLayoutFormat.kerning = flash.text.engine.Kerning.ON;
textLayoutFormat.lineHeight = "140%";
var tabStop1:TabStopFormat = new TabStopFormat();
tabStop1.alignment = flash.text.engine.TabAlignment.START;
tabStop1.position = 40;
textLayoutFormat.tabStops = new Array(tabStop1);
textFlow.hostFormat = textLayoutFormat;
var p:ParagraphElement = new ParagraphElement();
var span:SpanElement = new SpanElement();
span.text = "This example formats a paragraph with 15 pixel margins, a 20 pixel first " +
"line indent, and a left-aligned tab stop at 40 pixels (last line). It uses the " +
"Arial font (with alternate device fonts), sets the size to 14 pixels, the color to green, " +
" turns on kerning, \n \t and sets leading (lineHeight) to 140%.";
p.addChildAt(0, span);
textFlow.addChildAt(0, p);
textFlow.flowComposer.addController(new ContainerController(this,310,200));
textFlow.flowComposer.updateAllControllers();
}
}
}
package flashx.textLayout.formats.examples
{
import flash.display.Sprite;
import flash.system.Capabilities;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.BlockProgression;
import flashx.textLayout.formats.JustificationRule;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.formats.VerticalAlign;
public class TextLayoutFormatExample2 extends Sprite
{
public function TextLayoutFormatExample2()
{
// create TextFlow object
var textFlow:TextFlow = new TextFlow();
// create TextLayoutFormat object
var textLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
// define Japanese text in a string of Unicode characters
var jaText:String = String.fromCharCode(
0x30AF, 0x30ED, 0x30B9, 0x30D7, 0x30E9, 0x30C3, 0x30C8, 0x30D5,
0x30A9, 0x30FC, 0x30E0, 0x4E0A, 0x3067, 0x518D, 0x751F, 0x53EF,
0x80FD, 0x306A
) +
"Flash Video" +
String.fromCharCode(
0x3092, 0x914D, 0x4FE1, 0x3001, 0x653F, 0x5E9C, 0x6700, 0x65B0,
0x60C5, 0x5831, 0x3092, 0x3088, 0x308A, 0x591A, 0x304F, 0x306E,
0x56FD, 0x6C11, 0x306B, 0x9AD8, 0x54C1, 0x8CEA, 0x306A, 0x753B,
0x50CF, 0x3067, 0x7C21, 0x5358, 0x304B, 0x3064, 0x30EA, 0x30A2,
0x30EB, 0x30BF, 0x30A4, 0x30E0, 0x306B, 0x63D0, 0x4F9B, 0x3059,
0x308B, 0x3053, 0x3068, 0x304C, 0x53EF, 0x80FD, 0x306B, 0x306A,
0x308A, 0x307e, 0x3057, 0x305F, 0x3002);
// convert the text into a TextFlow object
textFlow = TextConverter.importToFlow(jaText, TextConverter.PLAIN_TEXT_FORMAT);
// set the locale and fontFamily
textLayoutFormat.locale = "ja";
if (Capabilities.os.search("Mac OS") > -1)
textLayoutFormat.fontFamily = String.fromCharCode(0x5C0F, 0x585A, 0x660E, 0x671D) + " Pro R"; // "Kozuka Mincho Pro R" koFont.fontName = "Adobe " + String.fromCharCode(0xBA85, 0xC870) + " Std M"; // "Adobe Myungjo Std M"
else
textLayoutFormat.fontFamily = "Kozuka Mincho Pro R";
// specify right-to-left block progression, east Asian justification, and top vertical alignment
textLayoutFormat.blockProgression = BlockProgression.RL;
textLayoutFormat.justificationRule = JustificationRule.EAST_ASIAN;
textLayoutFormat.verticalAlign = VerticalAlign.TOP;
textFlow.hostFormat = textLayoutFormat;
// add controller and update to display text
textFlow.flowComposer.addController(new ContainerController(this, 300, 200));
textFlow.flowComposer.updateAllControllers();
}
}
}
Tue Jun 12 2018, 11:04 AM Z
隐藏继承的公共属性
显示继承的公共属性