Help tidying up a Draw call Simple static class that will write out a message that is passed in.  The SpriteSheet is 256x256 and the A-Z starts at line 240 and the 0-9 starts at 248.  Each character is 8x8.  I hate the if (ix &gt;= 32) and wondered if there is a tidier way of doing this?  I'm pleased it's only one Draw call, but it looks ugly.

public static class Font
{
    private static String chars = "" + //
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ      " + //
        "0123456789.,!?'\"-+=/\\%()&lt;&gt;:;     " + //
        "";

    public static void Draw(string msg, SpriteSheet sprites, SpriteBatch spriteBatch, int x, int y, Color color)
    {
        msg = msg.ToUpper();
        for (int i = 0; i &lt; msg.Length; i++)
        {
            int ix = chars.IndexOf(msg[i]);
            int w = 0, h = 240;
            if (ix &gt;= 0)
            {
                if (ix &gt;= 32)
                {
                    w = 32;
                    h = 248;
                }
                spriteBatch.Draw(sprites.Sheet, new Rectangle(x + i * 8, y, 8, 8), new Rectangle((ix - w) * 8, h, 8, 8), color);
            }
        }
    }
}
It is hard to suggest improvements because the variable names are not very meaningful and, thus, it is hard to understand what they are for and which is the intention behind the code.
Lesson to learn: using meaningful variable names is important.

Here is an attempt.
"Opening brackets not taking a new line" is a matter of style, disregard it.

Could you address the code comments I left?

public static class Font
{
    private const string chars =
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ      " + // I assume the spaces are padding to 32 chars.
        "0123456789.,!?'\"-+=/\\%()&lt;&gt;:;     " // 35chars?!? What is the use of the 5 spaces?
        ;
    // Since the sprites never change, you can have them as a static property.
    private static SpriteSheet _Sprites = ...;

    public static void Draw(string msg, SpriteBatch spriteBatch, int xOffset, int yOffset, Color color) {
        msg = msg.ToUpper();
        for (int x = 0; x &lt; msg.Length; x++) {
            int spriteX = chars.IndexOf(msg[x]);
            if (spriteX &lt; 0) {
                continue; // Skipping char.
            }
            int spriteY = 240;
            if (spriteX &gt;= 32) {
                // I really do not understand the justification of this...
                // Drawing a 1 is supposed to get a B, right? Strange.
                spriteX -= 32;
                spriteY = 248;
            }
            Rectangle charMask = new Rectangle(xOffset + x * 8, yOffset, 8, 8);
            Rectangle spriteMask = new Rectangle(spriteX * 8, spriteY, 8, 8);
            // XNA method: http://msdn.microsoft.com/en-us/library/ff433987.aspx
            spriteBatch.Draw(Sprites.Sheet, charMask, spriteMask, color);
        }
    }
}