Repository navigation
RenderOptions.FullHairlines: thin strokes at their width by default - #244
Merged
Merged
Conversation
…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
marked this pull request as ready for review
November 16, 2026 06:47
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.
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.FullHairlinesswitch 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:listKeyand the widget lists carryrecOpts, which bundles it withSimulateOverprint.cmd/cera -full-hairlines.accuracy(the PDFium comparison) renders withFullHairlines, so its values stay the same.cera -full-hairlinesrenders 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.