fontsxnaxna-4.0truetype

How do I Convert a Ttf or other Font to a .Xnb/XNA Game Studio Font?


I'm working with a game Called Terraria on a complete texture redo. The Font is PNG based, which I extracted from the Font XNBs using TConvert. Is there a fast method of making a font convert to something like Font1.ttf > Font1.xnb.

I already tried:

XNA Game studio and using Re-Logics Font Pipeline to make a custom font, but due to the Overall Outdated-ness of XNA game studio 4.0, I can not install it. It requires Visual C# 2010 which does NOT work with my Windows 7 PC. (I'm not completely sure why)


Solution

  • You can use MonoGame to create an .xnb file for use with Terraria.

    A version of steps 6-10 with screenshots can be found here.

    1. Install the font file in Windows. Open the ttf file and click install(Note the name).
    2. If you do not already have it, install a community version of Visual Studio.
    3. Install MonoGame.
    4. Create a new Windows Game from the provided MonoGame Template.(Note the project directory)
    5. Open the MonoGame Pipeline Tool by double-clicking on the Content.mgcb file.
    6. From the Edit Menu, Select Add -> New Item
    7. Name the file and select SpriteFont Description.
    8. Right click on the file under Content, select Open With.
    9. Edit the file using a text editor(Notepad). Change the font name and size. Save the file.
    10. Select Build -> Rebuild from the Menu.
    11. The .xnb file is in: project directory/bin/x86/Debug/Content/

    The most common error is the name of the font is not correct.