Reputation: 22794
I have tried the XNA Content Compiler, but it just spits out an error:
There was an error while deserializing intermediate XML. String must be exactly one character long.
My .spritefont file is this:
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<FontName>Miramonte</FontName>
<Size>18</Size>
<Spacing>0</Spacing>
<UseKerning>true</UseKerning>
<Style>Regular</Style>
<CharacterRegions>
<CharacterRegion>
<Start>32</Start>
<End>127</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>
Is there any way to make a .spritefont file for MonoGame?
Upvotes: 2
Views: 7179
Reputation: 67
Nahuel's answer works. However, its no longer needed. MonoGame 3.3+ will build the XNB files through the Project Pipeline https://gamedev.stackexchange.com/questions/96793/monogame-3-3-font-loading
Upvotes: 1
Reputation: 3185
You can find a tutorial (written by me) explaining exactly how to use spritefonts in Monogame here.
But basically, all you need to do is:
Then you can use it as you would in a typical XNA game.
As of today, I have not been able to find another way to load them without needing XNA. Same goes for sound files. You need to generate the xnb files by using the Content project provided by XNA.
Remember that you can install XNA on VS 2012+ and Windows 8 without a problem thanks to XNA Refresh.
Upvotes: 2