PrivateFontCollection class (gdiplusheaders.h)

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 implements FontCollection.


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 Windows GDI+ font collection.

Creates an empty PrivateFontCollection object. (PrivateFontCollection.PrivateFontCollection)

Creates an empty PrivateFontCollection object. (overload 1/2)


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.


Target Platform Windows
Header gdiplusheaders.h