Creating Your Own Fonts From TTF Files
Xbox Programming & Development
OK, first you gotta run it through C:\Program Files\Microsoft Xbox SDK\Tools\Win32\Graphics\FontMaker, (choose size) where you will end up with 2 files...
- tga-file, which contains a raw graphics of the fonts
- abc-file, contains coordinates to each letter in the tga-file.
now, put these two files in your projects folder\Media\Fonts\ dir, and create a font.rdf file in your project.
( I made a dodger-font in this example )
// setting up the font files.
out_header Font.h
out_packedresource Media\Font.xpr
out_error Font.err
Texture Font
{
Source Media\Fonts\Dodger_18.tga
Format D3DFMT_A4R4G4B4
Levels 1
}
UserData FontData
{
DataFile Media\Fonts\Dodger_18.abc
}
|
Now, it should look something like this in your project list :
Right click on font.rdf and make it like this :
Now you can use the "xfont" -system from microsoft.
#include "XBFont.h"
CXBFont cFont;
void main(void)
{
cFont.Create(Info.g_pd3dDevice,"Font.xpr");
}
|
|