2

FontFamily has methods to get font metrics but I can't get System.Drawing with my XNA Project. The FontFamily class has perfect methods for what I need which is aligning text. Here is a great article if you can use it: http://msdn.microsoft.com/en-us/library/xwf9s90b.aspx

I am needing to figure out the bounding box of a string without the line-spacing/line-height. Spritefont has a method called MeasureString but it includes line-spacing.

How can I get font metrics in a XNA project?

Although I can get the metrics from any method I am using the Nuclex processor so it uses FreeType. Looks like it is possible to use in .NET: http://icarus.sourceforge.net/Content/Tutorials/Developer/dev_freetype.html

4

0 回答 0