Namespace TallComponents.PDF.Fonts
Class Font
A font is used to typeset text.
There are 14 standard fonts available in PDF or you can load a TrueType font.
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;
Syntax
public class Font : Object
Constructors
Properties
Double 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.
Double 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.
Boolean Bold
Whether this font is bold by design.
String CMapFolder
The folder where the CMaps can be found.
Font Courier
Get standard PDF font Courier.
Font CourierBold
Get standard PDF font Courier bold.
Font CourierBoldOblique
Get standard PDF font Courier bold oblique.
Font CourierOblique
Get standard PDF font Courier oblique.
Double DecorationLineWidth
The width of decoration lines for a font with a size of 1 pt.
Double 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 EmbedMode
How the font is stored inside the PDF.
String FamilyName
The family name of the font.
FontGlyph[] Glyphs
Glyph data about all glyphs in the font program.
Double 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.
Font Helvetica
Get standard PDF font Helvetica.
Font HelveticaBold
Get standard PDF font Helvetica bold.
Font HelveticaBoldOblique
Get standard PDF font Helvetica bold oblique.
Font HelveticaOblique
Get standard PDF font Helvetica oblique.
Boolean Italic
Whether this font is italic by design.
Double ItalicAngle
The italic angle the font designer has assigned to this font (counter-clockwise from vertical).
FontLicensingRights LicensingRights
Font licensing rights.
Double 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.
String Name
The name of the font.
String Path
The path of the TrueType file of this font.
Double 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.
Double 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.
Double SubscriptScale
The subscript scale of this font. Multiply with the font size to get the subscript font size.
Double 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.
Double SuperscriptScale
The superscript scale of this font. Multiply with the font size to get the superscript font size.
Font Symbol
Get standard PDF font Symbol.
Font TimesBold
Get standard PDF font TimesRoman bold.
Font TimesBoldItalic
Get standard PDF font TimesRoman bold italic.
Font TimesItalic
Get standard PDF font TimesRoman italic.
Font TimesRoman
Get standard PDF font TimesRoman.
Double 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.
Int32 Weight
The Weight this font has by design [100...900]
Double 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.
Font ZapfDingbats
Get standard PDF font ZapfDingbats.
Methods
Void AddToSubset(Char[])
Add characters to the embedded subset.
Double CalculateHeight(String,Double,Double)
Calculate the height of the given text in points
Double CalculateWidth(String,Double)
Calculate the width of given text in points.
Boolean Contains(Char)
Check whether this font contains the given character.
Boolean Contains(Int32)
Check whether this font contains the given unicode value.
Boolean ContainsSurrogatePair(Char[])
Check whether this font contains the given surrogate pair.
Font Create(String,Boolean,Boolean)
Tries to find the first matching font.
Font Create(String,Boolean,Boolean,String)
Tries to find the first matching font.
FreeHandPathCollection CreatePaths(Char,Double)
Return the glyph for the given Unicode chararacter as a FreeHandPathCollection.
Boolean Equals(Object)
Determines whether an object is equal to the current object.
Int32 GetHashCode()
Returns the hash code of the current object.
String[] GetTrueTypeFontNames(String)
Retrieve the names of all TrueType files inside a TrueType collection file.
Void LoadFamilies(Stream)
Load the font family collection.
Void SaveFamilies(Stream)
Save the font family collection.
Font TrueType(Stream)
Get a TrueType font from a stream.
Font TrueType(Stream,String)
Get a TrueType font from a TrueType collection stream.
Font TrueType(String)
Get a TrueType font from file.
Font TrueType(String,String)
Get a TrueType font from a TrueType collection (.TTC) file.