
TextFormat.tabStops Property
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
901
To set the font size for a single character, apply the format with a single index argument:
theField_txt.setTextFormat(5, format); // Set the sixth character ("t") to 26 pt
To set the font size for a range of characters, apply the format with start and end index
arguments:
theField_txt.setTextFormat(19, 24, format); // Set size for
// characters 19-23 ("large")
The default size value (as contained in the TextFormat object returned by TextField.
getTextFormat()) for a text field that contains text is 12. For a text field without any text,
the
size value is null. For a completely new TextFormat object, it is also null, indicating
that
size will not be set when the format is applied to a text field:
trace(anyUnformattedField_txt.getTextFormat().size); // Displays: 12
var format = new TextFormat();
trace(format.size); // Displays: "null"
Note that when font embedding is enabled for a text field, that field’s text is always anti-
aliased. Therefore, using embedded fonts with sizes smaller than 10-point is not
recommended because antialiased text becomes unreadable below 10-point in most fonts.
To prevent a font from antialiasing, use device fonts (i.e., system fonts) by setting
TextField.
embedFonts to false. Device fonts are never ...