2
\$\begingroup\$

Hello Stack Exchange community. Recently, I've been attempting to in some way generate sprite-fonts into XNB files for use with MonoGame. The issue is however, as you may be aware, XNA is very incompatible with Windows 8 without a very ridiculous amount of tweaking(even the installer its self has issues). Is it in any way possible to generate XNB files from sprite-fonts to be used with MonoGame, or is MonoGame doomed on the ability to use fonts in a Windows 8 development environment? Also keep in mind, it would 'appear' that the popular method of bitmap font loading also has compatibility issues with Windows 8. If there is no way of doing this with sprite-fonts, can you suggest any alternative libraries for C# that would allow for similar functionality to MonoGame with the ability to draw font effectively on a Windows 8 system? Any help is appreciated, thanks. Keep in mind, I am developing for Windows Desktop, not Metro.

\$\endgroup\$
4

1 Answer 1

1
\$\begingroup\$

I don't think you need XNA any more.

Just double click on Content.mgcb to open the content editor.

Right click on Content -> Add -> New item -> Spritefont description, give it a name, e.g. "testfont"

Load your spritefont in game:

var font = Content.Load<SpriteFont>("testfont");

Use it!

spriteBatch.DrawString(font, "hello", new Vector2(10, 10), Color.AliceBlue);
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .