Skip to main content

Font

Version: 6.0

cete.dynamicpdf.font

Font​

Base class from which all fonts are derived.

public abstract class Font : Resource
Public MustInherit Class Font
Inherits Resource

Inheritance: Object → Resource → Font

Derived: CeTeBullets, CoreLatinFont, Courier, CourierBold, CourierBoldOblique, CourierOblique, Helvetica, HelveticaBold, HelveticaBoldOblique, HelveticaOblique, OpenTypeFont, Symbol, TimesBold, TimesBoldItalic, TimesItalic, TimesRoman, Type1Font

Licensing​

This class is a DynamicPDF Generator Community Edition feature.

Remarks​

See the Fonts And Text topic for more on fonts.

Properties​

Ascender​

Gets the ascender for the font.

public abstract short Ascender { get; }
Public MustOverride Property Ascender As Int16

Property Value​

Int16

CeTeBullets​

Gets the ceTe Bullets font.

public static Font CeTeBullets { get; }
Public Shared Property CeTeBullets As Font

Property Value​

Font

Courier​

Gets the Courier core font with Latin 1 encoding.

public static Font Courier { get; }
Public Shared Property Courier As Font

Property Value​

Font

CourierBold​

Gets the Courier Bold core font with Latin 1 encoding.

public static Font CourierBold { get; }
Public Shared Property CourierBold As Font

Property Value​

Font

CourierBoldOblique​

Gets the Courier Bold Oblique core font with Latin 1 encoding.

public static Font CourierBoldOblique { get; }
Public Shared Property CourierBoldOblique As Font

Property Value​

Font

CourierOblique​

Gets the Courier Oblique core font with Latin 1 encoding.

public static Font CourierOblique { get; }
Public Shared Property CourierOblique As Font

Property Value​

Font

Descender​

Gets the descender for the font.

public abstract short Descender { get; }
Public MustOverride Property Descender As Int16

Property Value​

Int16

Encoder​

Gets the encoder for the font.

public Encoder Encoder { get; }
Public Property Encoder As Encoder

Property Value​

Encoder

FormFontName​

Gets the four character name of the font.

public string FormFontName { get; }
Public Property FormFontName As String

Property Value​

String

HanyangSystemsGothicMedium​

Gets the Hanyang Systems Gothic Medium Korean font.

public static Font HanyangSystemsGothicMedium { get; }
Public Shared Property HanyangSystemsGothicMedium As Font

Property Value​

Font

HanyangSystemsShinMyeongJoMedium​

Gets the Hanyang Systems Shin MyeongJo Medium Korean font.

public static Font HanyangSystemsShinMyeongJoMedium { get; }
Public Shared Property HanyangSystemsShinMyeongJoMedium As Font

Property Value​

Font

HeiseiKakuGothicW5​

Gets the Heisei Kaku Gothic W5 Japanese font.

public static Font HeiseiKakuGothicW5 { get; }
Public Shared Property HeiseiKakuGothicW5 As Font

Property Value​

Font

HeiseiMinchoW3​

Gets the Heisei Mincho W3 Japanese font.

public static Font HeiseiMinchoW3 { get; }
Public Shared Property HeiseiMinchoW3 As Font

Property Value​

Font

Helvetica​

Gets the Helvetica core font with Latin 1 encoding.

public static Font Helvetica { get; }
Public Shared Property Helvetica As Font

Property Value​

Font

HelveticaBold​

Gets the Helvetica Bold core font with Latin 1 encoding.

public static Font HelveticaBold { get; }
Public Shared Property HelveticaBold As Font

Property Value​

Font

HelveticaBoldOblique​

Gets the Helvetica Bold Oblique core font with Latin 1 encoding.

public static Font HelveticaBoldOblique { get; }
Public Shared Property HelveticaBoldOblique As Font

Property Value​

Font

HelveticaOblique​

Gets the Helvetica Oblique core font with Latin 1 encoding.

public static Font HelveticaOblique { get; }
Public Shared Property HelveticaOblique As Font

Property Value​

Font

LineBreaker​

Gets the default line breaker for the font.

public abstract LineBreaker LineBreaker { get; }
Public MustOverride Property LineBreaker As LineBreaker

Property Value​

LineBreaker

LineGap​

Gets the line gap for the font.

public short LineGap { get; }
Public Property LineGap As Int16

Property Value​

Int16

MonotypeHeiMedium​

Gets the Monotype Hei Medium Chinese (traditional) font.

public static Font MonotypeHeiMedium { get; }
Public Shared Property MonotypeHeiMedium As Font

Property Value​

Font

MonotypeSungLight​

Gets the Monotype Sung Light Chinese (traditional) font.

public static Font MonotypeSungLight { get; }
Public Shared Property MonotypeSungLight As Font

Property Value​

Font

Name​

Gets the name of the font.

public abstract string Name { get; }
Public MustOverride Property Name As String

Property Value​

String

RequiredPdfObjects​

Gets the number of PDF objects required by the resource. (Inherited from Resource)

public int RequiredPdfObjects { get; }
Public Property RequiredPdfObjects As Int32

Property Value​

Int32

ResourceType​

Gets the resource type.

public ResourceType ResourceType { get; }
Public Property ResourceType As ResourceType

Property Value​

ResourceType

SinoTypeSongLight​

Gets the SinoType Song Light Chinese (simplified) font.

public static Font SinoTypeSongLight { get; }
Public Shared Property SinoTypeSongLight As Font

Property Value​

Font

Symbol​

Gets the Symbol core font.

public static Font Symbol { get; }
Public Shared Property Symbol As Font

Property Value​

Font

TimesBold​

Gets the Times Bold core font with Latin 1 encoding.

public static Font TimesBold { get; }
Public Shared Property TimesBold As Font

Property Value​

Font

TimesBoldItalic​

Gets the Times Bold Italic core font with Latin 1 encoding.

public static Font TimesBoldItalic { get; }
Public Shared Property TimesBoldItalic As Font

Property Value​

Font

TimesItalic​

Gets the Times Italic core font with Latin 1 encoding.

public static Font TimesItalic { get; }
Public Shared Property TimesItalic As Font

Property Value​

Font

TimesRoman​

Gets the Times Roman core font with Latin 1 encoding.

public static Font TimesRoman { get; }
Public Shared Property TimesRoman As Font

Property Value​

Font

Uid​

Gets the unique ID of the resource. (Inherited from Resource)

public long Uid { get; }
Public Property Uid As Int64

Property Value​

Int64

ZapfDingbats​

Gets the Zapf Dingbats core font.

public static Font ZapfDingbats { get; }
Public Shared Property ZapfDingbats As Font

Property Value​

Font

Methods​

CanLoadSystemFont(Font)​

Checks whether the font can be loaded from the system fonts.

public static bool CanLoadSystemFont(Font font)
Shared Function CanLoadSystemFont(font As Font) As Boolean

Parameters​

Font of type System.Drawing.Font

Returns​

Returns true if the provided font can be loaded.

CanLoadSystemFont(String)​

Checks whether the Font can be loaded from the system fonts for the font name provided.

public static bool CanLoadSystemFont(string systemFontName)
Shared Function CanLoadSystemFont(systemFontName As String) As Boolean

Parameters​

Name of the font.

Returns​

Returns true if the provided font can be loaded.

Draw(DocumentWriter)​

Draws the resource to the given DocumentWriter object. (Inherited from Resource)

public abstract void Draw(DocumentWriter writer)
MustOverride Sub Draw(writer As DocumentWriter)

Parameters​

DocumentWriter object to receive the resource's output.

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetAscender(Single)​

Returns the ascender of the font in points for the given font size.

public float GetAscender(float fontSize)
Function GetAscender(fontSize As Single) As Single

Parameters​

Font size to use for the calculation.

Returns​

The ascender in points.

GetBaseLine(Single, Single)​

Returns the baseline of the font in points for the given leading and font size.

public float GetBaseLine(float fontSize, float leading)
Function GetBaseLine(fontSize As Single, leading As Single) As Single

Parameters​

Font size to use for the calculation.

Leading to use for the calculation.

Returns​

The baseline in points.

GetDefaultLeading(Single)​

Returns the default leading of the font in points for the given font size.

public float GetDefaultLeading(float fontSize)
Function GetDefaultLeading(fontSize As Single) As Single

Parameters​

Font size to use for the calculation.

Returns​

The default leading in points.

GetDescender(Single)​

Returns the descender of the font in points for the given font size.

public float GetDescender(float fontSize)
Function GetDescender(fontSize As Single) As Single

Parameters​

Font size to use for the calculation.

Returns​

The descender in points.

GetGlyphWidth(Char)​

Returns the mwidth of a glyph.

public abstract short GetGlyphWidth(char glyph)
MustOverride Function GetGlyphWidth(glyph As Char) As Short

Parameters​

Glyph whose mwidth is to be returned.

Returns​

Mwidth of glyph.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetKernValue(Char, Char)​

Returns kerning space between two chars.

public float GetKernValue(char left, char right)
Function GetKernValue(left As Char, right As Char) As Single

Parameters​

Char in left side of the pair.

Char in the right side of the pair.

Returns​

Kerning space between the given chars.

GetLineGap(Single)​

Returns the line gap of the font in points for the given font size.

public float GetLineGap(float fontSize)
Function GetLineGap(fontSize As Single) As Single

Parameters​

Font size to use for the calculation.

Returns​

The line gap in points.

GetTextLines(Char[], Single, Single)​

Returns a TextLineList for the given character array.

public TextLineList GetTextLines(Char[] text, float width, float fontSize)
Function GetTextLines(text As Char[], width As Single, fontSize As Single) As TextLineList

Parameters​

Character array containing the text.

Width to use when calculating the text lines.

Font size to use when calculating the text lines.

Returns​

A TextLineList containing the text.

GetTextLines(Char[], Single, Single, Single)​

Returns a TextLineList for the given character array.

public TextLineList GetTextLines(Char[] text, float width, float height, float fontSize)
Function GetTextLines(text As Char[], width As Single, height As Single, fontSize As Single) As TextLineList

Parameters​

Character array containing the text.

Width to use when calculating the text lines.

Height to use when calculating the text lines.

Font size to use when calculating the text lines.

Returns​

A TextLineList containing the text.

GetTextWidth(Char[], Single)​

Returns the width of the given text.

public float GetTextWidth(Char[] text, float fontSize)
Function GetTextWidth(text As Char[], fontSize As Single) As Single

Parameters​

Byte array or text whose width is returned.

Font size of text.

Returns​

Width of text in points.

GetTextWidth(String, Single)​

Returns the width of the given text.

public float GetTextWidth(string text, float fontSize)
Function GetTextWidth(text As String, fontSize As Single) As Single

Parameters​

Text whose width is returned.

Font size of text.

Returns​

Width of text in points.

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

HasKerning()​

Indicates whether the given font is having Kerning pairs or not.

public bool HasKerning()
Function HasKerning() As Boolean

Returns​

Bool indicating presence of kern pairs.

LoadSystemFont(Font)​

Load the Font from the system font if it is available.

public static Font LoadSystemFont(Font font)
Shared Function LoadSystemFont(font As Font) As Font

Parameters​

Font of type System.Drawing.Font

Returns​

Returns Font object if the provided font is loaded else null.

LoadSystemFont(String)​

Load the Font from the system font if it is available.

public static Font LoadSystemFont(string systemFontName)
Shared Function LoadSystemFont(systemFontName As String) As Font

Parameters​

Name of the font.

Returns​

Returns Font object if the provided font is loaded else null.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF