Repository navigation
Draw an empty dash pattern as a solid line - #106
Merged
Merged
Conversation
ISO 32000 says an empty dash array is a solid line (8.4.3.6). A dashed /BS whose /D is [] drew the default dash [3] instead, because the generator read an empty /D as a /D left out. Now: - A dashed /BS draws its /D, the default [3] when it has none, and no dash at all for an empty one: shapes, lines, polylines, ink (GetDashPatternString) and form widget borders (GetBorderStyleInfo, which now draws such a border solid). - EPDFAnnot_GetBorderStyle reads such a border as solid, as it already read a /Border whose dash array is empty, so the engine reports what is drawn. A /Border dash array is drawn as before, its own numbers (ISO 32000 table 166). Acrobat draws dashes by a rule of its own (a /BS without /D solid, any /Border dash array as [3]); the engine keeps ISO's. Tests: AnEmptyDashPatternIsASolidLine (square, circle, line and ink: no /D draws [3 ] 0 d and reads dashed; /D [] and /Border [0 0 2 []] draw no dash and read solid), and TextFieldDrawsItsBorderStyle with an empty /D on a widget; the new test recorded as a layer-mode writer. On macOS the full unit, embedder and pixel suites fail the same tests as fork main (986db17): unit 2 (the ephemeral ink tests #105 fixes), embedder 12, pixel 51 and the same 2 surprises.
This was referenced Nov 3, 2026
roanutil
pushed a commit
to roanutil/embed-pdf-viewer
that referenced
this pull request
Nov 4, 2026
…olid Dashes keep ISO 32000's rule, with two fixes that make every app draw the engine's dashed borders the same: - A dashed border written without a pattern of its own (a create, or an update that makes a border dashed or clears its pattern while dashed) now states the default, [3, 3], and reads it back. ISO 32000 draws a dashed /BS without /D with the default dash, but Acrobat, redrawing one, draws it solid (checked Nov 3: output/dash-acrobat-check in the platform repo). The rule lives in engine-core's derive step (resolve/dash.ts: dashDraftFollows, dashPatchFollows), so the engine's writes and the viewer's predictions agree, and in placedWidgetOf for a form's widget placements. A patch that leaves the border alone leaves another app's dashed border without /D as it is: it reads dashArray null and draws the default. - An empty /D is a solid line (ISO 32000 8.4.3.6). The runtime now draws it so and reads such a border as 'solid' (embedpdf/runtime, "Draw an empty dash pattern as a solid line"), so the viewer, which draws what the engine reads, agrees with no change of its own. Conformance (runDrawingDetailsConformance): a dashed create reads [3, 3]; dashArray null on a dashed border reads [3, 3]; another app's dashed square without /D reads dashed with dashArray null; one with /D [] reads solid. With the pinned runtime, the local engine and the cloud engine pass all 11. Docs: the style table and "Dashed lines", synced to both sites. API snapshots: placedWidgetOf, the drawing fixture. Runtime: embedpdf/runtime#106, in the pinned f2dd40897.
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.
ISO 32000 says an empty dash array is a solid line (8.4.3.6). A dashed
/BSwhose/Dis[]drew the default dash[3]instead, because the generator read an empty/Das one left out. This is the one case where our dash rule was off ISO./BSdraws its/D, the default[3]when it has none, and no dash at all for an empty one. That covers shapes, lines, polylines and ink (GetDashPatternString) and form widget borders (GetBorderStyleInfo, which now draws such a border solid).EPDFAnnot_GetBorderStylereads such a border as solid, as it already read a/Borderwhose dash array is empty, so the engine reports what is drawn.A
/Borderdash array still draws its own numbers (ISO 32000 table 166).Context: Acrobat draws dashes by a rule of its own, checked on Nov 3 across six kinds. It treats a
/BSwithout/Das solid, and draws any/Borderdash array as[3]whatever its numbers. We keep ISO's rule; the engine side (embedpdffix/iso-dashes) writes a dashed border's default pattern out as/D [3 3], so Acrobat draws it dashed too.Tests
AnEmptyDashPatternIsASolidLine: on a square, circle, line and ink, no/Ddraws[3 ] 0 dand reads dashed;/D []and/Border [0 0 2 []]draw no dash and read solid. Recorded as a layer-mode writer.TextFieldDrawsItsBorderStyle: an empty/Don a widget draws its solid border.On macOS, the full unit, embedder and pixel suites fail the same tests as fork main (986db17): unit 2 (the ephemeral ink tests that #105 fixes), embedder 12, pixel 51 with the same 2 surprises. The engine's drawing conformance passes in full, on the local engine and the cloud engine, against a runtime built from this branch. Linux CI hasn't run yet.