Permalink
Browse files

Changes to adjust the font alignment. Thanks jdindia.

git-svn-id: https://xnatouch.svn.codeplex.com/svn@59449 ffd33b8c-2492-42e0-bdc5-587b920b7d6d
  • Loading branch information...
1 parent 0ad448b commit 951533e1c969c1d01ce0684e165394b4474a7379 SND\CartBlanche_cp committed Mar 17, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 MonoGame.Framework/Graphics/SpriteFont.cs
@@ -66,8 +66,9 @@ public class SpriteFont
public Vector2 MeasureString(string text)
{
Vector2 v = Vector2.Zero;
- float xoffset=0;
- float yoffset=0;
+ float xoffset = 0;
+ float yoffset = 0;
+ float newHeight = 0;
foreach (char c in text)
{
@@ -80,7 +81,7 @@ public Vector2 MeasureString(string text)
if (characterData.ContainsKey(c) == false) continue;
GlyphData g = characterData[c];
xoffset += g.Kerning.Y + g.Kerning.Z + Spacing;
- float newHeight = g.Glyph.Height + g.Cropping.Top + yoffset;
+ newHeight = g.Cropping.Height + yoffset;
if ( newHeight > v.Y)
{
v.Y = newHeight;

0 comments on commit 951533e

Please sign in to comment.