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
Public methodFont
Creates a new font object.
Top
Properties
  NameDescription
Public propertyAscender
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.
Public propertyBaselineOffset
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.
Public propertyBold
Whether this font is bold by design.
Public propertyStatic memberCMapFolder
The folder where the CMaps can be found.
Public propertyStatic memberCourier
Get standard PDF font Courier.
Public propertyStatic memberCourierBold
Get standard PDF font Courier bold.
Public propertyStatic memberCourierBoldOblique
Get standard PDF font Courier bold oblique.
Public propertyStatic memberCourierOblique
Get standard PDF font Courier oblique.
Public propertyDecorationLineWidth
The width of decoration lines for a font with a size of 1 pt.
Public propertyDescender
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.
Public propertyEmbedMode
How the font is stored inside the PDF.
Public propertyFamilyName
The family name of the font.
Public propertyHeight
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.
Public propertyStatic memberHelvetica
Get standard PDF font Helvetica.
Public propertyStatic memberHelveticaBold
Get standard PDF font Helvetica bold.
Public propertyStatic memberHelveticaBoldOblique
Get standard PDF font Helvetica bold oblique.
Public propertyStatic memberHelveticaOblique
Get standard PDF font Helvetica oblique.
Public propertyItalic
Whether this font is italic by design.
Public propertyItalicAngle
The italic angle the font designer has assigned to this font (counter-clockwise from vertical).
Public propertyLicensingRights
Font licensing rights.
Public propertyLineGap
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.
Public propertyName
The name of the font.
Public propertyPath
The path of the TrueType file of this font.
Public propertyStrikeOutOffset
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.
Public propertySubscriptOffset
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.
Public propertySubscriptScale
The subscript scale of this font. Multiply with the font size to get the subscript font size.
Public propertySuperscriptOffset
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.
Public propertySuperscriptScale
The superscript scale of this font. Multiply with the font size to get the superscript font size.
Public propertyStatic memberSymbol
Get standard PDF font Symbol.
Public propertyStatic memberTimesBold
Get standard PDF font TimesRoman bold.
Public propertyStatic memberTimesBoldItalic
Get standard PDF font TimesRoman bold italic.
Public propertyStatic memberTimesItalic
Get standard PDF font TimesRoman italic.
Public propertyStatic memberTimesRoman
Get standard PDF font TimesRoman.
Public propertyUnderlineOffset
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.
Public propertyWeight
The Weight this font has by design [100...900]
Public propertyXHeight
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.
Public propertyStatic memberZapfDingbats
Get standard PDF font ZapfDingbats.
Top
Methods
  NameDescription
Public methodAddToSubset
Add characters to the embedded subset.
Public methodCalculateHeight
Calculate the height of the given text in points
Public methodCalculateWidth
Calculate the width of given text in points.
Public methodContains
Check whether this font contains the given character.
Public methodStatic memberCreate(String, Boolean, Boolean)
Tries to find the first matching font.
Public methodStatic memberCreate(String, Boolean, Boolean, String)
Tries to find the first matching font.
Public methodCreatePaths
Return the glyph for the given Unicode chararacter as a FreeHandPathCollection.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodStatic memberGetTrueTypeFontNames
Retrieve the names of all TrueType files inside a TrueType collection file.
Public methodGetType (Inherited from Object.)
Public methodStatic memberLoadFamilies
Load the font family collection.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodStatic memberSaveFamilies
Save the font family collection.
Public methodToString (Inherited from Object.)
Public methodStatic memberTrueType(Stream)
Get a TrueType font from a stream.
Public methodStatic memberTrueType(String)
Get a TrueType font from file.
Public methodStatic memberTrueType(Stream, String)
Get a TrueType font from a TrueType collection stream.
Public methodStatic memberTrueType(String, String)
Get a TrueType font from a TrueType collection (.TTC) file.
Top
Events
  NameDescription
Public eventStatic memberResolveCMap
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;
See Also