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
databyte[]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
databyte[]The file's bytes. They are copied, so the array may be reused afterwards.
collectionIndexintWhich font of the collection to load, from 0.
Returns
- TrueTypeFont
The font.
Exceptions
- ArgumentOutOfRangeException
collectionIndexis 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.