PDF stage 4.2: strokes & line style#560
Merged
Merged
Conversation
27fb785 to
f200ad3
Compare
Render stroked paths and stroke styling, completing the path-painting vocabulary started in 4.0/4.1. - `GraphicsState`: real dash pattern (`d` -> array + phase, replacing the int placeholder), and spec-correct initial values (line width 1, miter limit 10). Stroke width and dash lengths are folded by the CTM area scale (sqrt|det|) when snapshotted, so they share the geometry's user space; an anisotropic pen is approximated (SVG can't express one). - `PathElement` carries the dash array/phase; the HTML layer emits stroked `<path>`s — stroke color, `stroke-width` (0 -> hairline), `stroke-linecap` (1/2 round/square), `stroke-linejoin` (1/2 round/bevel), `stroke-miterlimit`, `stroke-dasharray`/`-dashoffset`. Fill+stroke (`B`/`b`) emit both. - Cleanup: the leftover stdout debug in pdf_graphics_state.cpp is gone — dash is implemented; the SC/SCN named/ICC/Separation/Pattern color ops are now explicit stage-4.4 no-ops instead of stdout spam. Drops <iostream>. Adds stroke-parameter tests (line params, dash parse, CTM scaling of width and dash, solid reset). Verified end-to-end: a synthetic dashed stroke and the Infineon datasheet (672 strokes, 11 dashed). PDF suite green (128). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011jPrCgocCTnKhMi3k6VBjU
3b88520 to
046a759
Compare
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.
🤖 Generated with Claude Code
Stacked on #559 (stage 4.1). Completes the path-painting vocabulary: stroked paths and stroke styling.
What this does
GraphicsState: a real dash pattern (d→ array + phase, replacing theintplaceholder) and spec-correct initial values (line width 1, miter limit 10). When a path is painted, stroke width and dash lengths are folded by the CTM area scale (sqrt|det|) so they share the geometry's user space (an anisotropic pen — which SVG can't express — is approximated).<path>s:strokecolor,stroke-width(0 → hairline),stroke-linecap(round/square),stroke-linejoin(round/bevel),stroke-miterlimit,stroke-dasharray/-dashoffset. Fill+stroke (B/b) emit both.pdf_graphics_state.cpp— dash is implemented; the SC/SCN named/ICC/Separation/Pattern color ops become explicit stage-4.4 no-ops instead of per-operator stdout spam. Drops<iostream>.Tests / verification
New stroke IR tests (line params, dash parse, CTM scaling of width & dash, solid reset). End-to-end:
and the Infineon datasheet now renders 672 strokes (11 dashed). PDF suite green (128).
Reviewers: as with 4.1, the
reference-outputfixtures need regenerating.