1

I have PrivateFont is declare like this

 PrivateFont = new PrivateFontCollection();
        string[] fontFiles = this.GetFontFiles();
        foreach (string fontFile in fontFiles)
        {
            PrivateFont.AddFontFile(fontFile);
        }

Then I get font info by index:

Font = new Font(PrivateFont.Families[2], 16);

Now, I want get font family by font name. How can I do?

Do Thanh Tung
  • 1,223
  • 2
  • 19
  • 30

1 Answers1

3

one way possible is (as I think your question)

var font = PrivateFont.Families
                     .Where(c => c.Name == "Arial")
                     .FirstOrDefault();