Class PdfFont
A font that can be used to draw text. Font instances are independent of documents and can be shared; each document creates its own font dictionary (and subset) on first use.
public abstract class PdfFont
- Inheritance
-
PdfFont
- Derived
- Inherited Members
Properties
Ascent
Ascent in 1/1000 em (positive).
public abstract double Ascent { get; }
Property Value
CapHeight
Cap height in 1/1000 em.
public abstract double CapHeight { get; }
Property Value
Descent
Descent in 1/1000 em (negative).
public abstract double Descent { get; }
Property Value
HasKerning
True if the font has pair kerning information.
public virtual bool HasKerning { get; }
Property Value
LineGap
Additional line gap in 1/1000 em.
public virtual double LineGap { get; }
Property Value
Name
The PostScript name of the font.
public abstract string Name { get; }
Property Value
UnderlinePosition
Position of the underline relative to the baseline in 1/1000 em (negative = below); -100 by default.
public virtual double UnderlinePosition { get; }
Property Value
UnderlineThickness
Thickness of the underline in 1/1000 em; 50 by default.
public virtual double UnderlineThickness { get; }
Property Value
Methods
CanDisplay(int)
True if the font can display the given character.
public abstract bool CanDisplay(int codePoint)
Parameters
codePointint
Returns
GetAscent(double)
Ascent in points for the given size.
public double GetAscent(double fontSize)
Parameters
fontSizedouble
Returns
GetCharWidth(int)
Advance width of a character in 1/1000 em.
public abstract double GetCharWidth(int codePoint)
Parameters
codePointint
Returns
GetDescent(double)
Descent in points for the given size (negative).
public double GetDescent(double fontSize)
Parameters
fontSizedouble
Returns
GetKerning(int, int)
Kerning between two characters in 1/1000 em (negative = closer), 0 if none.
public virtual double GetKerning(int left, int right)
Parameters
Returns
GetLineHeight(double)
Recommended distance between baselines in points.
public double GetLineHeight(double fontSize)
Parameters
fontSizedouble
Returns
GetTextWidth(string, double)
Width of text in points at the given font size.
public double GetTextWidth(string text, double fontSize)
Parameters
Returns
GetTextWidth(string, double, bool)
Width of text in points, optionally including pair kerning.
public double GetTextWidth(string text, double fontSize, bool kerning)