One approach you can do is to embed your fonts into your application. However, you won't be able to do this if the font requires licensing.
.NET provides the PrivateFontCollection class which will allow you to
"embed" the font into your application thereby obviating the need to
distribute or install the font on the client's machine.
To embed a font using VS.NET add the font to the solution and ensure that
its build action is set to "embedded resource" in the properties for the
font.
Then, at some suitable place in the code, possibly the Form.Load event
handler or the Form constructor, load the font like so:
PrivateFontCollection pfc = new PrivateFontCollection();
private void Form1_Load(object sender, System.EventArgs e)
{
Stream fontStream =
this.GetType().Assembly.GetManifestResourceStream("<application>.<font
filename>"); // for example. "MyApplication.lucidasans.ttf"
byte[] fontdata = new byte[fontStream.Length];
fontStream.Read(fontdata,0,(int)fontStream.Length);
fontStream.Close();
unsafe
{
fixed(byte * pFontData = fontdata)
{
pfc.AddMemoryFont((System.IntPtr)pFontData,fontdata.Length);
}
}
}
>Hello!
>
>I use InstallShield program to distribute my application. But I do not how register fonts. I want that after setup my program, restart windows, windows auto install my fonts.
>Please tell me how I do that.
>
>Thank!
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi