Chapter 9. Working with Text

IN THIS CHAPTER

  • Using advanced text layout

  • Controlling fonts

  • Using device fonts

  • Embedding fonts

  • Setting font rotation

  • Using formatter classes

When you present text in a Flex application, many choices and tools can determine how text is displayed 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:

  • Using the Flash Text Engine (FTE) to present complex text

  • 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

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 as the Label and RichText controls. (Refer to Chapter 8 for a detailed discussion about the use of visual controls and Chapter 11 for more information about CSS.) In this chapter, I describe uses of styles that are specifically designed to control ...

Get Flash® Builder™ 4 and Flex® 4 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.