Composite Font Glyph Sources

Fonts, Content editing, Unicode

Description

Native rendering and exact editing select actual glyphs from external CFF1, CFF2, TrueType and CID-keyed collection programs, following predefined character encodings, Unicode variation sequences, shaped multi-scalar sequences and variable-font instances, and falling back to an explicit notdef or CID-zero glyph when a CID has no glyph. Read it when a composite font resolves to the wrong glyph, or when replacement rejects a substitution source, cache or variable-font configuration.

Qualified external sfnt sources

External Type 2 CIDFonts can use a qualified standalone or selected collection sfnt program with TrueType or CFF1 outlines selected by the native font loader with a supported named predefined CMap. Direct Unicode source encodings are UCS-2, UTF-8, UTF-16BE and UTF-32BE; their byte widths and Unicode scalar boundaries are checked independently of ToUnicode

An external Type 2 CIDFont whose Encoding is Identity-H, Identity-V or a custom CMap uses the character-collection route below when its descendant names a supported Adobe collection, because the descendant then gives the CIDs their meaning. Rendering, text-to-path output and exact replacement select the same collection glyph. A descendant with the Adobe-Identity collection gives the CIDs no meaning in a substitute font, so its glyphs remain unqualified

Glyph selection uses the selected font program's Unicode cmap and actual glyph count. CIDToGIDMap does not select glyphs in this external-font path. The original CMap CID still selects W, DW, W2 and DW2 metrics, and source-byte spacing rules remain unchanged

The bounded font reader supports base Unicode cmap formats 0, 4, 6, 10, 12 and 13 and fixes one base subtable for the font. It does not combine missing characters from different base subtables. Selected TrueType glyphs and their composite dependencies undergo the same bounded geometry checks used for embedded exact-edit sources. CFF1 glyphs use the bounded CFF index and Type 2 program validator; their CharStrings count must agree with maxp

Known missing or invalid codes display the verified glyph zero without fabricating Unicode correspondence. Exact replacements require strict source decoding and a non-notdef glyph for every used character

Planning retains the actual font program, glyph index reader, parser reload generation, requested and selected face indices, table-offset state and rasterizer identity. Commit checks revalidate source bytes and cache state. Retained source and validation data participate in the transaction byte budget

TrueType- or CFF1-outlined TTC version 1 and 2 sources and selected sfnt blocks with a container offset bias are normalized to an independent face for qualification. Table offsets, directory overlaps and byte limits are checked, selected-face table sharing is retained, signatures are removed and output checksums are recomputed. Original container bytes, face state and offset bias remain part of commit checks. Traditional encodings outside the supported character-collection route, general multi-scalar mappings and remaining variation cases, unqualified Identity substitutions, unsupported or non-default CFF2 instances and remaining Windows direct-font paths retain separate qualification boundaries. It does not establish complete shaping, variation-axis interpolation or general font-conformance support

On Windows, native CJK font selection for supported named Unicode or traditional CMaps can retain the selected sfnt program instead of requiring the direct drawing route. The selected face is then subject to the same glyph and transaction checks; unavailable or unsupported programs do not acquire exact-edit eligibility

CFF1 substitution programs

External Type 2 CIDFonts may use an OpenType/CFF1 substitution source with a verified Unicode cmap. The selected GID addresses the CFF CharStrings INDEX directly; a CID-keyed CFF charset is used only to identify that selected program in the native decoder, without substituting a PDF metric CID for the selected GID

Both name-keyed and CID-keyed CFF1 sources retain bounded structure and selected-program checks, including local and global subroutines. Native drawing checks the decoder source digest, glyph count, CFF flavor and selected CharStrings identity, and discards its CFF decoder when the sfnt parser reloads

All six CFF FontMatrix coefficients are applied to cached glyph geometry in 1000-unit PDF glyph space, including rotation, nonuniform scaling, shear and translation. These glyph transforms do not rescale PDF CID widths, character spacing, text rise or vertical origins. Outline conversion retains eight decimal places for fractional glyph coordinates

For CID-keyed CFF1, FDSelect chooses the Font DICT matrix for each glyph. A Font DICT without a matrix inherits the Top DICT matrix; an explicit Font DICT matrix is used directly when the Top DICT omits its matrix, or is composed before the explicit Top DICT matrix when both are present. Name-keyed CFF1 uses the Top DICT matrix, with the standard 0.001 diagonal default when it is absent

The bounded CFF reader retains the effective matrix for each font dictionary and checks finite coefficients after composition and normalization. Native drawing snapshots the selected matrix by glyph index, so cached decoding and seac component lookup cannot change the root glyph's matrix. A reload discards both matrix and geometry caches

This Unicode-based route supports CFF1 substitution for external Type 2 fonts. External Type 0 fonts follow the character-collection rules below; complete shaping remains a separate qualification

Supported external CFF2 sources

A supported external selected CFF2 program can supply a normalized static CFF1 view. A variable CFF2 source uses its default instance unless a named instance or the font descriptor selects other coordinates, as described under variable substitute fonts; a static CFF2 source needs no fvar axis table. Unicode and supported character-collection substitution use the view's preserved cmap and glyph order; the view must retain the original parser's glyph count, and every used static glyph undergoes bounded CFF1 Type 2 validation

Rendering and qualification use the same normalization. Standalone fonts and selected TTC faces retain their original bytes, requested and selected face, offset bias and parser generation for source checks. Reloading the parser discards the native CFF decoder and geometry cache

The converter emits an Identity charset to address its static glyph indices. That generated charset does not declare the original CFF2 source's Registry or Ordering, and cannot establish native CID-collection matching or unqualified Identity semantics. Type 0 substitution still requires a supported bound character collection and actual Unicode cmap coverage

Both the selected source and the retained static view are limited to 64 MiB and participate in existing retained-source accounting. Unsupported conversion cases, inconsistent or missing required variation metadata, non-default axes and direct embedded CFF2 qualification remain separate boundaries. This rendering route does not establish PDF embedding conformance

Static CFF2 is accepted only through the explicit CFF2 conversion route. Ordinary variable-font discovery still requires valid axes. A static source cannot declare a VariationStore or dependent variation metrics, and vsindex or blend operations cannot invent missing variation data

Long CFF2 drawing operations are split into equivalent CFF1 operations rather than weakening the CFF1 operand-stack check. Splitting retains alternating line and curve directions, optional coordinates, the final line or curve of mixed operators and room for an initial width operand

Source rules follow the OpenType CFF2 specification, including omission of VariationStore for fonts without Font Variations

External Type 0 character collections

An external CID-keyed CFF1 program whose Registry and Ordering match the bound descendant CIDFont selects the CMap CID through its actual CFF charset and then selects that CharStrings GID. CID and GID may differ. This route does not require a Unicode cmap in the selected program, and it supports qualified custom CMaps and compatible Identity mappings

When a system substitution does not supply that CID collection directly, supported Adobe Japan1, GB1, CNS1, Korea1 and KR collection resources can translate the bound descendant CID to one Unicode scalar, a declared base-plus-selector variation sequence, or a qualified shaped sequence and select an actual TrueType or CFF1 glyph. The original source bytes and ToUnicode values do not substitute for that collection identity. Custom CMaps use the same bound descendant collection checks

A missing normal CID may select an explicit CMap notdef CID or verified glyph zero for display. The selected glyph CID and GID remain separate from the original PDF metric CID. Exact edits require non-notdef coverage for both original and replacement text; an unsupported collection or unqualified Identity substitution does not gain eligibility by guessing numeric GIDs or Unicode values

Windows Type 0 loading retains the selected sfnt program even when a custom CMap omits CMapName and can request PostScript outlines when multiple outline formats share a family name. Qualification always examines the actual returned program. Horizontal and vertical layouts, shared Form editing, save/reload and outline conversion retain the same source checks and PDF metrics

Identity rendering compatibility does not establish PDF 2.0 file conformance, which imposes separate embedding requirements. General Type 0 multi-scalar substitutions, unqualified variation cases, unsupported CFF2 instances and unsupported collection resources remain outside this qualification

Traditional predefined character encodings

Supported traditional predefined CMaps use bundled Adobe character-collection Unicode resources for Japan1, GB1, CNS1 and Korea1. Representative routes include 90ms-RKSJ, GBK-EUC, B5pc and KSC-EUC, in horizontal and vertical writing modes

Translation starts from the original character code and byte width in the verified named CMap. Its collection selector is used only to translate that predefined encoding into Unicode; it is never treated as a glyph index in the selected external font. The decoded metric CID, CIDToGIDMap and ToUnicode text do not override glyph selection

The collection table retains a fixed 65536-entry scalar index and allocates a separate selector index when variation sequences are present. Decoding and parsing use the existing bounded Unicode-map limits, and retained index bytes participate in the exact transaction budget. The source Encoding CMap remains part of the commit-time checks

A mapping may produce one Unicode scalar, one base scalar followed by a recognized variation selector, or a sequence that meets the shaped-sequence requirements below. Supplementary scalars and selectors retain their complete UTF-16 representation. Unsupported multi-scalar translations and variation sequences without actual font coverage display known glyph zero and remain ineligible for exact replacement

PDF W, DW, W2, DW2 and source-byte word spacing continue to use their original identities, including when several character codes translate to the same Unicode scalar

Declared Unicode variation sequences

A Unicode cmap format 14 subtable at platform 0, encoding 5 supplements the font's selected base Unicode subtable. Default variation sequences use that same base subtable; nondefault sequences use their explicit glyph index and may have no base-character mapping. An absent sequence does not gain coverage from the base character alone: in the bundled collection resources a variation sequence names a non-default glyph form, so the base glyph would show a different form. A rejected replacement names the collection CID and the sequence the selected font does not declare

For external character-collection substitution, one PDF source code may select a collection CID whose verified Unicode resource supplies a base-plus-selector pair. The actual selected TrueType or CFF1 program must declare that pair in format 14. Direct CID-keyed CFF sources continue to select their collection CID through the charset

Source bytes, PDF metric CIDs and selected glyph indices remain independent. Rendering, horizontal and vertical exact edits, shared Form ownership and saved outlines retain the existing source checks. A whole source glyph can be replaced; a query that isolates only part of its Unicode variation sequence rejects without changing content

The reader checks selector order and identity, scalar ranges, default and nondefault partitioning, glyph bounds and data-table regions. Data blocks may share storage when every referenced structure remains valid within its bounds; identical compatible blocks reuse validation. Qualification recognizes the Unicode Variation_Selector property, including Mongolian free selectors, and retains the existing work and source-byte budgets

This qualification covers declared variation sequences associated with one collection CID. General multi-character shaping and remaining source correspondence remain separate capabilities

Variation rules follow the OpenType cmap format 14 specification and the Unicode Variation_Selector property

Shaped collection sequences

A collection CID may represent multiple Unicode scalars, such as a Japanese kana followed by a combining mark or the letters in a unit abbreviation. A qualified external TrueType or CFF1 source can select the resulting glyph group when every input has a nonzero glyph in the font's selected base cmap and native OpenType shaping produces non-notdef glyphs within that program

Each glyph retains its horizontal and vertical offsets, and subsequent glyph positions accumulate both shaping advances in 1000-unit glyph space. Every output glyph undergoes the selected program's bounded geometry validation. The original PDF CID determines the group's final text displacement and vertical origin; shaping advances only position glyphs inside that source character

The native engine uses default shaping features with left-to-right collection text. Sequence qualification requires the native provider and does not use the permissive Pascal shaping fallback. Variation selectors continue through the separate declared format-14 route. Missing input coverage, out-of-range glyphs and malformed or nonmonotonic source clusters reject sequence qualification. A rejected replacement names the collection CID, its complete Unicode sequence and the first reason, such as a combining mark that the selected font does not cover

The optional native pl_ot_shape_2d export supplies both advances without changing the original pl_ot_shape or subsetting ABI. A provider without the new export retains the earlier single-glyph, zero-offset route; it cannot qualify positioned or multiple-glyph groups through the legacy interface

To retain base-cmap exclusivity, shaping uses an owned font view exposing only the same selected base subtable. Its table checksums are recomputed while the original font bytes and glyph programs remain unchanged. This prevents the engine's encoding-record priorities from silently selecting another cmap

Rendering, horizontal and vertical PDF writing modes, whole-source-character replacement, following-text anchors, shared Forms, save/reload and text-to-path output retain the existing source checks. A query that isolates only part of that source character's Unicode sequence rejects without changing content. PDF character and word spacing apply once to the source code rather than once to each output glyph

Input is limited to 64 UTF-16 code units and 32 scalars, and output to 256 glyphs. Sequence selection is cached per collection CID, returned placements cannot modify the retained cache, and retained glyph groups, text, slot indexes and the lazily prepared font view participate in the transaction source budget. Context across independent PDF characters, general direction or language control and remaining source correspondence remain separate capabilities

Variable substitute fonts

When an installed variable font substitutes for an unembedded font, its axis coordinates come from the request in this order. A face name or Fontconfig match that names a non-default named instance, such as "Bahnschrift SemiBold", selects that instance. Otherwise the font descriptor selects the coordinates: FontWeight on the wght axis, FontStretch on the wdth axis using the OpenType width percentages from 50 for UltraCondensed to 200 for UltraExpanded, a nonzero ItalicAngle on the slnt axis, and the Italic flag on the ital axis

Only axes the font declares take part, and each value is clamped to its axis range. When every resulting coordinate equals the default, the font is drawn from its default instance unchanged. Otherwise a static instance of the TrueType or CFF2 source is built, and rendering, text-to-path output and exact replacement qualification all use that same static program

Verified embedded TrueType glyphs

Exact replacement separates character bytes, CIDs, and glyph indices. The verified Encoding CMap supplies the CID; an embedded CIDFontType2 program uses CIDToGIDMap to select its glyph

CIDToGIDMap may be Identity or a stream of complete two-byte, big-endian glyph indices. A used CID must be covered by the stream, and its glyph index must be nonzero and within the embedded program's glyph range

Missing pairs do not fall back to the CID as a glyph index, and a notdef glyph cannot establish exact glyph coverage

Qualification checks bounded SFNT directories and required head, maxp, hhea, hmtx, loca, and glyf tables, monotonic glyph locations, and the used simple or composite glyph records. Composite references must remain in range, avoid cycles, and have valid point indices and bounded depth

Empty glyph records and zero-contour headers with a nonzero glyph index remain valid, allowing intentional blank or spacing glyphs. Phantom points are valid component attachment targets after the first component. These checks establish glyph selection and record bounds; they do not execute font hints or replace a general font sanitizer

Short loca entries encode offsets divided by two; long loca entries are actual byte offsets and may be odd. Both formats retain monotonicity and table-bound checks, while used records still undergo complete simple or composite glyph validation. This distinction applies to embedded programs and qualified external TrueType sources

Glyph-record and location rules follow the OpenType glyf specification and OpenType loca specification

Verified embedded CFF glyphs

An embedded CIDFontType0 FontFile3 with subtype CIDFontType0C or OpenType can establish used glyph coverage through a bounded CFF1 index and Type 2 program verification

For a CID-keyed program, the charset maps the CID to its physical glyph index. For a name-keyed CFF program, the CID directly identifies that index. CIDToGIDMap does not select CFF glyphs, and a missing CID never falls back to an unrelated glyph with the same numeric index

Used glyphs must have a nonzero index and a verified charstring. Verification follows the glyph's FDSelect for local subroutines and checks operand arities, stack operations, stem declarations, mask bytes, arithmetic, transient storage, subroutine bias and control flow, and terminal operators

Deprecated seac composition resolves StandardEncoding component names in name-keyed fonts and rejects missing, cyclic, or nested components. Unknown dynamic values may be used as drawing operands, but cannot establish a subroutine, storage, stack-control, or component index

These checks establish glyph selection and bounded program structure. They do not execute hints, certify outline appearance or every font dictionary value, or replace a general font sanitizer. CFF2 programs are outside this qualification

CFF and Type 2 rules follow the CFF specification and Type 2 specification

Native glyph fallback and editing

Native embedded-font rendering and qualified external Type 0 rendering can select an explicit notdef glyph or CID zero when the normal CID is missing. It retains the original character mapping and metrics separately from the selected glyph

Rendering a fallback does not authorize an exact edit of missing original glyphs. Transaction qualification still checks actual original and replacement glyph coverage and retains its source and native-cache checks

Additional vertical exact editing

Existing Identity-V exact editing remains supported. Additional verified vertical Encoding CMaps are eligible when an embedded TrueType program and CIDToGIDMap, an embedded CFF1 program, or a qualified external TrueType or CFF1 source pass glyph qualification for both original and replacement text

The CMap's verified WMode controls writing direction independently of its name. Complete one-to-four-byte source codes retain their own Unicode mappings, and DW2/W2 metrics determine displacement and vertical origin vectors

Exact edits retain following-text anchors across supported TJ adjustments, character and word spacing, text rise, horizontal scaling, shared Form invocations, and save/reload

Sources and native caches

Before glyph qualification, verified Encoding CMaps bind to the descendant CIDFont character collection. Declared Registry and Ordering values must agree, Supplement may differ, and Identity-H and Identity-V accept all valid descendant collections

Transactions retain used font identity and CIDSystemInfo fields, font descriptor references and relevant values, embedded program references and decoded bytes, stream dictionaries, and embedded CIDToGIDMap references and bytes; qualified external sources additionally retain the actual selected program and parser state

Before commit, source objects and used native glyph mappings must still agree. Native TrueType parsers compare their retained source bytes with the verified embedded program, including when the rasterizer does not keep a separate FontData string. Native CFF decoders retain a SHA-256 digest and source length, clear decoded glyph caches on reload, and recheck CID/name-keyed selection against the verified index

Encoding CMap metadata and its dictionary and indirect-reference identities are also retained and rechecked. A changed descriptor, program, map, or native cache rejects the transaction without committing selected page content and resource roots. Independently made font changes are retained

Limits and remaining boundaries

Each captured font program is limited to 64 MiB, CIDToGIDMap data to 131072 bytes, SFNT tables to 4096, glyph-component depth to 32, and glyph-validation work to 16777216 steps. CFF Type 2 limits include 48 operand slots, 32 transient elements, 96 stems, 10 nested subroutine calls, and 65535 bytes per charstring or subroutine. Retained source, index, and used-glyph data shares the existing 512 MiB transaction source budget

External sources outside the qualified selected sfnt and character-collection routes do not gain additional vertical exact-edit eligibility. Existing supported paths retain source checks, without a claim of complete glyph coverage

For a non-embedded CIDFontType2, ISO 32000-2 section 9.7.4.2 defines glyph selection through predefined encodings rather than embedded-font glyph indices. Embedded qualification does not substitute Unicode values or system-font glyph indices for missing embedded CIDToGIDMap entries; external qualification follows the separate selected-font route described above