Contents
Is it possible to generate spritefonts in MonoGame?
At least in August this year generating spritefonts was not yet supported by MonoGame, however the content pipeline was the main focus of attention the last few months so I wouldn’t be surprised if it does work currently. Of course you need to know the syntax of a .spritefont file which needs to be added to your content folder.
How to create a sprite in MonoGame pipeline?
In the MonoGame Pipeline tool, create a “.spritefont” file: a. Choose “SpriteFont Description” and give it a name. I suggest something like “FontName_FontStyle_FontSize” eg: PlasmaticaItalic12. Open the new SpriteFont file in a text editor (double click it in MonoGame Pipeline).
How to import a font into MonoGame pipeline?
Open the new SpriteFont file in a text editor (double click it in MonoGame Pipeline). Change the XML node to be the same name from the font’s properties in the Font control panel. Save & Build your MonoGame Pipeline project.
How to import non default fonts into MonoGame?
I suggest something like “FontName_FontStyle_FontSize” eg: PlasmaticaItalic12. Open the new SpriteFont file in a text editor (double click it in MonoGame Pipeline). Change the XML node to be the same name from the font’s properties in the Font control panel. Save & Build your MonoGame Pipeline project.
Do you need to know the syntax of a.spritefont?
Of course you need to know the syntax of a .spritefont file which needs to be added to your content folder. For that see the bottom of this post. As far as I can tell, even as far back as August, the loading of already compiled spritefonts from XNB files is supported.
Is it possible to generate spritefonts from XNB files?
As far as I can tell, even as far back as August, the loading of already compiled spritefonts from XNB files is supported. Since you don’t want to install XNA to generate these XNB files you might want to check the XNA Content Compiler Project on codeplex. Here is an example .spritefont file so you can see if it’s currently supported
How to change font size in MonoGame game?
Size is a float value, measured in points. Modify this value to change the size of the font. –> 10 0