Loading SpriteFont

I’ve just started using MonoDevelop 5.7 with MonoGame addin 3.2.0 on Linux.

When I try to load a font:

		this.font = this.Content.Load<SpriteFont>("defaultFont");

I get an error:
System.NotImplementedException: The requested feature is not implemented.
at Microsoft.Xna.Framework.Content.ContentManager.ReadRawAsset[SpriteFont] (System.String assetName, System.String originalAssetName) [0x00000] in :0

The file Content/defaultFont.spritefont contains:
<?xml version=“1.0” encoding=“utf-8”?>
<XnaContent xmlns:Graphics=“Microsoft.Xna.Framework.Content.Pipeline.Graphics”>
<Asset Type=“Graphics:FontDescription”>
<FontName>Segoe UI Mono</FontName>
<Size>12</Size>
<Spacing>2</Spacing>
<Style>Bold</Style>
<CharacterRegions>
<CharacterRegion>
<Start> </Start>
<End>~</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>

So, it looks like I can get this to work by:

  1. precompiling the font to an xnb

  2. manually copying the xnb to the bin folder

  3. specify that file name in content load:

    font = this.Content.Load(“Arial Bold 12”);

That’s doable, but shouldn’t the content pipeline handle this? I think I’m missing something.

Content pipeline itself compiles assets to XNB.
I have built an MSBuild script that makes visual studio do the compiling and copying for you automagically. I have described how it ca nbe used here:

Thanks, Nezz. But solutions that require visual studio will only work on a windows machine. As I said, I’m running on Linux.

Nevermind. I just found this press release MonoGame Pipeline Tool Available for MacOS and Linux
So apparently, this has never worked, but will be releases soon? Something the tutorials I’ve tried don’t mention. No wonder they never work.

We have recently added support for the GUI. You can grab the sources for it from Github.