COLR v1 Paint Graphs
Version 2.1163.0 adds native thin periodic radial fields with mixed coverage, preserving actual registered source geometry, clipping, palette and opacity through bounded generation and transactional publication
Version 2.1104.1 adds exact finite clipping for partially visible polygon glyphs in transformed uniform chains, preserving nonzero winding, referenced and nested clips, known-empty coverage and caller state. Partial curves, nonuniform paint fields and retained boundary raster differences remain open
Version 2.1104.0 uses conservative TrueType/CFF2 outline coverage to emit transformed uniform paints directly in their actual finite root ClipBox when every intermediate clip covers it. This avoids large reader matrices without replacing partial coverage or general paint fields
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
The shared HPDFCOLRv1MaxPaintGraphDepth constant pins that budget at 96 graph levels: the COLRv1 reader walk and every THotPDF.DrawCOLRv1Graph walker agree on the same bound, so a graph the reader accepts never exceeds what a documented graph consumer may walk
Version 2.1100.0 adds explicit COLR foreground color and alpha through ColorGlyphForegroundColor and ColorGlyphForegroundAlpha, plus THPDFOpenTypeColorForeground overloads for both AtAxes inspection functions. Palette entry 0xFFFF resolves with foreground RGBA before local alpha is quantized; ordinary CPAL entries and the legacy black/255 defaults remain
Version 2.1099.0 adds native source-atop, destination-atop, xor and plus. Complete source and backdrop surfaces provide alpha masks, independent paint-entry Forms avoid shared mask/paint evaluation, and PDF blend arithmetic supplies alpha ratios and saturating premultiplied addition without bitmap glyph fallback. The finished root surface receives the caller state once
Atop bounds follow the surviving operand, allowing a finite result when the opposite operand is unbounded. These constructions require PDF 1.4 transparency; PDF/A-1, PDF/X-1a and PDF/X-3 request the existing raster callback instead. Strict-profile drawing guards do not establish complete profile acceptance
Thirty-two focused Delphi Win64 controls cover partial alpha, layers, varying-alpha gradients, nested xor, zero and opaque operands, caller opacity and distant no-ClipList bounds. Default and device-blend output pass all 556 native/structure checks with no image objects; 64 draws use no callback and four strict-profile guards retain fallback
Independent arithmetic matches 3864/4608 reader samples under an unchanged three-channel tolerance, repairing 2312 baseline failures without adding failures. Default MuPDF retains 409/1152 failures with maximum error 11, and default Poppler retains 316/1152 with maximum error 62. The existing device-blend option retains 19/1152 MuPDF failures with maximum error 4; Poppler passes all 1152 device-blend samples. Device-space arithmetic is a compatibility option, not a claim of normative linear-light equivalence; complete reader compatibility remains open
Version 2.1098.1 detects positive-width stop intervals that would merge during Single normalization 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 color 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
Version 2.1098.0 retains original variable color instructions and frozen registration coordinates independently of static outlines. The original receipt records seven native source/reference pairs, 354 checks and 2268 MuPDF/Poppler samples covering negative radii, real gvar outlines, CFF2, avar, translations of 40000, scale 4 and referenced clips beyond FWORD; its 324 blank CFF2 contour comparisons are excluded from painting claims by the later audit described above. Runtime graph, coordinate and paint budgets still apply
Registered paint metadata now preserves fractional evaluated values. The earlier 2.1097.0 acceptance remains a historical result: its verifier expects quantized static geometry and records twelve mismatches in two controls against the new runtime. All 25 static instance byte sequences remain identical, and 175 retained arithmetic/static checks pass; three of 216 comparisons with the older quantized reference images remain historical differences; later independent full-precision padded references match all 216 samples, while equivalent natural-domain encodings retain nine reader differences
Version 2.1097.0 evaluates all variable fields in PaintVarSolid, PaintVarLinearGradient, PaintVarRadialGradient, PaintVarSweepGradient, PaintVarTransform and the translate, scale, rotate and skew variants, plus VarColorStop offset and alpha. Default inspection and selected-axis TrueType/CFF2 instancing use normalized, avar-remapped coordinates and the COLR variation store
F2DOT14 and Fixed deltas are applied in their raw integer units before scaling; font-unit fields receive unscaled deltas. Paint alpha is clamped to [0, 1] before multiplication by CPAL alpha. Color stops are stably sorted after variation, with unquantized positions used before static encoding can merge distinct stops
Static instancing changes variable paint records to their corresponding static formats and appends independent static color lines and affine matrices. Shared source tables remain unchanged, so a reused matrix is not varied twice and a static alias retains its original values. Default inspection does not rewrite the input font
Static fields are rounded to the nearest encoded integer with halves toward positive infinity and must fit their target FWORD, UFWORD, F2DOT14 or Fixed range; new relative offsets must fit Offset24. Legal negative radial radii are retained during default inspection, but selected instances requiring negative UFWORD radii or other unrepresentable static values still fail conversion. Version 2.1098.0 renders selected-axis values through selected-axis color programs and static outlines without requiring static color-field encoding; the older complete static-font API retains its encoding limits
Focused Delphi Win64 acceptance records 26 controls and 1136 passing numerical, static-format and registered-font checks, against 380 failures on the preceding source. Twenty-five independently authored static reference fonts match all 2700 MuPDF/Poppler samples; this comparison does not establish unrestricted real-font or rasterizer conformance. The preceding ClipBox profile retains all 144 checks and all 512 pixel values, including its three known fractional-edge point failures
Version 2.1096.1 resolves format 2 ClipBox deltas at selected TrueType and CFF2 axis coordinates, after avar mapping. Default-font inspection also resolves default-instance deltas, including constant variation regions. Root and referenced color glyphs use the resulting bounds
Static instancing appends a format 1 ClipList while preserving original paint offsets, shared source data and variation stores that other paint records may still reference. Bounds are calculated in floating point, then minima are rounded down and maxima up under the OpenType ClipBox rules. A reversed rounded box remains a present empty clip
Index maps support both formats, last-entry reuse, identity outer/inner indices and no-variation sentinels. A missing variation store suppresses variation lookup; NULL item-variation-data offsets contribute zero. Invalid applicable variation data rejects the color graph instead of silently dropping a matched clip
Static format 1 coordinates must fit the signed 16-bit FWORD range; instancing fails instead of truncating an unrepresentable result. The ClipBox-only extension is followed by paint-field evaluation in version 2.1097.0; static encoding limits and unrestricted COLRv1 or real-font compatibility remain separate concerns
Focused Delphi Win64 acceptance covers 21 native controls and 144 passing metadata, font-byte and saved-form checks. Reader sampling passes 509 of 512 points; three fractional rectangle-edge point samples remain failed and reproduce identically in standalone PDFs with device or calibrated color, without changing sample positions or tolerance
Version 2.1096.0 accepts layer and supported composite graphs as in/out alpha-mask operands, including nested in/out masks, blend composites, varying-alpha gradients, shared references, glyph clips and affine transforms. Multi-surface masks capture the complete normally composited RGBA group and use its alpha, so a transparent upper layer preserves lower coverage and overlapping partial layers accumulate opacity
Complete masks use the Alpha soft-mask subtype; out masks attach an inverse transfer function to the soft-mask dictionary's TR entry, as defined in ISO 32000-1 sections 11.5.2 and 11.6.5.2. The captured group bounds include active parent coverage, retaining the survivor in blank mask areas after inversion. Simple paint fields retain their existing gray luminosity-mask path
This extension requires PDF 1.4 transparency; PDF/A-1, PDF/X-1a and PDF/X-3 retain their earlier fallback for multi-surface masks. Focused validation retains four Poppler right-edge pixel differences, independently reproduced by standalone PDFs without HotPDF, with unchanged sample coordinates and tolerance. Existing graph limits and other recorded reader differences remain; native atop, xor and plus follow in version 2.1099.0
Version 2.1095.4 renders a sweep as one solid fill when all resolved stop colors and alpha values are identical, including duplicate stop positions, pad, repeat and reflect modes. This avoids unnecessary triangular edges and applies constant opacity once. Existing transparent rules run first: periodic equal-angle sweeps and multiple-stop zero color periods still paint nothing. Different stop alpha values retain the varying-alpha surface path
Version 2.1095.3 uses the root ClipBox as the completed color-glyph Form's exact BBox. A Form BBox is an actual PDF clipping boundary, so sweep fans, inverse-transformed coverage, referenced glyphs and complete layer/composite surfaces cannot escape the authored rectangle. Conservative paint bounds still drive internal coverage and do not substitute for clipping
The page content stream receives no additional clipping or path-ending operators. Root rectangles that collapse after coordinate projection paint nothing, and graphs without a ClipBox retain their graph-derived finite coverage. This repair does not close the separately recorded sweep-sampling or reader path-handling differences
Version 2.1095.2 keeps intermediate alpha Forms ordinary and gives only the final DeviceGray mask its isolated transparency group. This preserves transformed pattern coordinates and high-cycle axial reuse without nesting transparency groups inside the mask
Nested and truly internally tangent periodic radial masks use independent cycle functions and paint clipped discs from largest to smallest, avoiding repeated antialiasing of a shared annular boundary. Shrinking deep spans retain the unpainted area beyond the existing slice budget. Near-tangent escaping families retain their finite-cone path
Periodic sweeps retain their existing 96-wedge approximation. Two exact-center samples in the focused MuPDF/Poppler checks remain outside the ten-channel tolerance and are recorded as unresolved sampling differences. Existing radial and axial painting budgets remain unchanged; this does not establish unlimited geometry or full COLRv1 conformance
Version 2.1095.1 captures nested glyph clips inline inside luminosity masks instead of adding Form draws. References retain their ClipBoxes and intersect parent coverage; empty in masks remain transparent, while empty out masks preserve the surviving operand. Out-mask white coverage includes the active parent clip, and sweep samples use the complementary alpha in out modes
Version 2.1095.0 preserves the ClipBox associated with each color glyph referenced by PaintColrGlyph. Referenced bounds participate in graph boundedness and surface allocation, and their rectangle intersects the current clip in the referenced graph's coordinate space. Nested references, repeated references, transforms and empty referenced clips preserve independent coverage
THPDFCOLRv1Paint adds ClipBoxValid, ClipBoxLeft, ClipBoxBottom, ClipBoxRight and ClipBoxTop for referenced-glyph paint nodes. Recompile callers that use this record because its layout has changed. Root clip metadata remains on THPDFOpenTypeColorGlyphInfo
Format 2 ClipBoxes use resolved instance coordinates starting in version 2.1096.1. Version 2.1095.2 accepts solid and supported pad, repeat or reflect gradients as in/out alpha-mask operands through nested glyph clips, color-glyph references and affine transforms. Layer and supported composite mask operands use complete group-alpha capture starting in version 2.1096.0
GetRegisteredColorGlyphInfo validates the selected base glyph and returns a flat directed acyclic graph in THPDFOpenTypeColorGlyphInfo.COLRv1Paints
COLRv1RootPaintIndex identifies the root and UnitsPerEm supplies the scale used by DrawRegisteredColorGlyph
Graph records
THPDFCOLRv1PaintKind distinguishes layers, solid fills, linear gradients, radial gradients, sweep gradients, glyph clips, reusable color glyphs, transforms, and composites
THPDFCOLRv1Paint stores child indexes, glyph IDs, gradient geometry, transform data, composite mode, and resolved colors
THPDFCOLRv1ColorStop stores an ordered stop offset, resolved CPAL color, alpha, and palette entry index
THPDFCOLRv1Transform stores the six values of the affine paint transform
THPDFCOLRv1PaintArray, THPDFCOLRv1PaintIndexArray, and THPDFCOLRv1ColorStopArray expose the graph and its variable-length children and stops to Delphi and C++Builder
Resolved opacity and record compatibility
Version 2.1112.0 appends AlphaValue: Double and HasAlphaValue: Boolean to THPDFCOLRv1ColorStop and THPDFCOLRv1Paint, preserving effective authored opacity separately from the existing Alpha: Byte mirror
function HPDFCOLRv1ColorStopAlpha(const Stop: THPDFCOLRv1ColorStop): Double;
function HPDFCOLRv1PaintAlpha(const Paint: THPDFCOLRv1Paint): Double;
These functions belong to HPDFOpenTypeAdvanced and return normalized opacity in [0, 1]. Parsed values combine clamped local alpha with CPAL alpha, or foreground alpha for palette entry 0xFFFF, exactly once. The selected alpha source is already included in the getter result, while caller opacity remains part of the outer drawing state
When HasAlphaValue is False, the getter uses Alpha / 255. The earlier byte conversion is retained independently, so existing clients can continue reading the mirror without treating it as the full-precision rendering value
Both record layouts and sizes have changed, so rebuild Delphi and C++Builder clients that exchange or allocate them. Zero-initialize caller-created records before assigning fields. Set HasAlphaValue to True only when supplying AlphaValue; zero-initialized legacy-style records keep the byte-based getter behavior
These fields preserve alpha preparation through the graph, not unlimited output precision. Existing 16-bit sampled gradients, Single angular phases, finite paint budgets and reader rendering differences remain applicable
Linear gradient geometry
The linear paint record retains all three points: X0/Y0 and X1/Y1 locate offsets 0 and 1, while X2/Y2 determines the direction in which each color is projected
The native Windows path uses the equivalent perpendicular axial vector, with offset remapping and local transparency for ill-formed geometry, as described in COLRv1 gradient painting
Graph records expose more operations than the finite native gradient profile establishes; retaining transform or extend-mode data does not establish complete rendering conformance for those operations
Sweep wedge state
The sampled native sweep path isolates each wedge graphics state so an opaque sample cannot inherit a preceding nonopaque sample alpha; the caller state is restored after the sweep
Sweep samples interpolate premultiplied linear-light color and retain independent alpha; the finite wedge approximation does not establish complete sweep geometry, transform or extend-mode rendering conformance
Safety and fallback
The native graph is rendered as a single isolated surface, so the caller's alpha, blend mode and soft mask apply once to the completed color glyph. Each glyph clip contains its complete child surface, preserving holes, intersecting nested clips and translucent layers without replacing the surrounding backdrop
Supported composite operations render their source and backdrop independently. The selected blend mode acts on the complete source surface, and the combined result is placed onto its parent with ordinary source-over composition
The Porter-Duff in and out modes (source-in, dest-in, source-out, dest-out) use a soft mask over the surviving operand. Simple paint fields use opaque gray coverage in one isolated DeviceGray luminosity group, with an inverted field behind a white cover for out modes. Solid and gradient mask operands may contain glyph clips, references and transforms; their intermediate Forms stay ordinary and glyph clips remain inline. Layer and supported composite mask operands instead use the complete isolated RGBA group alpha. Both paths include active parent coverage in the mask bounds. Gradient approximation and the documented reader color-space differences still apply
Form bounds include transformed child surfaces and the union of sibling surfaces. Font bounds limit a glyph-clipped child in its current coordinate space; they do not truncate transformed siblings outside the original font box
A COLRv1 ClipList clip box, when present, sets the color glyph's overall bounds. Without one, version 2.1094.7 checks graph boundedness and propagates conservative finite bounds into child fills and masks, including distant and transformed glyphs and supported in/out composites. Invalid unbounded roots paint nothing without invoking the raster callback. Version 2.1096.1 resolves variation deltas on clip boxes, and version 2.1098.0 retains selected-axis values beyond static field encodings
Isolated output requires PDF 1.4. PDF/A-1 strict and PDF/X-1a or PDF/X-3 retain ordinary forms for opaque graphs; the existing restrictions on translucent alpha and nonnormal blend modes still apply. Ordinary forms alone do not establish profile conformance: PDF/X-1a additionally requires output colors restricted to its permitted CMYK and spot spaces, and EndDoc recursively validates content colors starting in version 2.1093.0
Native COLRv1 color sources, gradient interpolation and isolated groups use linear-light RGB through D65 CalRGB with unit gamma. CPAL sRGB bytes are decoded before use; the complete root surface converts to the caller space once. Version 2.1099.0 extends the native composite set with source-atop, destination-atop, xor and plus
Rendering depends on the reader honoring calibrated group blending: focused MuPDF 1.28.2 controls use its ICC-enabled path, while the tested Poppler 26.07.0 Splash backend ignores ordinary group blending spaces and retains known color differences
MuPDF 1.28 loses near-zero linear-light channels when compositing an isolated group that carries the CalRGB blend space, so dark glyph areas can render with a zeroed channel despite correct saved operands. The opt-in COLRv1DeviceSpaceGroupBlend property emits COLRv1 groups without a blend color space, letting readers composite in the ordinary device space; content colors and color functions stay linear-light CalRGB, and the default keeps linear-light group blending
Paint offsets are checked against their correct table-relative bases before graph construction
Graphs are limited to 4096 paint nodes and 96 levels, and cycles fail before any page operators are emitted
Native output covers source and destination ordering, all Porter-Duff operations including atop, xor and plus, and the PDF blend-mode family within the documented finite graph and transparency profile. Atop and xor use whole-operand alpha with a lower-surface alpha ratio; plus uses ColorBurn, Multiply, Difference and ColorDodge arithmetic for saturating premultiplied sums and one final alpha mask. Profile restrictions retain OnColorGlyphRasterize when assigned; reader color-space and precision differences remain
Version 2.1149.11 preserves the backdrop at atop and xor group boundaries where the source has no coverage. The original lower-surface division is retained, but its complement is gated by exact nonzero source-alpha support before the final luminosity inversion. This avoids attenuating an unrelated backdrop edge without expanding group bounds or using raster fallback. Focused rotated-edge and interior controls pass with the original tolerances; calibrated blending and deeper graph precision differences remain reader-dependent
MuPDF 1.28 mis-evaluates luminosity masks whose group carries the CalRGB blend space, the same near-zero channel precision loss described above; the COLRv1DeviceSpaceGroupBlend opt-in restores correct mask evaluation there, and Poppler 26.07.0 renders the default output correctly
An ill-formed supported linear paint is locally transparent, so supported sibling layers remain available and the empty paint does not request fallback for the complete graph