mono/MonoGame — pull request #2538 by picobots (2014-05-14 00:17:49+00:00)
Title: Fixed MeasureString bug

This fixes a `SpriteFont.MeasureString` bug related to `firstGlyphOfLine`. In an attempt to make sure lines don't start with negative bearing, the initial `offset.X` was incorrectly always set to 0 (`offset.X==0` for firstGlyphOfLine), which is not in sync with XNA behavior. It's true that the *minimum* initial offset should be 0, but it's not true that the *maximum* initial offset should be 0. If the first glyph of a line starts with positive LeftSideBearing, then that should be added to the start of the line.

Pretty much any monospaced bitmap/pixel font provides a good test case, e.g., [Namco's Classic Arcade Font](https://www.google.com/search?q=namco+classic+arcade+font&tbm=isch). Notice how the shorter "T" character in "THE" is incorrectly flush with the left side of the line in the [top half of this image](http://i.imgur.com/Ilp3lrC.png) (pre-bug fix) causing the letters to fall out of alignment later on in the line, but the "T" characters are correctly offset by their left side bearing in the bottom half (post-bug fix) which keeps everything in alignment (and in sync with XNA behavior).