Font Class

A font is used to typeset text.
Inheritance Hierarchy

Namespace:  TallComponents.PDF.Fonts
Assembly:  TallComponents.PDF.Kit (in TallComponents.PDF.Kit.dll) Version: 5.0.23.0
Syntax
`public class Font`

The Font type exposes the following members.

Constructors
NameDescription
Font
Creates a new font object.
Top
Properties
NameDescription
Ascender
The ascender of this font at a font size of 1 pt. Multiply the ascender with the font size to get the ascender in points.
BaselineOffset
The distance in points between the lower extreme of a font and the visual baseline for a font of size 1 pt. Multiply the value of this property with the font size to get the distance in points.
Bold
Whether this font is bold by design.
CMapFolder
The folder where the CMaps can be found.
Courier
Get standard PDF font Courier.
CourierBold
Get standard PDF font Courier bold.
CourierBoldOblique
Get standard PDF font Courier bold oblique.
CourierOblique
Get standard PDF font Courier oblique.
DecorationLineWidth
The width of decoration lines for a font with a size of 1 pt.
Descender
The descender of this font at a font size of 1 pt. Multiply the descender with the font size to get the descender in points.
EmbedMode
How the font is stored inside the PDF.
FamilyName
The family name of the font.
Height
The height of this font at a font size of 1 pt. Multiply the height with the font size to get the height in points.
Helvetica
Get standard PDF font Helvetica.
HelveticaBold
Get standard PDF font Helvetica bold.
HelveticaBoldOblique
Get standard PDF font Helvetica bold oblique.
HelveticaOblique
Get standard PDF font Helvetica oblique.
Italic
Whether this font is italic by design.
ItalicAngle
The italic angle the font designer has assigned to this font (counter-clockwise from vertical).
LicensingRights
Font licensing rights.
LineGap
The height of the line gap specified inside this font at a font size of 1 pt. Multiply the line gap with the font size to get the line gap in points.
Name
The name of the font.
Path
The path of the TrueType file of this font.
StrikeOutOffset
The distance in points between the lower extreme of a font and the position of a strikethrough for a font of size 1 pt. Multiply the value of this property with the font size to get the distance in points.
SubscriptOffset
The subscript offset is the distance in points between the lower extreme of a font and the lower extreme where to place subscript text for a font of size 1 pt. Multiply with the font size to get the offset in points.
SubscriptScale
The subscript scale of this font. Multiply with the font size to get the subscript font size.
SuperscriptOffset
The superscript offset is the distance in points between the lower extreme of a font and the lower extreme where to place superscript text for a font of size 1 pt. Multiply with the font size to get the offset in points.
SuperscriptScale
The superscript scale of this font. Multiply with the font size to get the superscript font size.
Symbol
Get standard PDF font Symbol.
TimesBold
Get standard PDF font TimesRoman bold.
TimesBoldItalic
Get standard PDF font TimesRoman bold italic.
TimesItalic
Get standard PDF font TimesRoman italic.
TimesRoman
Get standard PDF font TimesRoman.
UnderlineOffset
The distance in points between the lower extreme of a font and the position of an underline for a font of size 1 pt. Multiply the value of this property with the font size to get the distance in points.
Weight
The Weight this font has by design [100...900]
XHeight
The height of the small letter x this font at a font size of 1 pt. Multiply the x-height with the font size to get the x-height in points.
ZapfDingbats
Get standard PDF font ZapfDingbats.
Top
Methods
NameDescription
Add characters to the embedded subset.
CalculateHeight
Calculate the height of the given text in points
CalculateWidth
Calculate the width of given text in points.
Contains
Check whether this font contains the given character.
Create(String, Boolean, Boolean)
Tries to find the first matching font.
Create(String, Boolean, Boolean, String)
Tries to find the first matching font.
CreatePaths
Return the glyph for the given Unicode chararacter as a FreeHandPathCollection.
Equals (Inherited from Object.)
Finalize (Inherited from Object.)
GetHashCode (Inherited from Object.)
GetTrueTypeFontNames
Retrieve the names of all TrueType files inside a TrueType collection file.
GetType (Inherited from Object.)
MemberwiseClone (Inherited from Object.)
SaveFamilies
Save the font family collection.
ToString (Inherited from Object.)
TrueType(Stream)
Get a TrueType font from a stream.
TrueType(String)
Get a TrueType font from file.
TrueType(Stream, String)
Get a TrueType font from a TrueType collection stream.
TrueType(String, String)
Get a TrueType font from a TrueType collection (.TTC) file.
Top
Events
NameDescription
ResolveCMap
Fired when a CMap need to be resolved.
Top
Remarks
There are 14 standard fonts available in PDF or you can load a TrueType font.
Examples
C#
```// Internal fonts
myFragment.Font = Font.Helvetica;

// TrueType fonts
Font arialBold = Font.TrueType( @"c:\windows\fonts\ARIALBD.TTF" );
myFragment.Font = arialBold;

// TrueType fonts can also be constructed through the Path property
Font arialBold = new Font();
arialBold.Path = @"c:\windows\fonts\ARIALBD.TTF";
myFragment.Font = arialBold;```