I want to embed fonts in my WinForms application so that I don\'t have to worry about them being installed on the machine. I\'ve searched a bit on the MSDN site and found a
I dragged and dropped a randomly downloaded font into my resources and this worked. Uses a file though. I guess you can use this as well to install fonts ?
public Form1()
{
string filename = @"C:\lady.gaga";
File.WriteAllBytes(filename, Resources.KBREINDEERGAMES);
PrivateFontCollection pfc = new PrivateFontCollection();
pfc.AddFontFile(filename);
Label label = new Label();
label.AutoSize = true;
label.Font = new Font(pfc.Families[0], 16);
label.Text = "hello world";
Controls.Add(label);
}