Table of Contents

Class FontCollection

Namespace
EvoPdf
Assembly
evohtmltopdf.dll

Represents a collection of fonts in a PDF document.

[ClassInterface(ClassInterfaceType.AutoDual)]
public class FontCollection : IEnumerable
Inheritance
FontCollection
Implements
Inherited Members

Constructors

FontCollection(Document)

Creates a font collection for the specified PDF document

public FontCollection(Document document)

Parameters

document Document

The parent document of the fonts collection

Properties

this[int]

Gets the font from the specified index.

public PdfFont this[int fontIndex] { get; }

Parameters

fontIndex int

Property Value

PdfFont

Methods

Add(PdfFont)

Adds a PDF font to the fonts collection. If the font was already added the method returns the existing font.

public PdfFont Add(PdfFont font)

Parameters

font PdfFont

Font object to add to the collection.

Returns

PdfFont

Added to the collection font.

Add(StandardCJKFont)

Adds a standard CJK font to the collection. If the font was already added the method returns the existing font.

public PdfFont Add(StandardCJKFont stdCJKFont)

Parameters

stdCJKFont StandardCJKFont

The standard CJK font to add to the document fonts collection.

Returns

PdfFont

The CJK font added to the collection.

Add(StdFontBaseFamily)

Adds a standard font to the collection. If the font was already added the method returns the existing font.

public PdfFont Add(StdFontBaseFamily stdFont)

Parameters

stdFont StdFontBaseFamily

The standard font family.

Returns

PdfFont

The font added to the collection.

Add(byte[])

Adds a system font to the fonts collection. The font is created from the specified font data. If the font was already added the method returns the existing font.

public PdfFont Add(byte[] fontData)

Parameters

fontData byte[]

The data of the font to be added.

Returns

PdfFont

The font added to the collection.

Add(byte[], float, FontStyle)

Adds a system font to the fonts collection. The font is created from the specified font data with the specified style. If the font was already added the method returns the existing font.

public PdfFont Add(byte[] fontData, float fontSizePoints, FontStyle fontStyle)

Parameters

fontData byte[]

The data of the font to be added.

fontSizePoints float

The font size in points.

fontStyle FontStyle

The style of the font to be added.

Returns

PdfFont

The font added to the collection.

Add(Font)

Adds a system font to the fonts collection. If the font was already added the method returns the existing font.

public PdfFont Add(Font font)

Parameters

font Font

The font to be added to the collection.

Returns

PdfFont

The font added to the collection.

Add(Font, bool)

Adds a system font to the fonts collection. If the font was already added the method returns the existing font. The embedFont property says if the added font will be embedded into the PDF document

public PdfFont Add(Font font, bool embedFont)

Parameters

font Font

Font for adding.

embedFont bool

When true the font will be embedded in the PDF document.

Returns

PdfFont

The font added to the collection.

Add(string)

Adds a system font to the fonts collection. The font is created from the specified file. If the font was already added the method returns the existing font.

public PdfFont Add(string fontFilename)

Parameters

fontFilename string

The file name of the font to be added.

Returns

PdfFont

The font added to the collection.

Add(string, float, FontStyle)

Adds a system font to the fonts collection. The font is created from the specified file with the specified style. If the font was already added the method returns the existing font.

public PdfFont Add(string fontFilename, float fontSizePoints, FontStyle fontStyle)

Parameters

fontFilename string

The file name of the font to be added.

fontSizePoints float

The font size in points.

fontStyle FontStyle

The style of the font to be added.

Returns

PdfFont

The font added to the collection.

AddRange(PdfFont[])

Adds a set of fonts to the fonts collection.

public void AddRange(PdfFont[] fonts)

Parameters

fonts PdfFont[]

The set of fonts to be added.

Contains(PdfFont)

Checks if the specified font belongs to the fonts collection.

public bool Contains(PdfFont font)

Parameters

font PdfFont

Font to search.

Returns

bool

True if the font is found in the collection, otherwise returns false.

GetEnumerator()

Gets the collection enumerator.

public IEnumerator GetEnumerator()

Returns

IEnumerator

The collection enumerator.

IndexOf(PdfFont)

Returns the index of the specified font in the fonts collection.

public int IndexOf(PdfFont font)

Parameters

font PdfFont

The font to search in collection.

Returns

int

The index of font or -1 if the font does not exist.

Insert(int, PdfFont)

Inserts a font to the specified index in collection.

public void Insert(int index, PdfFont font)

Parameters

index int

Index in collection where to insert the font.

font PdfFont

The font to be inserted in the collection.

Remove(PdfFont)

Removes the specified font from the fonts collection.

public void Remove(PdfFont font)

Parameters

font PdfFont

The font to be removed from collection.