Class
FontsRepository

Central registry for fonts used by the fixed document model; create standard or embedded fonts and manage font registration.

Definition

Namespace:Telerik.Windows.Documents.Fixed.Model.Fonts

Assembly:Telerik.Windows.Documents.Fixed.dll

Syntax:

cs-api-definition
public static class FontsRepository

Inheritance: objectFontsRepository

Properties

Courier

Gets the Courier font object.

Declaration

cs-api-definition
public static FontBase Courier { get; }

Property Value

FontBase

The Courier font instance.

CourierBold

Gets the Courier Bold font object.

Declaration

cs-api-definition
public static FontBase CourierBold { get; }

Property Value

FontBase

The Courier Bold font instance.

CourierBoldOblique

Gets the Courier Bold Oblique font object.

Declaration

cs-api-definition
public static FontBase CourierBoldOblique { get; }

Property Value

FontBase

The Courier Bold Oblique font instance.

CourierOblique

Gets the Courier Oblique font object.

Declaration

cs-api-definition
public static FontBase CourierOblique { get; }

Property Value

FontBase

The Courier Oblique font instance.

Helvetica

Gets the Helvetica font object.

Declaration

cs-api-definition
public static FontBase Helvetica { get; }

Property Value

FontBase

The Helvetica font instance.

HelveticaBold

Gets the Helvetica Bold font object.

Declaration

cs-api-definition
public static FontBase HelveticaBold { get; }

Property Value

FontBase

The Helvetica Bold font instance.

HelveticaBoldOblique

Gets the Helvetica Bold Oblique font object.

Declaration

cs-api-definition
public static FontBase HelveticaBoldOblique { get; }

Property Value

FontBase

The Helvetica Bold Oblique font instance.

HelveticaOblique

Gets the Helvetica Oblique font object.

Declaration

cs-api-definition
public static FontBase HelveticaOblique { get; }

Property Value

FontBase

The Helvetica Oblique font instance.

Symbol

Gets the Symbol font object.

Declaration

cs-api-definition
public static FontBase Symbol { get; }

Property Value

FontBase

The Symbol font instance.

TimesBold

Gets the Times Bold font object.

Declaration

cs-api-definition
public static FontBase TimesBold { get; }

Property Value

FontBase

The Times Bold font instance.

TimesBoldItalic

Gets the Times Bold Italic font object.

Declaration

cs-api-definition
public static FontBase TimesBoldItalic { get; }

Property Value

FontBase

The Times Bold Italic font instance.

TimesItalic

Gets the Times Italic font object.

Declaration

cs-api-definition
public static FontBase TimesItalic { get; }

Property Value

FontBase

The Times Italic font instance.

TimesRoman

Gets the Times Roman font object.

Declaration

cs-api-definition
public static FontBase TimesRoman { get; }

Property Value

FontBase

The Times Roman font instance.

ZapfDingbats

Gets the ZapfDingbats font object.

Declaration

cs-api-definition
public static FontBase ZapfDingbats { get; }

Property Value

FontBase

The ZapfDingbats font instance.

Methods

ClearRegisteredFonts()

Clears all registered custom fonts from the repository, resetting it to default state.

Declaration

cs-api-definition
public static void ClearRegisteredFonts()

ClearStandardFontFallbacks()

Clears all standard font fallbacks from the repository.

Declaration

cs-api-definition
public static void ClearStandardFontFallbacks()

RegisterFont(FontFamily, FontStyle, FontWeight, byte[])

Registers a font with the specified font family, style, weight, and data for use in PDF documents.

Declaration

cs-api-definition
public static void RegisterFont(FontFamily fontFamily, FontStyle fontStyle, FontWeight fontWeight, byte[] data)

Parameters

fontFamily

FontFamily

The font family to register.

fontStyle

FontStyle

The font style (normal, italic, etc.).

fontWeight

FontWeight

The font weight (normal, bold, etc.).

data

byte[]

The binary font data.

ReplaceStandardFont(StandardFontNames, byte[])

Replaces a built-in Standard Font with user-provided Type 1 font data. Use this when the built-in standard font differs from the one you possess (e.g., different vendor/metrics) and you want the PDF to use your exact font.

Declaration

cs-api-definition
public static void ReplaceStandardFont(StandardFontNames name, byte[] data)

Parameters

name

StandardFontNames

The name of the standard font to be replaced.

data

byte[]

The binary font data to use as replacement.

Exceptions

NotSupportedFontException

Thrown when an invalid font name is passed or the font data is not a valid Type1 font.

Remarks

Not intended for replacing a standard font with a non-standard font. The provided data must represent the same standard Type 1 font corresponding to the specified name.

SetStandardFontFallback(StandardFontNames, FontBase)

Sets a fallback font to be used when a standard font cannot be loaded or used.

Declaration

cs-api-definition
public static void SetStandardFontFallback(StandardFontNames name, FontBase fallback)

Parameters

name

StandardFontNames

The name of the standard font for which to set a fallback.

fallback

FontBase

The fallback font to use in place of the standard font.

Exceptions

ArgumentNullException

Thrown when fallback is null.

NotSupportedFontException

Thrown when an invalid standard font name is passed.

TryCreateFont(FontFamily, FontStyle, FontWeight, out FontBase)

Tries to create a new font object based on the given font properties.

Declaration

cs-api-definition
public static bool TryCreateFont(FontFamily fontFamily, FontStyle fontStyle, FontWeight fontWeight, out FontBase font)

Parameters

fontFamily

FontFamily

The font family to create.

fontStyle

FontStyle

The font style (normal, italic, etc.).

fontWeight

FontWeight

The font weight (normal, bold, etc.).

font

FontBase

When this method returns, contains the created font object if successful, or null if creation failed.

Returns

bool

True if the font was created successfully; otherwise, false.

TryCreateFont(FontFamily, out FontBase)

Tries to create a new font object with normal style and weight based on the given font family.

Declaration

cs-api-definition
public static bool TryCreateFont(FontFamily fontFamily, out FontBase font)

Parameters

fontFamily

FontFamily

The font family to create.

font

FontBase

When this method returns, contains the created font object if successful, or null if creation failed.

Returns

bool

True if the font was created successfully; otherwise, false.