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
  • \$\begingroup\$ "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)." Not true I have XNA on my Win 8 laptop and it works fine and was easy to set up. blogs.msdn.com/b/astebner/archive/2012/02/29/10274694.aspx \$\endgroup\$ Commented Aug 9, 2013 at 1:37
  • 2
    \$\begingroup\$ If you want a standalone content compiler I suggest looking at this or something similar: xnacontentcompiler.codeplex.com \$\endgroup\$
    – Pandacoder
    Commented Aug 9, 2013 at 1:56
  • \$\begingroup\$ I too have XNA 4.0 working fine on my Windows 8 machine. I do however, have to use VS2010. \$\endgroup\$ Commented Aug 9, 2013 at 2:04
  • \$\begingroup\$ What exactly are the issues with bitmap font loading on Windows 8? My answer was going to be to suggest the BMFont route. craftworkgames.com/blog/tutorial-bmfont-rendering-with-monogame \$\endgroup\$ Commented Aug 9, 2013 at 2:42

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 .