Q:

C# using own font without install it

Possible Duplicate:
How do I Embed a font with my C# application? (using Visual Studio 2005) 

Hi,
I want to use my own font into a textbox without install it in client machine. I want it to reside into my program file application folder.[I know most of game applications use their own font like that]. How can I do it ?
Thanks.

A:

I think that you need this:
// Be sure to dispose your PrivateFontCollection
// and Font to avoid an easy leak!
System.Drawing.Text.PrivateFontCollection privateFonts = new PrivateFontCollection();
privateFonts.AddFontFile("c:\myapplication\mycustomfont.ttf");
System.Drawing.Font font = new Font(privateFonts.Families[0], 12);
this.textBox1.Font = font;

