Class CffFontWriter
Serialises a CffFont back to a binary sfnt/CFF stream.
For OTF/CFF fonts (loaded from an sfnt container with the "CFF " table) the sfnt frame is rebuilt from the raw table bytes stored at load time, with the original "CFF " bytes re-inserted.
Standalone raw CFF files are written back as-is without an sfnt wrapper.
Inherited Members
Namespace: DRIT.Drawing.Font.Cff
Assembly: DRIT.Drawing.dll
Syntax
public static class CffFontWriter
Methods
Write(CffFont, Stream)
Serialises font and writes the result to
stream.
Declaration
public static void Write(CffFont font, Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CffFont | font | |
| Stream | stream |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Either argument is null. |
| NotSupportedException | Thrown for standalone (non-sfnt) CFF files where round-trip serialisation is not yet supported. |
WriteToBytes(CffFont)
Serialises font and returns the resulting bytes.
Declaration
public static byte[] WriteToBytes(CffFont font)
Parameters
| Type | Name | Description |
|---|---|---|
| CffFont | font |
Returns
| Type | Description |
|---|---|
| byte[] |