OpenType CFF2 default-instance appearances
Native plain, rich, shaped, and family appearance builders accept a complete OpenType OTTO font containing CFF2 outlines at its default variation coordinates
The original font remains the source of Unicode character mapping, glyph indices, horizontal advances, and shaping; HarfBuzz resolves its default-instance outlines, including outlines selected through multiple font dictionaries
The builder converts every glyph into a static CID-keyed CFF 1 program and embeds it as FontFile3 with Subtype CIDFontType0C, an Adobe Identity collection, and CIDs equal to the original glyph indices
The generated encoding, widths, and ToUnicode mapping retain the original glyph identity and logical Unicode sequences, including supplementary characters, ligatures, and combining marks
This produces a PDF 1.7 font program using the CFF 1 structures described by ISO 32000-1:2008 9.7 and 9.9; it does not embed CFF2 directly in a PDF font stream
A matching-architecture HarfBuzz library exposing hb_font_draw_glyph and immutable draw callbacks is required, including for unshaped text; these APIs are available from HarfBuzz 7, and HOTPDF_HARFBUZZ_LIBRARY selects an explicit library
Complex shaping also uses the existing FriBidi dependency and the existing scale-1000 integer-advance contract; ideal unquantized advances at the original unitsPerEm are a separate precision limitation
Editable appearances require installable or editable embedding permission; read-only appearance generation permits preview-and-print permission, while restricted and bitmap-only permission remain rejected
No-subsetting retains every original glyph in the converted program, including unused glyphs; conversion changes the font-program format and does not promise byte-for-byte retention of the original OpenType container
The converted program uses a distinct primary name and retains readable copyright and license notices plus the original name-table bytes
Source-font, working-buffer, complete-font layout, object-size, rich-font aggregate, cancellation, and native rendering bounds are checked before publication; malformed missing glyph programs remain errors while valid empty glyphs are retained
The Type 2 output has 16.16 coordinate precision and bounded operand deltas, at most 65,535 glyphs, and at most 65,535 bytes per glyph program
Standalone raw CFF2 tables, direct CFF2 font streams in existing PDF default-appearance resources, nondefault variation-axis selection, and broader complex-text layout are outside this backend
Existing CFF 1 OpenType input continues to use the compact appearance backend, while embedded Type1, Type1C, and CIDFontType0C annotation resources use the original raw-font fallback
TryGetCFF2FontTable is a bounded format-capability query, rather than full outline or permission validation