Selected-axis colour glyphs and static outlines

Version 2.1112.0 retains selected-axis solid and colour-stop alpha in the appended AlphaValue: Double and HasAlphaValue: Boolean fields on THPDFCOLRv1Paint and THPDFCOLRv1ColorStop. Alpha variation is applied and clamped without an intermediate Single conversion before combination with CPAL alpha, or foreground alpha for palette entry 0xFFFF

Read normalised combined opacity through HPDFCOLRv1PaintAlpha and HPDFCOLRv1ColorStopAlpha from HPDFOpenTypeAdvanced; do not apply palette or foreground alpha a second time. The existing Alpha: Byte output retains its earlier conversion, and HasAlphaValue False makes the getter return Alpha / 255

The added tail fields change both record sizes, so recompile clients and zero-initialise caller-created records before populating them. This runtime precision extension does not change static F2DOT14 encoding limits, existing 16-bit sampled-gradient output, Single angular-phase calculations or retained reader colour and sampling differences

Version 2.1102.1 tries an equivalent zero-to-one parameter domain for close-stop linear and radial pad gradients only after every original positive-width interval remains strictly increasing in both the wide calculation and Single reader parameter space. A failed check retains the original authored positions and domain without mutation; repeated offsets remain legal hard stops, and colour/alpha surfaces share the same decision

The four original close-stop pairs pass all 72 checks and 192 reader samples, fixing the retained MuPDF endpoint from error 7 to 0 without new failures. Six further native profiles pass 81 checks, including a reachable seven-axis 2^-100 interval and asymmetric radial-tip adjacent-Single bounds. Nine natural-domain bare-reference differences remain recorded separately; this is not unrestricted reader conformance

Version 2.1102.0 adds ordinary native CFF2 text and portable CFF1 font embedding. Registered names select the frozen font bytes directly; cmap and hmtx supply glyphs and metrics, with per-font BMP/SMP mappings and a CIDFontType0C stream retaining all original glyph slots

The 2026-10-23 contour audit excludes 324 white-to-white samples from the historical 2.1098.0 CFF2 source/reference/provider comparison; those images did not establish visible glyph contours. The six other pairs retain 1944 samples. A fresh isolated-process CFF2 selection and authoritative-provider control now passes 189 checks and 324 samples against independent TrueType geometry, including visible interior ink, gradients and zero raster callbacks; the original historical receipts remain unchanged

Version 2.1101.0 adds native CFF2 contour fills and clips, a public outline-command extractor and per-glyph mixed COLR lookup. A missing modern definition can use legacy layers in a version 1 table; an invalid selected modern graph remains rejected. The directory limit is independent of the single-graph budget

Version 2.1100.0 adds explicit COLR foreground colour and alpha through ColorGlyphForegroundColor and ColorGlyphForegroundAlpha, plus THPDFOpenTypeColorForeground overloads for both AtAxes inspection functions. Palette entry 0xFFFF resolves with foreground RGBA before the compatibility alpha byte is quantised; ordinary CPAL entries and the legacy black/255 defaults remain. Version 2.1112.0 also retains the combined opacity independently in the new Double fields

Version 2.1098.1 detects positive-width stop intervals that would merge during Single normalisation in pad linear or radial paints. Those paints retain authored parameter values through the PDF function bounds, shading domain and coordinates, with padding based on the authored span. Both colour and alpha surfaces use this path; ordinary paints keep their preceding output path

Four focused Delphi Win64 source/reference pairs pass all 72 domain, interval and output checks, against 24 baseline failures. They match 191/192 MuPDF/Poppler samples, fixing 95 baseline pixel failures without adding failures; one opaque-linear MuPDF endpoint remains different by 7. The radial baseline already matches these pixels, so its discriminating evidence is the repaired saved interval, not a claimed radial pixel repair. This does not establish unrestricted reader or numerical compatibility

Starting in version 2.1098.0, registered variable colour fonts retain their original colour instructions and resolved registration coordinates independently of the static outline font

RegisterUnicodeTTF first uses the existing complete static instance path; when COLR values cannot fit static fields, it instances the outlines without COLR and evaluates the original colour graph when inspecting or drawing a glyph. Selected negative radial radii, large translations and scales, and referenced clip boxes can therefore render without being truncated into static font fields

Axis-aware inspection

function HPDFGetCOLRColorGlyphAtAxes(const FontBytes: TBytes;
  GlyphID: Word; PaletteIndex: Integer;
  const AxisValues: THPDFVariableFontAxisValueArray;
  out Info: THPDFOpenTypeColorGlyphInfo): Boolean;

function HPDFGetOpenTypeColorGlyphAtAxes(const FontBytes: TBytes;
  GlyphID: Word; PaletteIndex, TargetPixelsPerEm: Integer;
  const AxisValues: THPDFVariableFontAxisValueArray;
  out Info: THPDFOpenTypeColorGlyphInfo): Boolean;

Both functions belong to HPDFOpenTypeAdvanced and accept original font bytes plus design-space axis values. Normalisation and avar mapping are applied internally. Omitted axes use their defaults; the existing inspection functions keep their signatures and use default coordinates

Unknown, duplicate, out-of-range and non-finite selections return False and clear Info. The general colour-format function rejects an invalid selection before considering SVG or bitmap fallback

Outline-only instancing

function HPDFInstantiateVariableFontOutlines(const FontBytes: TBytes;
  const AxisValues: THPDFVariableFontAxisValueArray;
  Control: THPDFVariableFontControl = nil): TBytes;

This function removes COLR from a separate sfnt composition, rebuilds checksums, then uses the existing TrueType or CFF2 instance engine for outlines, metrics and layout data. The original font is unchanged, glyph order is preserved, and an optional control object retains allocation, output-size and cancellation checks

The returned font is an outline font, so callers retain the original bytes and selected coordinates separately when they need colour glyphs. Existing full-font instancing functions keep their static colour-field limits and do not silently change their output contract

Registration and callbacks

PDF.SetVariableFontAxis('wght', 650);
PDF.RegisterUnicodeTTF(FontPath);
PDF.GetRegisteredColorGlyphInfo($41, 0, 96, Info);

GetRegisteredColorGlyphInfo uses the coordinates captured by registration. Later pending-axis edits or ClearVariableFontAxes affect a future registration, not the current colour program. Registered paint values retain their evaluated precision instead of being rounded through static font fields

A handled OnVariableFontInstance provider remains authoritative: the returned static font supplies both outlines and colour instructions. A document reset clears retained colour bytes and coordinates

OnColorGlyphRasterize continues receiving a complete static colour font when available. For an outline-only instance, it receives the original colour font; query GetRegisteredVariableFontAxes for the registered selection and use an AtAxes inspection function when the callback font still contains fvar

Verified scope and remaining limits

Focused Delphi Win64 controls render seven source/reference pairs covering TrueType gvar outlines, CFF2, avar, negative radii, translations of 40000, scale 4 and referenced clips beyond FWORD. Separate controls exercise both raster-callback byte contracts. Version 2.1099.0 uses PDF/X-1a only around the callback probe drawing because mode 9 now renders natively in ordinary output; this guard is not complete PDF/X acceptance

Finite native coordinate, graph, paint-budget and reader limits still apply. All parsed Porter-Duff modes have native paths within the documented transparency profile; unrestricted real-font and reader compatibility remain separate work. Two fractional registered-paint controls retain values that differ from their earlier quantised static references. Independent full-precision bare PDFs using padded domains match all 216 samples; equivalent natural-domain encodings retain nine reader differences. Their historical failure records remain unchanged, and broader reader precision remains separate work

See COLRv1 paint graphs, advanced OpenType fonts and OnColorGlyphRasterize