System.Drawing.Text.PrivateFontCollection.AddFontFile Method

Adds a font from the specified file to this System.Drawing.Text.PrivateFontCollection.

Syntax

public void AddFontFile (string filename)

Parameters

filename
A string that contains the file name of the font to add.

Remarks

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.

Requirements

Namespace: System.Drawing.Text
Assembly: System.Drawing (in System.Drawing.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0