Adds a font from the specified file to this System.Drawing.Text.PrivateFontCollection.
- filename
A string that contains the file name of the font to add.
Windows Forms applications support TrueType fonts and have limited support for OpenType fonts. If you try to use a font that is not supported, such as an unsupported OpenType font or a Bitmap font, an exception will occur. The PrivateFontCollection.AddFontFile(string) is not supported on operating systems before win2kfamily. When using a private font on operating systems before win2kfamily, the default font, typically Microsoft Sans Serif, will be substituted.