Longtime XNA user; new to MonoGame (v3.3). I’m in the process of porting my code-base (Windows “Desktop”) to MG.
First off, I want to start out saying thank you all for what you do!
My issue is with spritefonts and the rendered result not having the correct font style.
After getting everything ported over to MG, compiled and running, I noticed that none of our font styles are working: they’re all appearing “Regular” when rendered on screen (even though they have Bold, and the like, set in the spritefont file). Manipulating the “Size” tag alters the text size, as expected, so I know the file is loading properly; the only thing that doesn’t seem to work is the “Style”.
Has anyone experienced this or have any insight as to why this would be happening?
I ran into the issue by trying to set Arial font to bold on MonoGame.WindowsDX 3.4, after which I noticed that none of the styles have any effect at all. The spritefont file was generated using MonoGame Pipeline GUI tool.
I have the same issue and i don’t want to use any additionnal extension because in the past i had many issues with extensions used for games projects.(compatibility issues for most cases and lack of updates).
Ok, i was using Verdana font (TrueType) and I have found a solution : Instead of using the style, i use “Verdana Bold” instead of “Veradana” for the font name.It’s working.
So if you want to use styles for a font, in fact you will have to get a font for regular, one for bold, one for italic etc
It’s the most clean and simple way to do it.
For anyone else looking for answers on this problem. The builder code for importing the spritefont XML file is in FontDescriptionProcessor.cs where you can see that the Style tag is only used if (CurrentPlatform.OS == OS.Linux). So, if using Windows fonts then just use the FontName tag and ignore the Style tag. This should really be added to the comment for the tag.