I want to thank all posters for their input!
I was trying to get teh fonts on a 360 project as cleanly as possible.
I suceeded and wanted to give a simple tuorial for those who shall follow.
(This is just for adding fonts to the 360 templated project.)
1) Download the FontSample.zip stuff
here and extract.
2) Open the FontPipline C# project file, change from Debug to Release mode and Build Solution.
3) Open the FontRendererXbox C# project file, change from Debug to Release mode and Build Solution.
4) Copy FontRenderer.dll from FontSample\FontRenderer\bin\Xbox 360\Release to an appropriate location in your 360 project.
5) Copy FontPipeline.dll from FontSample\FontPipeline\bin\x86\Release to an appropriate location in your 360 project.
6) Copy the Content Folder and the 2 files it contains from FontSample\FontSample to an appropriate location in your 360 project.
For the purpose of this example I copied both dll's and the content folder to the main dir of the project where Program.cs and Game1.cs are located
7) Rt click on your on your Project Name in the solution explorer and select properties.
Go to contentpipeline and add FontPipline.dll
8) Rt click on your on your Project Name in the solution explorer and select Add Reference.
Browse and add FontRenderer.dll
9) Create a new folder in your project called "Content" (it doesnt overwrite the folder already copied)
From the content Folder add existng items:
-Goto Content Folder, select ContentPipelineFiles and add BitmapFont
Repeat these steps again, when navigated to the Content folder select Data Files and add TrueTypeFont
10) Select properties of BitMapFont and change Content Processor to Bitmap Font Processor
11) Select Properties of TrueTypeFont and change Content Importer to XML Content XNA Framework
also change Content Processor to TrueTypeFontProcessor
That should handle all the setup now for the code:
Add:
using FontRenderer;
In you class definition (Game1) add:
Font bitmapFont;
Font trueTypeFont;
SpriteBatch spriteBatch;
In your LoadGraphicsContent method add:
bitmapFont = content.Load<Font>(@"Content/BitmapFont");
trueTypeFont = content.Load<Font>(@"Content/TrueTypeFont");
spriteBatch = new SpriteBatch(graphics.GraphicsDevice);
And finally some sample code to actually draw some sample you can refrence, in your Draw method add:
spriteBatch.Begin();
graphics.GraphicsDevice.Clear(Color.SlateGray);
trueTypeFont.Draw("Hello, World!", new Vector2(64, 12), 2, Color.Red, spriteBatch);
trueTypeFont.Draw("This was converted from a TrueType font", new Vector2(64, 76), 1, Color.Black, spriteBatch);
bitmapFont.Draw("But this font was drawn by hand as a bitmap", new Vector2(64, 124), 1, Color.Black, spriteBatch);
trueTypeFont.Draw("This text has a drop shadow", new Vector2(66, 142), 1, Color.Black, spriteBatch);
trueTypeFont.Draw("This text has a drop shadow", new Vector2(64, 140), 1, Color.White, spriteBatch);
bitmapFont.Draw("#'s have color gradients " + "drawn into the font: 012345", new Vector2(64, 185), 1, Color.White, spriteBatch);
spriteBatch.End();
DrawFontTexture(trueTypeFont, "Truetype", new Vector2(64, 235));
DrawFontTexture(bitmapFont, "Bitmap", new Vector2(320, 235));
Lastly you'll need to add this method for those last 2 lines from the draw method:
private void DrawFontTexture(Font font, string name, Vector2 position)
{
spriteBatch.Begin(SpriteBlendMode.None);
spriteBatch.Draw(font.Texture, position, new Color(64, 64, 64));
spriteBatch.End();
spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
spriteBatch.Draw(font.Texture, position, new Color(128, 128, 128));
bitmapFont.Draw(name + " font texture:", position - new Vector2(0, 20), 1, Color.Black, spriteBatch);
spriteBatch.End();
}
That should do it, again this is for Xbox specific templated project, but minor alterations prolly work for Windows version too.
Thx to all with the info to get me going, hopefulle others can follow my guide successfully!