Table of Contents

Class XFont

Namespace
PdfSharp.Drawing
Assembly
PdfSharp.dll

Defines an object used to draw text.

public sealed class XFont
Inheritance
XFont
Inherited Members

Constructors

XFont(XGlyphTypeface, double, XPdfFontOptions?, XStyleSimulations?)

Initializes a new instance of the XFont class. Not yet implemented.

public XFont(XGlyphTypeface glyphTypeface, double emSize, XPdfFontOptions? pdfOptions = null, XStyleSimulations? styleSimulations = null)

Parameters

glyphTypeface XGlyphTypeface

The typeface.

emSize double

The em size.

pdfOptions XPdfFontOptions

The PDF options.

styleSimulations XStyleSimulations?

The style simulations.

XFont(XTypeface, double, XPdfFontOptions?, XStyleSimulations?)

Initializes a new instance of the XFont class. Not yet implemented.

[Obsolete("Not yet implemented.")]
public XFont(XTypeface typeface, double emSize, XPdfFontOptions? pdfOptions = null, XStyleSimulations? styleSimulations = null)

Parameters

typeface XTypeface

The typeface.

emSize double

The em size.

pdfOptions XPdfFontOptions

The PDF options.

styleSimulations XStyleSimulations?

The style simulations.

Exceptions

NotImplementedException

XFont

XFont(string, double)

Initializes a new instance of the XFont class.

public XFont(string familyName, double emSize)

Parameters

familyName string

Name of the font family.

emSize double

The em size.

XFont(string, double, XFontStyle, XFontWeight, XFontStretch, XPdfFontOptions?, XStyleSimulations?)

Initializes a new instance of the XFont class. Not yet implemented.

[Obsolete("Not yet implemented.")]
public XFont(string familyName, double emSize, XFontStyle style, XFontWeight weight, XFontStretch fontStretch, XPdfFontOptions? pdfOptions = null, XStyleSimulations? styleSimulations = null)

Parameters

familyName string

Name of the family.

emSize double

The em size.

style XFontStyle

The style.

weight XFontWeight

The weight.

fontStretch XFontStretch

The font stretch.

pdfOptions XPdfFontOptions

The PDF options.

styleSimulations XStyleSimulations?

The style simulations.

Exceptions

NotImplementedException

XFont

XFont(string, double, XFontStyleEx)

Initializes a new instance of the XFont class.

public XFont(string familyName, double emSize, XFontStyleEx style)

Parameters

familyName string

Name of the font family.

emSize double

The em size.

style XFontStyleEx

The font style.

XFont(string, double, XFontStyleEx, XPdfFontOptions)

Initializes a new instance of the XFont class.

public XFont(string familyName, double emSize, XFontStyleEx style, XPdfFontOptions pdfOptions)

Parameters

familyName string

Name of the font family.

emSize double

The em size.

style XFontStyleEx

The font style.

pdfOptions XPdfFontOptions

Additional PDF options.

Properties

Bold

Indicates whether this XFont object is bold.

public bool Bold { get; }

Property Value

bool

CellAscent

Gets the cell ascent, the area above the base line that is used by the font.

public int CellAscent { get; }

Property Value

int

CellDescent

Gets the cell descent, the area below the base line that is used by the font.

public int CellDescent { get; }

Property Value

int

CellSpace

Gets the cell space for the font. The CellSpace is the line spacing, the sum of CellAscent and CellDescent and optionally some extra space.

public int CellSpace { get; }

Property Value

int

FontFamily

Gets the XFontFamily object associated with this XFont object.

[Browsable(false)]
public XFontFamily FontFamily { get; }

Property Value

XFontFamily

Height

Gets the line spacing of this font.

[Browsable(false)]
public int Height { get; }

Property Value

int

IsSymbolFont

Indicates whether this XFont object is a symbol font.

public bool IsSymbolFont { get; }

Property Value

bool

Italic

Indicates whether this XFont object is italic.

public bool Italic { get; }

Property Value

bool

Metrics

Gets the font metrics.

public XFontMetrics Metrics { get; }

Property Value

XFontMetrics

The metrics.

Name

WRONG: Gets the face name of this Font object. Indeed, it returns the font family name.

public string Name { get; }

Property Value

string

PdfOptions

Gets the PDF options of the font.

public XPdfFontOptions PdfOptions { get; }

Property Value

XPdfFontOptions

Size

Gets the em-size of this font measured in the unit of this font object.

public double Size { get; }

Property Value

double

Strikeout

Indicates whether this XFont object is stroke out.

public bool Strikeout { get; }

Property Value

bool

Style

Gets style information for this Font object.

[Browsable(false)]
public XFontStyleEx Style { get; }

Property Value

XFontStyleEx

Underline

Indicates whether this XFont object is underlined.

public bool Underline { get; }

Property Value

bool

Methods

GetHeight()

Returns the line spacing, in pixels, of this font. The line spacing is the vertical distance between the base lines of two consecutive lines of text. Thus, the line spacing includes the blank space between lines along with the height of the character itself.

public double GetHeight()

Returns

double

GetHeight(XGraphics)

Returns the line spacing, in the current unit of a specified Graphics object, of this font. The line spacing is the vertical distance between the base lines of two consecutive lines of text. Thus, the line spacing includes the blank space between lines along with the height of

[Obsolete("Use GetHeight() without parameter.")]
public double GetHeight(XGraphics graphics)

Parameters

graphics XGraphics

Returns

double