You cannot create a TextLine object directly from ActionScript code.
If you call
The TextLine encapsulates the minimum information necessary to render its contents and to provide interactivity through some methods that describe the properties of the atoms of the line. The term atom refers to both graphic elements and characters (including groups of combining characters), the indivisible entities that make up a text line.
After normal event-dispatching for a text line finishes, if the line is valid, events are mirrored to the event dispatchers that are
specified in the
Mirroring of mouse events is a special case. Because mirror regions aren't actually display objects,
The origin of a text line object is the beginning of the baseline. If you don't set the vertical position (
The TextLine class has several ancestor classes — DisplayObjectContainer, InteractiveObject, DisplayObject, and EventDispatcher — from which it inherits properties and methods. The following inherited properties are inapplicable to TextLine objects:
If you try to set these properties, the text engine throws the error: IllegalOperationError. You can read these properties, but they always contain default values.
The following describes the output:
[LINE] <line ascent=[Number] descent=[Number] rotation=[int]> <elements> [0-N ELEMENT] </elements> <clusters> [0-N CLUSTER] </clusters> </line> [ELEMENT] <glyph isEmbedded=[Boolean] fontName=[String] isBold=[Boolean] isItalic=[Boolean] gid=[int] pointSize=[Number] x=[Number] y=[Number] rotation=[int]/> or <graphic child=[int] x=[Number] y=[Number] rotation=[int]/> or <embeddedRun x=[Number] y=[Number]> [LINE] </embeddedRun> [CLUSTER] <cluster xLeft=[Number] xCenter=[Number] xRight=[Number] cursorOnLeft=[Boolean] cursorOnRight=[Boolean] wordBoundaryOnLeft=[Boolean] wordBoundaryOnRight=[Boolean]/>
Note: The content and format of the output from this method could change in the future. Adobe does not guarantee backward compatibility for this method.
For example, if you start a text block with some Hebrew text, you set
This method takes global coordinates so that you can easily use it with
Even a single
The value is calculated based on the difference between the baselines that bound the line, either ideo top/bottom or ascent/descent depending on whether TextBlock.baselineZero is ideo or not. Graphic elements are not considered when computing these baselines.
A line is considered USER_INVALID if validity is set to any string which is not a member of
When the contents of the TextBlock are modified, the Flash runtime marks affected text lines, the previous line, and all following lines as INVALID. The previous line must be marked invalid when a change allows the previous line to absorb part of the content that was originally on the first affected line.
Newly broken lines are always VALID. The Flash runtime may change lines that follow from VALID to POSSIBLY_INVALID or INVALID. It may change POSSIBLY_INVALID lines to VALID if the line breaks match up, or to INVALID if they don't.
Application code can mark VALID lines as INVALID or USER_INVALID, and can mark USER_INVALID lines as VALID. Application code cannot mark lines POSSIBLY_INVALID.
Application code can mark any line STATIC. Doing so causes the
Setting the properties of a TabStop object after you apply it to a TextBlock does not invalidate the TextBlock.
The default value is
Use the
Use the following constants from the TabAlignment class to set the value for this property:
The default value is
The default value is 0.0.
Using device fonts results in a smaller movie size, because font data is not included in the file.
Text rendered with device fonts is not always displayed the same across different systems and platforms, because the Flash runtime uses the fonts that are installed on the system.
Text rendered with embedded fonts is always displayed in the chosen font, whether that font is installed on the playback system or not.
One drawback to embedded fonts is that they increase the size of the application.
To delete text, pass
To insert text, pass the same value for
To append text, pass
To set all the text, pass 0 for
The default value is
Use the constructor
The default value is
Use one of the constants in the JustificationStyle class to set the value for this property. The following table lists the possible values:
Note that depending on the rotation of the line, this value is either added or subtracted from the
position of the line to find the position for the strikethrough. In a line with
When applying decorations such as strikethroughs to a
The subscriptOffset value is used with
The superscriptOffset value is used with
Note that depending on the rotation of the line, this value is either added or subtracted from the
position of the line to find the position for the underline. In a line with
When applying decorations such as underlines to a
An ElementFormat object that is applied to a ContentElement in a TextBlock does not invalidate the TextBlock.
Once an ElementFormat has been
applied to a ContentElement, its
This example creates two
This example creates an
To modify the
Returns a
The largest vertical element in the line determines the alignment of baselines unless
The default value is
To set values for this property, use the following string values:
The default value is
The element is shifted away from the
The default value is
The default value is
To set values for this property, use the following string values:
The default value is
The default value is
To set values for this property, use the following string values:
The default value is
To set values for this property, use the following string values:
The content of the element determines the baselines.
In the case of a
The default value is
To set values for this property, use the following string values:
The default value is a default-constructed FontDescription object.
When the fontDescription property is set, the FontDescription object provided is locked: its
The default value is
The default value is
To set values for this property, use the following constants in the Kerning class:
The default value is
To set values for this property, use the following string values:
The default value is
The default value is
The final rotation of any glyph is the sum of
You typically use this property for Asian text where characters must be rotated to display properly in vertical layout.
Use
Setting this property on fonts which do not contain vertical layout information can give undesirable results. Fonts that contain a vmtx or VORG table, such as the Japanese font, "MS Mincho", work correctly because the tables supply the data that the layout engine requires for correct layout. Fonts such as Verdana, which do not contain the necessary information, do not.
To set values for this property, use the following string values:
Typically, the desired tracking value is split between
The default value is
Example:
Typically, the desired tracking value is split between
The default value is
Example:
The default value is
To set values for this property, use the following string values:
You cannot instantiate the TextJustifier class directly. Invoking
Subclasses of TextJustifier must override this method.
If the locale is Chinese, Korean, or Japanese, the method constructs a default EastAsianJustifier object. Otherwise the text engine constructs a default SpaceJustifier object.
Use the following constants defined by the
A FontDescription object is applied to an ElementFormat,
which is in turn applied to a ContentElement in a TextBlock. Once a FontDescription has been
applied to an ElementFormat, its
Note: FTE (Flash Text Engine) does not support Type 1 fonts or bitmap fonts such as Type 3, ATC, sfnt-wrapped CID, or Naked CID.
This example creates a
This example creates a
To modify the
The flash.text.engine classes can only use OpenType and TrueType device fonts. If a font based on an older font technology is used, the runtime falls back to known good device fonts on a glyph-by-glyph basis to render the text
The flash.text.engine classes cannot use a font of type
If both
The type of CFF (Compact Font Format) hinting used determines whether the Flash runtime forces strong horizontal stems to fit to a sub-pixel grid or not.
Applies only to embedded fonts.
The default value is
For the
The default value is
To set values for this property, use the following string values:
Flash runtimes support three generic device font names: _sans (for sans serif fonts), _serif (for serif fonts), and _typewriter (for mono-space fonts). These are mapped to specific device fonts depending on the platform.
The default value is
Flash runtimes provide font fallback for glyphs which are not found in the selected font. Whether the font in use is embedded or device, if the glyph is not found in the font, the runtime attempts to render it using another device font likely to contain the glyph.
The default value is
To set values for this property, use the following constants from the FontPosture class:
The default value is
To set values for this property, use the following constants from the FontWeight class:
Applies only to embedded fonts.
The default value is
To set values for this property, use the following constants from the RenderingMode class:
When a GroupElement contains another GroupElement, the inner GroupElement retains its own formatting (ElementFormat settings). It does not inherit the formatting of the outer GroupElement.
On a GroupElement, most of the format properties have no impact. For this reason, it is legal to create a text line for a GroupElement object
that has a null
To delete elements, pass
After the operation, the replaced elements are orphaned, with
ContentElement is an abstract base class; therefore, you cannot instantiate ContentElement directly.
Invoking
You can assign a ContentElement element to exactly one
The default value is
The default value is
When the
Event mirrors manifest themselves in text lines as instances of the
The default value is
The default value is
The default value is -1.
The default value is
The default value is
The final rotation of any glyph is the sum of
Rotated content elements cannot be nested. In any hierarchy of content elements, no matter how complex,
only one content element can have its
To set values for this property, use the following string values:
The TextBlock class is intended to contain a single paragraph because the Unicode bidirectional and line-break algorithms operate on one paragraph at a time. For applications that compose multiple paragraphs of text, use a markup language, or text analysis to divide the text into paragraphs and create one TextBlock per paragraph.
The TextBlock object stores its content in the
After you create the TextBlock instance and set the
Breaking lines over a range of a text block that has already been broken can change the validity
of lines in and beyond the area where breaking takes place. The status of lines can change from VALID to INVALID or
POSSIBLY_INVALID. If a newly broken line aligns perfectly with a previously broken line which has a status
of POSSIBLY_INVALID, that previously broken line and all following POSSIBLY_INVALID lines change back
to a status of VALID. The validity of lines that have been set to values that are not members of
You can create artificial word breaks by including the Unicode Zero Width Space (ZWSP) character in the text. This can be useful for languages such as Thai, which require a dictionary for correct line breaking. The Flash runtime does not include such a dictionary.
In order to reduce memory overhead, when all the desired lines have been created, unless it is expected that the
lines will need to be repeatedly rebroken due to, for example, the resizing of the container, the user should call
the
The following describes the output:
>block< [0-N LINE] >/block<
For a description of the output for each line, see the TextLine.dump() method.
Note: The content and format of the output may change in the future. Adobe does not guarantee backward compatibility of this method.
The
Breaking lines over a range of a text block that has already been broken can change the validity
of lines in and beyond the area where breaking takes place. The status of lines can change from VALID to INVALID or
POSSIBLY_INVALID. If a newly broken line aligns perfectly with a previously broken line which has a status
of POSSIBLY_INVALID, that previously broken line and all following POSSIBLY_INVALID lines change back
to a status of VALID. The validity of lines that have been set to values that are not members of
You can create artificial word breaks by including the Unicode Zero Width Space (ZWSP) character in the text. This can be useful for languages such as Thai, which require a dictionary for correct line breaking. The Flash runtime does not include such a dictionary.
In order to reduce memory overhead, when all the desired lines have been created, unless it is expected that the
lines will need to be repeatedly rebroken due to, for example, the resizing of the container, the user should call
the
The recommended process for text that is not expected to change is: initialize a text block,
call the
Sets the
On platforms which do support sub-pixel glyph positioning, this flag is ignored.
This flag has no effect on embedded font rendering
The default value is
The default value is
The default value is
The default value is
To set values for this property, use the following string values:
The default value is 0.
Modifying
The default value is
Modifying the
The default value is
The default value is
The default value is
The final rotation of any glyph depends on the values of
Use the following constants, which are defined in the
The default value is
When the
The default value is a constructed default TextJustifier object.
When the
The default value is
Values for this property are found in
Note: When working with Arabic or Syriac fonts,
The final rotation of any glyph is the sum of
The registration point of the graphic aligns with the upper-left corner
of the region defined by
The default value is 15.0.
The default value is 15.0.
The default value is
When the GraphicElement becomes part of a text line, the graphic is added as a child of the line. Setting the graphic removes the old graphic from the line and adds the new one.
The line consists of four
Hinting adjusts the display of an outline font so it lines up with the pixel grid. At small screen sizes, hinting produces a clear, legible text for human readers.
Note: Not recommended for animation.
After normal event-dispatching for a text line finishes, if the line is valid and event propagation has not been stopped, events are re dispatched to the mirror regions of the line.
Mirroring of mouse events is a special case. Because mirror regions aren't actually display objects,
You cannot create a TextLineMirrorRegion object directly from ActionScript code.
If you call
The TextLineMirrorRegion class is final; it cannot be subclassed.
Use the constructor
The default value is
The default value is
The default value is
The default value is