Table of Contents

Method Subset

Namespace
DocWright.Fonts
Assembly
DocWright.Fonts.dll

Subset(ReadOnlyMemory<byte>, string, IReadOnlyCollection<int>, string, int, IConversionDiagnostics?)

Subsets one font program.

public static CffSubsetResult Subset(ReadOnlyMemory<byte> fontProgram, string sourceName, IReadOnlyCollection<int> usedGlyphIds, string subsetFontName, int faceIndex = 0, IConversionDiagnostics? diagnostics = null)

Parameters

fontProgram ReadOnlyMemory<byte>

An OTF, an OTC face or a bare CFF program.

sourceName string

A source identifier used in diagnostics.

usedGlyphIds IReadOnlyCollection<int>

The glyph ids to keep; glyph 0 is always kept.

subsetFontName string

The PostScript name to write into the subset's Name INDEX.

faceIndex int

The face index inside a collection; zero for a single-face font.

diagnostics IConversionDiagnostics

The diagnostics sink, or null to discard diagnostics.

Returns

CffSubsetResult

The subsetted program and its glyph map.

Exceptions

ArgumentNullException

A required argument is null.

FormatException

The source program is malformed or is not CFF.