Chapter 10. Text fundamentals

 

This chapter covers

  • Exploring the text system
  • Displaying text and working with fonts
  • Controlling text rendering with Text Options
  • Using advanced OpenType features

Most applications you write will display or manipulate text at some point. Even many games have text input requirements for signing up, registering, or logging a high score. Media players often have rolling commentary by other viewers and the ability to add to the social aspects of what you’re watching. In short, working with text is important. Text is so important that Silverlight dedicated a team to the text system.

For as long as computers have been around and attached to video displays or teletypes, the display of text has been an important aspect of user interaction. Silverlight includes great support for displaying text, with a number of options that control formatting and other aspects of the display.

Many designers (and developers with an eye for design) want fine control over the rendering and display of the fonts onscreen. Silverlight includes the TextOptions class with its attached properties, which may be used to change text hinting, formatting, and rendering.

Speaking of designers, Silverlight 5 introduced top-notch support for OpenType fonts. That means you now have access to ligatures, variants, number formats, fractions, and much more. I’m especially fond of the font style sets and variations you can now use in your Silverlight applications.

10.1. The text system

10.2. Displaying text

10.3. OpenType font support

10.4. Embedding fonts

10.5. Summary