Method FromBytes

Namespace
SoftZenPdf
Assembly
SoftZenPdf.dll

FromBytes(byte[])

Loads a TrueType font from memory; for a collection, the first font in it.

public static TrueTypeFont FromBytes(byte[] data)

Parameters

data byte[]

The font file's bytes. They are copied, so the array may be reused afterwards.

Returns

TrueTypeFont

The font.

Exceptions

NotSupportedException

The font has CFF outlines, or its licence forbids embedding or subsetting.

InvalidDataException

The data is not a valid TrueType font.

FromBytes(byte[], int)

Loads one font of a TrueType collection from memory.

public static TrueTypeFont FromBytes(byte[] data, int collectionIndex)

Parameters

data byte[]

The file's bytes. They are copied, so the array may be reused afterwards.

collectionIndex int

Which font of the collection to load, from 0.

Returns

TrueTypeFont

The font.

Exceptions

ArgumentOutOfRangeException

collectionIndex is not a font of the data.

NotSupportedException

The font has CFF outlines, or its licence forbids embedding or subsetting.

InvalidDataException

The data is not a valid TrueType font or collection.