Chapter 11. Working with Text

When you present text in a Flex application, many choices and tools can determine how text is presented and processed. Text values can be "hard-coded" in an application, retrieved from a data source (such as database on a server), and stored in memory as constants or variables.

When text is presented to the user in visual control, you select many font settings, including the font typeface and its size, weight, and style. In this chapter, I describe the various tools available for text processing and presentation in Flex. I describe these strategies and techniques:

  • Selecting device fonts for text display that are already installed on the client computer.

  • Embedding fonts to tightly control text display regardless of the state of the client computer.

  • Formatting of text values with the formatter family of classes

Note

Any discussion of text presentation in Flex must include the use of Cascading Style Sheets (CSS) to select font typefaces and styles, and the use of visual controls that are specifically designed for text presentation, such the Label and Text controls. Previous chapters included detailed descriptions of both subjects. In this chapter, I describe uses of styles that are specifically oriented around text presentation, and I expand on the use of the Label and Text controls in presenting text to the user.

Note

To use the sample code for this chapter, import the chapter11.zip Flex project archive from the Web site files into your Flex Builder workspace. ...

Get Adobe® Flex® 3 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.