Table of Contents

Enum SubsetFormat

Namespace
Egami.Fonts
Assembly
Egami.Fonts.dll

What FontSubsetter writes.

public enum SubsetFormat

Fields

Auto = 0

The input's own kind: TrueType for 'glyf' faces, OpenType CFF for CFF faces, bare CFF for a bare CFF face.

BareCff = 3

A bare CID-keyed CFF stream with an identity charset (CID = new glyph id), as PDF embeds for CIDFontType0C. Needs CFF outlines.

OpenTypeCff = 2

An OpenType font with a CFF table (.otf), as PDF embeds in FontFile3 with subtype OpenType. Needs CFF outlines.

TrueType = 1

A TrueType font (.ttf), as PDF embeds in FontFile2. Needs a face with TrueType outlines.

Examples

// Keep only the glyphs a page uses, as a PDF writer embeds them: renumbered from 0, with the map to write the text with.
GlyphRun run = new Font(face, 12).Shape("Invoice 2026-10");
FontSubset subset = FontSubsetter.Subset(face, run.Glyphs.ToArray(), new SubsetOptions
{
    FontNamePrefix = "ABCDEF+",
    KeepCmap = false,
});
byte[] fontFile2 = subset.Data.ToArray();
ushort first = subset.GlyphMap[run.Glyphs[0]];

// The face's embedding permissions are reported, never enforced: the writer decides.
bool restricted = face.Embedding.HasFlag(FontEmbedding.Restricted);