beautypg.com

Text.gettextattr() – Adobe Extending Flash Professional CS5 User Manual

Page 463

background image

441

EXTENDING FLASH PROFESSIONAL

Text object

Last updated 5/2/2011

Example
The following example shows how you can use the

customThicknessSharpness

value to specify the sharpness and

thickness of the text:

fl.getDocumentDOM().setElementProperty("fontRenderingMode", "customThicknessSharpness");

fl.getDocumentDOM().setElementProperty("antiAliasSharpness", 400);

fl.getDocumentDOM().setElementProperty("antiAliasThickness", -200);

See also

text.antiAliasSharpness

,

text.antiAliasThickness

text.getTextAttr()

Availability
Flash MX 2004.

Usage

text.getTextAttr(attrName [, startIndex [, endIndex]])

Parameters

attrName

A string that specifies the name of the TextAttrs object property to be returned. For a list of possible values

for

attrName

, see the Property summary for the

TextAttrs object

.

startIndex

An integer that is the index of first character. This parameter is optional.

endIndex

An integer that specifies the end of the range of text, which starts with startIndex and goes up to, but does

not include, endIndex. This parameter is optional.

Returns
The value of the attribute specified in the attrName parameter.

Description
Method; retrieves the attribute specified by the attrName parameter for the text identified by the optional startIndex
and endIndex parameters. If the attribute is not consistent for the specified range, Flash returns

undefined

. If you omit

the optional parameters startIndex and endIndex, the method uses the entire text range. If you specify only startIndex,
the range used is a single character at that position. If you specify both startIndex and endIndex, the range starts from
startIndex and goes up to, but does not include, endIndex.

Property value

How text is rendered

device

Renders the text with device fonts.

bitmap

Renders aliased text as a bitmap, or as a pixel font would.

standard

Renders text using the standard anti-aliasing method used by Flash MX 2004. This is the best
setting to use for animated, very large, or skewed text.

advanced

Renders text using the advanced anti-aliasing font rendering technology implemented in Flash
8, which produces better anti-aliasing and improves readability, especially for small text.

customThicknessSharpness

Lets you specify custom settings for the sharpness and thickness of the text when using the
advanced anti-aliasing font rendering technology implemented in Flash 8.

This manual is related to the following products: