SpriteFonts
Unlike a Windows Forms application, XNA cannot use the TrueType
fonts that are installed on your computer. In order to use a font, it must first be converted into a SpriteFont
, a bitmap-based representation of the font in a particular size that can be drawn with the SpriteBatch.DrawString()
command.
Technically, any Windows font can be turned into a SpriteFont
, but licensing restrictions on most fonts will prevent you from using them in your XNA games. Along with the other tools, the Windows Phone Developers Tools installed in Chapter 1, Introducing XNA Game Studio is a collection of fonts provided by Microsoft to address this problem and give XNA developers a range of usable fonts that can be included in XNA games. The following are the samples of each of the redistributable fonts included: