Method Subset
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
fontProgramReadOnlyMemory<byte>An OTF, an OTC face or a bare CFF program.
sourceNamestringA source identifier used in diagnostics.
usedGlyphIdsIReadOnlyCollection<int>The glyph ids to keep; glyph 0 is always kept.
subsetFontNamestringThe PostScript name to write into the subset's Name INDEX.
faceIndexintThe face index inside a collection; zero for a single-face font.
diagnosticsIConversionDiagnosticsThe 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.