# XNA: SpriteFont question

I need some help with the SpriteFont. I want a different font for my game, other than Kootenay. So, I edit the SpriteFont xml, i.e:

<FontName>Kootenay</FontName>


or

<FontName>Arial</FontName>


No problem with Windows fonts, or other XNA redistributable fonts pack. However, I want to use other fonts, that I downloaded and installed already, they are TTF or OTF, both supported by XNA. My problem is, I cant use them, I got this error:

The font family "all the fonts i tried" could not be found. Please ensure the requested font is installed, and is a TrueType or OpenType font.

So, checking at the windows fonts folder, I check the properties and details of the fonts, I try all the names they have, and but never works. Maybe I need some kind of importing or installing in order to use them, I dont know, and I hope you guys can help me, thanks!

• problem solved, just like zacharmarz said Feb 12, 2011 at 19:32

If you see your font in fonts directory, just try to restart Visual Studio or whole system. It should help.

I tried it - I installed new font, add it into running MSVS project, then compile and get the same error as you. When I restarted MSVS and compile again, it worked.

• indeed, now works perfect! asked yesterday, turned off the pc and now today the fonts are working Feb 12, 2011 at 19:31
• @Zukki: A good way to thank zacharmarz shall be to upvote his answer, and click the check on the left-hand side of his answer so that you mark it as the accepted answer, that is, the answer that solved your problem. Not only will you help zacharmarz by incrementing his reputation points which is encouraging, but you will also point the evidence that zacharmarz's answer is the very solution for this problem to other GD users who should look for a similar problem as yours. I hope you will enjoy GD! =) Feb 13, 2011 at 0:40

Try putting the font file in the same directory as your spritefont file.

It appears the problem is this: XNA claims to support Truetype and Opentype fonts. However, some Opentype fonts have Postscript outlines, which XNA doesn't support. So they won't import. One example is Philosopher, an otf font which doesn't have compatible outlines.

The solution is to convert the font to Truetype. The font I mentioned won't work in XNA, but after converting it to ttf with this online tool, it does. Make sure you delete the old font from Control Panel/Fonts to avoid confusion.

Moreover, restarting the OS is unnecessary. Restarting VS is sufficient.