GregA:Nowdays I wouldn't store anything in a database unless you have some specific database need. Look at the complexity of model files, and those are essentially just flat files. I like the idea of either XML or making const classes with all of your text in them. Then you are an easy step (and a translator or three ) away from multi language support.
But my question fits in here nicely. I'd like to store text attributes, like bold, italic, and color. Is there some cheap easy way to parse out escape codes in XNA?
I think you'd need to use different fonts. I can't think of an easy/nice way to do it. You'd need to come up with a method for storing which font/index in the string and parse through it. If you did it in XML you could use the possibly content pipeline to convert a nice format to a quicker format at compile time, eg:
<String Name="GameOver">Game <B>Over!</B></String>
Could compile into a class like this:
public class GameString
{
public GameStringPart[] Parts;
}
public class GameStringPart
{
public SpriteFont font;
public string Text;
}
Then you could create an extension method on SpriteBatch so you have:
spriteBatch.DrawFormattedString(gameOverGameString, location, etc.);
Then loop through the GameStringParts "DrawString"ing them, keeping track of the width (with MeasureString) to do the next one.