Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PrivateFontCollection class

Applies to: desktop apps only

The PrivateFontCollection is a collection class for fonts. This class keeps a collection of fonts specifically for an application. The fonts in the collection can include installed fonts as well as fonts that have not been installed on the system.

Members

The PrivateFontCollection class inherits from FontCollection. PrivateFontCollection also has these types of members:

Constructors

The PrivateFontCollection class has these constructors.

ConstructorDescription
PrivateFontCollection::PrivateFontCollection

Creates an empty PrivateFontCollection object.

 

Methods

The PrivateFontCollection class has these methods.

MethodDescription
PrivateFontCollection::AddFontFile

The PrivateFontCollection::AddFontFile method adds a font file to this private font collection.

PrivateFontCollection::AddMemoryFont

The PrivateFontCollection::AddMemoryFont method adds a font that is contained in system memory to a GDI+ font collection.

 

Remarks

PrivateFontCollection allows applications to install a private version of an existing font without the need to replace the system version of the font. For example, GDI+ can create a private version of the Arial font in addition to the Arial font that the system uses. PrivateFontCollection can also be used to install fonts that don't exist in the operating system. This is a temporary font install that doesn't affect the system-installed collection. To see the installed collection use the InstalledFontCollection class.

Note  When you use the GDI+ API, you must never allow your application to download arbitrary fonts from untrusted sources. The operating system requires elevated privileges to assure that all installed fonts are trusted.

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

Show:
© 2014 Microsoft