<PackageReference Include="System.Drawing.Common" Version="9.0.0-preview.1.24081.2" />

PrivateFontCollection

public sealed class PrivateFontCollection : FontCollection
Provides a collection of font families built from font files that are provided by the client application.

Initializes a new instance of the PrivateFontCollection class.

public void AddFontFile(string filename)

Adds a font from the specified file to this PrivateFontCollection.

public void AddMemoryFont(IntPtr memory, int length)

Adds a font contained in system memory to this PrivateFontCollection.