• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class InstalledFontCollection

Represents the collection of fonts installed on the system. The collection is populated on first use by querying the platform's native font service (Windows registry, macOS CoreText, Linux fontconfig) and falling back to directory scanning. The result is cached for the lifetime of the process.

Inheritance
object
FontCollection
InstalledFontCollection
Implements
IDisposable
Inherited Members
FontCollection.Families
FontCollection.FindFamily(string)
FontCollection.Dispose()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: DRIT.Drawing.Text
Assembly: DRIT.Drawing.dll
Syntax
public sealed class InstalledFontCollection : FontCollection, IDisposable
Remarks

The auto-loading behaviour can be controlled via FontSettings. Set AutoLoadSystemFonts to false before first access to Default to disable system font scanning entirely (useful in web and server scenarios). Set UseNativeFontApis to false to skip native API calls and use directory scanning only.

Constructors

InstalledFontCollection()

Initializes a new InstalledFontCollection and discovers the system fonts. This matches the GDI+ new InstalledFontCollection() semantics where construction enumerates installed fonts.

Declaration
public InstalledFontCollection()
Remarks

The auto-loading behaviour can be controlled via FontSettings. Set AutoLoadSystemFonts to false before first access to Default to disable system font scanning entirely (useful in web and server scenarios). Set UseNativeFontApis to false to skip native API calls and use directory scanning only.

Properties

Default

Gets the process-wide default InstalledFontCollection. The system fonts are discovered once on first access and the result is cached for subsequent calls.

Declaration
public static InstalledFontCollection Default { get; }
Property Value
Type Description
InstalledFontCollection
Remarks

The behaviour of this property is controlled by FontSettings. Changes to FontSettings after first access have no effect.

DefaultFamilyName

The default font family name as reported by the operating system, or null when the OS did not provide one.

Declaration
public string? DefaultFamilyName { get; }
Property Value
Type Description
string
Remarks

The auto-loading behaviour can be controlled via FontSettings. Set AutoLoadSystemFonts to false before first access to Default to disable system font scanning entirely (useful in web and server scenarios). Set UseNativeFontApis to false to skip native API calls and use directory scanning only.

Implements

IDisposable
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX