Skip to content

RenderOptions.FullHairlines: thin strokes at their width by default - #244

Merged
timzifer merged 2 commits into
mainfrom
claude/issue-243
Nov 16, 2026
Merged

timzifer merged 2 commits into
mainfrom
claude/issue-243

Conversation

@timzifer

@timzifer timzifer commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #243.

Thin lines close together no longer merge into a solid blot. With stilus timzifer/stilus#80, a stroke thinner than one device pixel is drawn at its width, with the exact area it covers; only strokes of width 0 are one-pixel hairlines. On the LuaTeX page of #243 at 20 dpi, the QR code (1.13 pt strokes) and the hand symbols (0.6 pt outline) are now grey, as in MuPDF and Ghostscript, instead of black squares.

  • RenderOptions.FullHairlines / RunOptions.FullHairlines switch the PDFium convention back on (every stroke thinner than a pixel one pixel wide at full coverage), for technical drawings that want every line dark at any zoom. The interpreter sets it on every stroke style it emits, the cells of tiling patterns included. The display list is recorded once per setting: listKey and the widget lists carry recOpts, which bundles it with SimulateOverprint.
  • cmd/cera -full-hairlines.
  • accuracy (the PDFium comparison) renders with FullHairlines, so its values stay the same. cera -full-hairlines renders 74 pages of the corpus (synthetic + 60 pdf.js files, 30 and 150 dpi) byte for byte as main does; the default differs on 14 of them, all with thin strokes.
  • accuracy/reference (MuPDF, Poppler, GS, PDFium and the exact rendering) keeps the default: the exact rendering treats only width 0 as a hairline, as the new default does.

Test: hairline_test.go (quarter-pixel lines, width-0 lines, a pattern cell with a thin line; switching setting does not reuse the list).

stilus v0.20.0 (with timzifer/stilus#80) in every module.

…243)

stilus now draws a stroke thinner than one device pixel at its width,
with the exact area it covers, and only strokes of width 0 as one-pixel
hairlines; StrokeStyle.FullHairlines keeps the PDFium convention. Thin
lines close together no longer merge into a solid blot: a QR code of
1.13 pt strokes or a hand symbol outlined at 0.6 pt in a 20 dpi thumbnail
come out grey, as in MuPDF and Ghostscript, instead of black squares.

- RenderOptions.FullHairlines and RunOptions.FullHairlines switch the
  PDFium convention back on, for technical drawings that want every line
  dark at any zoom. The interpreter sets it on every stroke style it
  emits, the cells of tiling patterns included; the display list is
  recorded once per setting (listKey and widget lists carry recOpts,
  which bundles it with SimulateOverprint).
- cmd/cera -full-hairlines.
- accuracy (the PDFium comparison) renders with FullHairlines, so its
  values are unchanged: cmd/cera -full-hairlines renders 74 pages of the
  corpus byte for byte as main does.
- stilus at the commit of timzifer/stilus#80 in every module, until it
  is released.
@timzifer
timzifer marked this pull request as ready for review November 16, 2026 06:47
@timzifer
timzifer merged commit ddb9648 into main Nov 16, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thin strokes merge into solid blots in thumbnails

1 participant