PDFsharp-net6

DocumentFontResolver

Namespace: PdfSharp.Fonts

Resolves the 14 standard-fonts and/or fonts in existing documents.

public class DocumentFontResolver : IFontResolver, IFontResolverMarker

Inheritance ObjectDocumentFontResolver
Implements IFontResolver, IFontResolverMarker

Constructors

DocumentFontResolver(PdfDocument)

Creates a new instance of the DocumentFontResolver

public DocumentFontResolver(PdfDocument document)

Parameters

document PdfDocument

Methods

Register(String, Byte[], Boolean, Boolean)

Registers a new font

public static void Register(string fontName, Byte[] fontData, bool isBold, bool isItalic)

Parameters

fontName String
The name of the font

fontData Byte[]
The font-data

isBold Boolean
Specifies, whether the font is bold

isItalic Boolean
Specifies, whether the font is italic

GetFont(String)

Gets the data for the specified font.

public Byte[] GetFont(string faceName)

Parameters

faceName String
Name of the font

Returns

Byte[]
Font data or null, if no font with the specified name could be found

ResolveTypeface(String, Boolean, Boolean)

Get a FontResolverInfo for the specified font

public FontResolverInfo ResolveTypeface(string familyName, bool isBold, bool isItalic)

Parameters

familyName String
Name of the font

isBold Boolean

isItalic Boolean

Returns

FontResolverInfo
A FontResolverInfo or null, if no font with the specified name could be found