Class FontsRepository
Central registry for fonts used by the fixed document model; create standard or embedded fonts and manage font registration.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Fixed.Model.Fonts
Assembly: Telerik.Windows.Documents.Fixed.dll
Syntax
public static class FontsRepository
Properties
Courier
Gets the Courier font object.
Declaration
public static FontBase Courier { get; }
Property Value
|
FontBase
The Courier font instance. |
CourierBold
Gets the Courier Bold font object.
Declaration
public static FontBase CourierBold { get; }
Property Value
|
FontBase
The Courier Bold font instance. |
CourierBoldOblique
Gets the Courier Bold Oblique font object.
Declaration
public static FontBase CourierBoldOblique { get; }
Property Value
|
FontBase
The Courier Bold Oblique font instance. |
CourierOblique
Gets the Courier Oblique font object.
Declaration
public static FontBase CourierOblique { get; }
Property Value
|
FontBase
The Courier Oblique font instance. |
Helvetica
Gets the Helvetica font object.
Declaration
public static FontBase Helvetica { get; }
Property Value
|
FontBase
The Helvetica font instance. |
HelveticaBold
Gets the Helvetica Bold font object.
Declaration
public static FontBase HelveticaBold { get; }
Property Value
|
FontBase
The Helvetica Bold font instance. |
HelveticaBoldOblique
Gets the Helvetica Bold Oblique font object.
Declaration
public static FontBase HelveticaBoldOblique { get; }
Property Value
|
FontBase
The Helvetica Bold Oblique font instance. |
HelveticaOblique
Gets the Helvetica Oblique font object.
Declaration
public static FontBase HelveticaOblique { get; }
Property Value
|
FontBase
The Helvetica Oblique font instance. |
Symbol
Gets the Symbol font object.
Declaration
public static FontBase Symbol { get; }
Property Value
|
FontBase
The Symbol font instance. |
TimesBold
Gets the Times Bold font object.
Declaration
public static FontBase TimesBold { get; }
Property Value
|
FontBase
The Times Bold font instance. |
TimesBoldItalic
Gets the Times Bold Italic font object.
Declaration
public static FontBase TimesBoldItalic { get; }
Property Value
|
FontBase
The Times Bold Italic font instance. |
TimesItalic
Gets the Times Italic font object.
Declaration
public static FontBase TimesItalic { get; }
Property Value
|
FontBase
The Times Italic font instance. |
TimesRoman
Gets the Times Roman font object.
Declaration
public static FontBase TimesRoman { get; }
Property Value
|
FontBase
The Times Roman font instance. |
ZapfDingbats
Gets the ZapfDingbats font object.
Declaration
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
public static void ClearRegisteredFonts()
RegisterFont(FontFamily, FontStyle, FontWeight, Byte[])
Registers a font with the specified font family, style, weight, and data for use in PDF documents.
Declaration
public static void RegisterFont(FontFamily fontFamily, FontStyle fontStyle, FontWeight fontWeight, byte[] data)
Parameters
|
System.Windows.Media.FontFamily
fontFamily
The font family to register. |
|
System.Windows.FontStyle
fontStyle
The font style (normal, italic, etc.). |
|
System.Windows.FontWeight
fontWeight
The font weight (normal, bold, etc.). |
|
System.Byte[]
data
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
public static void ReplaceStandardFont(StandardFontNames name, byte[] data)
Parameters
|
StandardFontNames
name
The name of the standard font to be replaced. |
|
System.Byte[]
data
The binary font data to use as replacement. |
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.
Exceptions
|
NotSupportedFontException
Thrown when an invalid font name is passed or the font data is not a valid Type1 font. |
TryCreateFont(FontFamily, FontStyle, FontWeight, out FontBase)
Tries to create a new font object based on the given font properties.
Declaration
public static bool TryCreateFont(FontFamily fontFamily, FontStyle fontStyle, FontWeight fontWeight, out FontBase font)
Parameters
|
System.Windows.Media.FontFamily
fontFamily
The font family to create. |
|
System.Windows.FontStyle
fontStyle
The font style (normal, italic, etc.). |
|
System.Windows.FontWeight
fontWeight
The font weight (normal, bold, etc.). |
|
FontBase
font
When this method returns, contains the created font object if successful, or null if creation failed. |
Returns
|
System.Boolean
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
public static bool TryCreateFont(FontFamily fontFamily, out FontBase font)
Parameters
|
System.Windows.Media.FontFamily
fontFamily
The font family to create. |
|
FontBase
font
When this method returns, contains the created font object if successful, or null if creation failed. |
Returns
|
System.Boolean
True if the font was created successfully; otherwise, false. |