<PackageReference Include="System.Drawing.Common" Version="10.0.0-preview.2.25163.9" />

InstalledFontCollection

public sealed class InstalledFontCollection : FontCollection
Represents the fonts installed on the system. This class cannot be inherited.
using System.Runtime.CompilerServices; using Windows.Win32; using Windows.Win32.Graphics.GdiPlus; namespace System.Drawing.Text { [NullableContext(1)] [Nullable(0)] public sealed class InstalledFontCollection : FontCollection { internal static InstalledFontCollection Instance { get; } = new InstalledFontCollection(); public unsafe InstalledFontCollection() : base(Create()) { GC.SuppressFinalize(this); } [NullableContext(0)] private unsafe static GpFontCollection* Create() { GpFontCollection* result = default(GpFontCollection*); PInvokeGdiPlus.GdipNewInstalledFontCollection(&result).ThrowIfFailed(); return result; } protected override void Dispose(bool disposing) { } } }