cete.dynamicpdf.font
Font
- Namespace: ceTe.DynamicPDF
- Assemblies: ceTe.DynamicPDF.40.dll
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
CeTeBullets
Gets the ceTe Bullets font.
public static Font CeTeBullets { get; }
Public Shared Property CeTeBullets As Font
Property Value
Courier
Gets the Courier core font with Latin 1 encoding.
public static Font Courier { get; }
Public Shared Property Courier As Font
Property Value
CourierBold
Gets the Courier Bold core font with Latin 1 encoding.
public static Font CourierBold { get; }
Public Shared Property CourierBold As Font
Property Value
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
CourierOblique
Gets the Courier Oblique core font with Latin 1 encoding.
public static Font CourierOblique { get; }
Public Shared Property CourierOblique As Font
Property Value
Descender
Gets the descender for the font.
public abstract short Descender { get; }
Public MustOverride Property Descender As Int16
Property Value
Encoder
Gets the encoder for the font.
public Encoder Encoder { get; }
Public Property Encoder As Encoder
Property Value
FormFontName
Gets the four character name of the font.
public string FormFontName { get; }
Public Property FormFontName As String
Property Value
HanyangSystemsGothicMedium
Gets the Hanyang Systems Gothic Medium Korean font.
public static Font HanyangSystemsGothicMedium { get; }
Public Shared Property HanyangSystemsGothicMedium As Font
Property Value
HanyangSystemsShinMyeongJoMedium
Gets the Hanyang Systems Shin MyeongJo Medium Korean font.
public static Font HanyangSystemsShinMyeongJoMedium { get; }
Public Shared Property HanyangSystemsShinMyeongJoMedium As Font
Property Value
HeiseiKakuGothicW5
Gets the Heisei Kaku Gothic W5 Japanese font.
public static Font HeiseiKakuGothicW5 { get; }
Public Shared Property HeiseiKakuGothicW5 As Font
Property Value
HeiseiMinchoW3
Gets the Heisei Mincho W3 Japanese font.
public static Font HeiseiMinchoW3 { get; }
Public Shared Property HeiseiMinchoW3 As Font
Property Value
Helvetica
Gets the Helvetica core font with Latin 1 encoding.
public static Font Helvetica { get; }
Public Shared Property Helvetica As Font
Property Value
HelveticaBold
Gets the Helvetica Bold core font with Latin 1 encoding.
public static Font HelveticaBold { get; }
Public Shared Property HelveticaBold As Font
Property Value
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
HelveticaOblique
Gets the Helvetica Oblique core font with Latin 1 encoding.
public static Font HelveticaOblique { get; }
Public Shared Property HelveticaOblique As Font
Property Value
LineBreaker
Gets the default line breaker for the font.
public abstract LineBreaker LineBreaker { get; }
Public MustOverride Property LineBreaker As LineBreaker
Property Value
LineGap
Gets the line gap for the font.
public short LineGap { get; }
Public Property LineGap As Int16
Property Value
MonotypeHeiMedium
Gets the Monotype Hei Medium Chinese (traditional) font.
public static Font MonotypeHeiMedium { get; }
Public Shared Property MonotypeHeiMedium As Font
Property Value
MonotypeSungLight
Gets the Monotype Sung Light Chinese (traditional) font.
public static Font MonotypeSungLight { get; }
Public Shared Property MonotypeSungLight As Font
Property Value
Name
Gets the name of the font.
public abstract string Name { get; }
Public MustOverride Property Name As String
Property Value
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
ResourceType
Gets the resource type.
public ResourceType ResourceType { get; }
Public Property ResourceType As ResourceType
Property Value
SinoTypeSongLight
Gets the SinoType Song Light Chinese (simplified) font.
public static Font SinoTypeSongLight { get; }
Public Shared Property SinoTypeSongLight As Font
Property Value
Symbol
Gets the Symbol core font.
public static Font Symbol { get; }
Public Shared Property Symbol As Font
Property Value
TimesBold
Gets the Times Bold core font with Latin 1 encoding.
public static Font TimesBold { get; }
Public Shared Property TimesBold As Font
Property Value
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
TimesItalic
Gets the Times Italic core font with Latin 1 encoding.
public static Font TimesItalic { get; }
Public Shared Property TimesItalic As Font
Property Value
TimesRoman
Gets the Times Roman core font with Latin 1 encoding.
public static Font TimesRoman { get; }
Public Shared Property TimesRoman As Font
Property Value
Uid
Gets the unique ID of the resource. (Inherited from Resource)
public long Uid { get; }
Public Property Uid As Int64
Property Value
ZapfDingbats
Gets the Zapf Dingbats core font.
public static Font ZapfDingbats { get; }
Public Shared Property ZapfDingbats As Font
Property Value
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: Font
Font of type System.Drawing.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
- writer: DocumentWriter
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
- obj: Object
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
- fontSize: Single
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
- fontSize: Single
Font size to use for the calculation.
- leading: Single
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
- fontSize: Single
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
- fontSize: Single
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: Char
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
- left: Char
Char in left side of the pair.
- right: Char
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
- fontSize: Single
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
- text: Char[]
Character array containing the text.
- width: Single
Width to use when calculating the text lines.
- fontSize: Single
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
- text: Char[]
Character array containing the text.
- width: Single
Width to use when calculating the text lines.
- height: Single
Height to use when calculating the text lines.
- fontSize: Single
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
- text: Char[]
Byte array or text whose width is returned.
- fontSize: Single
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: String
Text whose width is returned.
- fontSize: Single
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: Font
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
- systemFontName: String
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 .