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.


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


The PrivateFontCollection class has these constructors.


Creates an empty PrivateFontCollection object.



The PrivateFontCollection class has these methods.


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


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



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