Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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!

share|improve this question
    
problem solved, just like zacharmarz said –  Zukki Feb 12 '11 at 19:32
add comment

3 Answers

up vote 5 down vote accepted

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.

share|improve this answer
    
indeed, now works perfect! asked yesterday, turned off the pc and now today the fonts are working –  Zukki Feb 12 '11 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! =) –  Will Marcouiller Feb 13 '11 at 0:40
    
thanks, however i cant vote up yet –  Zukki Feb 13 '11 at 6:08
add comment

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.