PDFsharp-net6

GlobalFontSettings

Namespace: PdfSharp.Fonts

Provides functionality to specify information about the handling of fonts in the current application domain.

public static class GlobalFontSettings

Inheritance ObjectGlobalFontSettings

Fields

DefaultFontName

The name of the default font.

public static string DefaultFontName;

Properties

FontResolver

Gets or sets the global font resolver for the current application domain. This static function must be called only once and before any font operation was executed by PDFsharp. If this is not easily to obtain, e.g. because your code is running on a web server, you must provide the same instance of your font resolver in every subsequent setting of this property. In a web application set the font resolver in Global.asax.

public static IFontResolver FontResolver { get; set; }

Property Value

IFontResolver

DefaultFontEncoding

Gets or sets the default font encoding used for XFont objects where encoding is not explicitly specified. If it is not set, the default value is PdfFontEncoding.Unicode. If you are sure your document contains only Windows-1252 characters (see https://en.wikipedia.org/wiki/Windows-1252) set default encoding to PdfFontEncoding.Windows1252. Must be set only once per app domain.

public static PdfFontEncoding DefaultFontEncoding { get; set; }

Property Value

PdfFontEncoding

Methods

AddFontResolver(IFontResolverMarker)

Caution

Not yet implemented.


Adds a font resolver. NYI

public static void AddFontResolver(IFontResolverMarker fontResolver)

Parameters

fontResolver IFontResolverMarker
The font resolver.

ResetFontResolvers()

Resets the font resolvers and clears all internal cache. Intended to be used in unit tests only.

public static void ResetFontResolvers()