Repository navigation
Pin the runtime to f2dd40897: shapes without a stroke, and ink drawn as Acrobat draws it - #971
Merged
Merged
Conversation
The release brings fork PRs 101 to 108: no stroke without /C, ink drawn with the curves Acrobat fits, ISO dashes (an empty /D is solid), an annotation's kind changed in place (EPDFAnnot_SetSubtype), and the Latin fallback floor. EPDFAnnot_SetNoColor and EPDFAnnot_SetSubtype join the generated function list, and runtime-src moves to the pin.
A square, circle, polygon, polyline, line or ink annotation takes `color: null` for no stroke and keeps its `strokeWidth`. The engine writes it as `/C []`, the empty colour ISO 32000 defines as no colour, and reads an empty or missing `/C` as `null`: that's how Acrobat draws both (checked with a grid of shapes without appearance streams). A missing `/C` used to read as red. - Engine: the stroked kinds' `color` is nullable; the reader drops its red default; the writer uses the runtime's new `EPDFAnnot_SetNoColor`. `runNoStrokeConformance` checks reads, writes, creates and pixels on both engines, from the Acrobat grid's cases. - Viewer: `Style.color` may be `null` and the scene paints no stroke for it. A line, polyline or ink at width 0 is a hairline (`Paint.hairline`, one pixel at any zoom) with a 1 pt line's endings, as the runtime and Acrobat draw it; it drew nothing before. - Style panel: a colour property's `allowsNone` offers "none". On a shape's or line's stroke and fill, a text box's background, a redaction's fill and a form field's border and background; never on ink or markup, which would just vanish. Tool defaults take `color: null` too. - Docs: "Without a line" on the shapes page, the style section and the style-panel property table; the style-panel samples use `allowsNone`. Synced to both sites. - Contract and SDK: `color` is nullable on the six kinds (`pnpm api:sync`). API snapshots, changesets. Runtime: embedpdf/runtime#104 (`EPDFAnnot_SetNoColor`), in the pinned f2dd40897.
The viewer draws an ink stroke as the runtime now writes it (embedpdf/runtime, cpdf_ink_curves.h), which is how Acrobat draws it: cubic Béziers fitted to the points as Schneider fits digitized curves, without his Newton step, never more than sqrt(2) pt from any point, and a stroke of one point as a dot of radius 0.5. The fit is ink-curves.ts, one implementation for the scene, the box and the hit test: - Scene: each stroke is a `path` of `C` segments with round caps and no join (the curves meet smoothly); a dot is an `ellipse` filled in the stroke's colour. - Box: the points and what the curves paint, as the runtime measures /Rect: the curves' ends and turns, half the width across each curve's ends, round caps, past each turn, and a miter where two curves meet in a corner. - Hit test and marquee: the curves flattened to within 0.05 pt; a dot is a filled oval. Tested against the same Acrobat numbers as the runtime: the eight cases of ink-curves.pdf to 0.001 pt, the tolerance pinned by the dense zigzag (37 cubics; 39 below 1.2747, 33 above 1.5062), and the box of the runtime's /Rect test (top at 93.172844). The fit gives the same curves in page space as in the file's. The cloudy border's Bézier helpers moved to bezier.ts, which ink shares. Docs: the ink section of engine/annotations/shapes, synced to both sites. API snapshot: `scene`'s body. Runtime: embedpdf/runtime#105, in the pinned f2dd40897.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Nov 3, 2026
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pins the runtime release that draws shapes and ink as Acrobat does, with the two viewer and engine halves that release needs: shapes, lines and ink without a stroke, and ink drawn with Acrobat's curves.
Runtime. Pinned to
f2dd40897, the release of embedpdf/runtime#101 to embedpdf/runtime#108, andruntime-srcpoints at it. Two new functions join the generated list:EPDFAnnot_SetNoColor(embedpdf/runtime#104), which this PR uses, andEPDFAnnot_SetSubtype(embedpdf/runtime#103), which the annotation kind change will use. The release also carries the Latin fallback floor (embedpdf/runtime#101, embedpdf/runtime#102) and ISO dashes (embedpdf/runtime#106), whose engine halves follow in their own PRs.No stroke:
color: null. A square, circle, polygon, polyline, line or ink takescolor: nulland keeps itsstrokeWidth. The engine writes/C [], ISO 32000's empty colour, and reads an empty or missing/Casnull, as Acrobat draws both. A missing/Cused to read as red. A line, polyline or ink at width 0 is a hairline with a 1 pt line's endings (Paint.hairline). The style panel'sallowsNoneoffers "none" on strokes, fills and backgrounds, never on ink or markup.runNoStrokeConformancechecks reads, writes, creates and pixels on both engines from the Acrobat grid's cases. Contract and SDK:coloris nullable on the six kinds (api:sync).Ink with Acrobat's curves. The runtime now writes each ink stroke as the cubic Béziers Acrobat fits to its points (Schneider's fit without the Newton step, within sqrt(2) pt of every point; a one-point stroke is a dot of radius 0.5). The viewer draws the same curves:
ink-curves.tsis one fit for the scene (apathofCsegments, round caps, no join), the box (the runtime's/Rectrules) and the hit test (curves flattened to 0.05 pt). The cloudy border's Bézier helpers moved tobezier.ts, which ink shares.Checks, with the release's darwin-arm64 and wasm32 payloads built locally (both sha256s match the pin):
annotation rect > the viewer shows the rect the engine writes > inkon wasm and native: the runtime's ink/Rectfollows the curves, which the viewer learns from the ink commit. So the pin lands with it.api:check, anddocs:checkfor both sites.