Table of Contents

Class PdfFont

Namespace
MiPdf.Fonts
Assembly
MiPdf.dll

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

double

CapHeight

Cap height in 1/1000 em.

public abstract double CapHeight { get; }

Property Value

double

Descent

Descent in 1/1000 em (negative).

public abstract double Descent { get; }

Property Value

double

HasKerning

True if the font has pair kerning information.

public virtual bool HasKerning { get; }

Property Value

bool

LineGap

Additional line gap in 1/1000 em.

public virtual double LineGap { get; }

Property Value

double

Name

The PostScript name of the font.

public abstract string Name { get; }

Property Value

string

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

double

UnderlineThickness

Thickness of the underline in 1/1000 em; 50 by default.

public virtual double UnderlineThickness { get; }

Property Value

double

Methods

CanDisplay(int)

True if the font can display the given character.

public abstract bool CanDisplay(int codePoint)

Parameters

codePoint int

Returns

bool

GetAscent(double)

Ascent in points for the given size.

public double GetAscent(double fontSize)

Parameters

fontSize double

Returns

double

GetCharWidth(int)

Advance width of a character in 1/1000 em.

public abstract double GetCharWidth(int codePoint)

Parameters

codePoint int

Returns

double

GetDescent(double)

Descent in points for the given size (negative).

public double GetDescent(double fontSize)

Parameters

fontSize double

Returns

double

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

left int
right int

Returns

double

GetLineHeight(double)

Recommended distance between baselines in points.

public double GetLineHeight(double fontSize)

Parameters

fontSize double

Returns

double

GetTextWidth(string, double)

Width of text in points at the given font size.

public double GetTextWidth(string text, double fontSize)

Parameters

text string
fontSize double

Returns

double

GetTextWidth(string, double, bool)

Width of text in points, optionally including pair kerning.

public double GetTextWidth(string text, double fontSize, bool kerning)

Parameters

text string
fontSize double
kerning bool

Returns

double