Commit Graph
560 Commits
Author SHA1 Message Date
BFlat cde331fb7e Merge pull request #6663 from storytold/merge/render-interpret-patches
Land render and font patches (#6292, #6287, #6314, #6353, #6359, #6368, #6409, #6491, #6545, #6516, #6521, #6528, #6533, #6529, #6542, #6543, #6569, #6572)
2026-11-09 10:54:50 +08:00
Luigi Pinna 8c7ea6377e test(content): the #2456 tests use a filtered inline image (#2483) 2026-11-09 10:13:54 +08:00
jonathanwxh-cell 5e671ec301 fix(render): treat combined fill-and-stroke operators as a knockout group (#3229) (#4788) 2026-11-09 10:09:06 +08:00
Nate Glasby b02765b6a1 fix(ui): show creation and modification dates in Document Properties (#5534) (#5536) 2026-11-09 10:06:03 +08:00
Ethunxxx d67b82c591 M4: bookmarks run their actions as links do (organize.bookmark-actions) (#5410) 2026-11-09 10:05:18 +08:00
bflatastic b21ee3a710 Decode a soft mask that isn't averaged down within its image's decode
Patch 82 sent every soft mask through the decoded-image cache, so a mask that patch 91 keeps failed inside its image's entry got a second entry and counted as another decode. Only a mask averaged down needs an entry of its own; any other decodes as it did before patch 82.
2026-11-09 09:05:11 +07:00
bflatastic 9e6854869b Merge origin/main into merge/render-interpret-patches
# Conflicts:
#	crates/render/src/raster/tests.rs
#	crates/render/src/text/tests.rs
#	parity/acrobat-features.toml
#	vendor/README.md
2026-11-09 09:03:56 +07:00
bflatastic d2619333e9 Merge #6438: M2: a page past the rasterizer's coverage renders what fitted instead of failing (view.render-error-isolation)
# Conflicts:
#	vendor/README.md
2026-11-09 08:15:14 +07:00
bflatastic 795f9a9508 Merge #6532: M2: a CMap's bfchar mappings read codes at their codespace length (view.render-cid-fonts)
# Conflicts:
#	crates/render/src/raster/tests.rs
#	vendor/README.md
2026-11-09 08:14:19 +07:00
bflatastic e2f65dbf5a Merge #6572: M3: Find matches words on a vertical line (view.find)
# Conflicts:
#	vendor/README.md
2026-11-09 08:13:59 +07:00
bflatastic 8eb14f3892 Merge #6569: fix(render): a symbolic TrueType font in the Macintosh glyph order reads its codes as Mac Roman (hayro-interpret patch 101)
# Conflicts:
#	crates/render/src/raster/tests.rs
#	vendor/README.md
2026-11-09 08:13:36 +07:00
bflatastic d5ea69db50 Merge #6348: fix(render): a ToUnicode CMap reads its mappings past a token it can't parse (hayro-cmap patch 3)
# Conflicts:
#	crates/render/src/raster/tests.rs
#	vendor/README.md
2026-11-09 08:13:19 +07:00
bflatastic 5da76a640c Merge #6543: fix(render): a numbered glyph name at its own code reads as that code's character (hayro-interpret patch 100)
# Conflicts:
#	vendor/README.md
#	vendor/hayro-interpret/src/font/mod.rs
#	vendor/hayro-interpret/src/font/type3.rs
2026-11-09 08:13:01 +07:00
bflatastic 2992146abb Merge #6312: M1: a document that encrypts only its embedded files opens without a password (core.attachment-only-encryption)
# Conflicts:
#	crates/render/src/inspect/tests.rs
#	vendor/README.md
2026-11-09 08:12:28 +07:00
bflatastic e70cacf36f Merge #6290: fix(render): a stream with no endstream after it draws from its /Length instead of a blank page (hayro-syntax patch 36)
# Conflicts:
#	crates/render/src/raster/tests.rs
#	vendor/README.md
2026-11-09 08:11:43 +07:00
bflatastic ec0330ea77 Merge #6542: fix(render): a patch mesh painted through a path its own size draws every patch (hayro-interpret patch 99)
# Conflicts:
#	vendor/README.md
2026-11-09 08:11:40 +07:00
bflatastic 183c66ddb5 Merge #6529: fix(render): a non-embedded SymbolMT draws Symbol's glyphs, whatever encoding it declares (hayro-interpret patch 98)
# Conflicts:
#	vendor/README.md
2026-11-09 08:11:26 +07:00
bflatastic 6160819a57 Merge #6533: M2: a font without a /Subtype is drawn by its /BaseFont (view.render-pages)
# Conflicts:
#	vendor/README.md
2026-11-09 08:11:11 +07:00
bflatastic 9e2c8130ad Merge #6561: M1: a file whose last update has no /Prev opens with all its pages and a repair note (core.repair-broken-files)
# Conflicts:
#	parity/acrobat-features.toml
#	vendor/README.md
#	vendor/hayro-syntax/src/pdf.rs
2026-11-09 08:11:01 +07:00
bflatastic e2502b2f9b Merge #6528: fix(render): a CID-keyed CFF font with an emptied font dict still draws its other glyphs (hayro-interpret patch 93)
# Conflicts:
#	vendor/README.md
2026-11-09 08:10:53 +07:00
bflatastic e4cb041bdc Merge #6521: fix(render): glyph names read as text only in the glyph list's uni and u forms (hayro-interpret patch 92)
# Conflicts:
#	vendor/README.md
2026-11-09 08:10:37 +07:00
bflatastic 4dfd9bd564 Merge #6516: fix(render): a picture that doesn't decode is decoded once, not at every draw (hayro-interpret patch 91)
# Conflicts:
#	crates/render/src/raster/tests.rs
#	vendor/README.md
#	vendor/hayro-interpret/src/x_object.rs
2026-11-09 08:10:02 +07:00
bflatastic 574968a03b Merge #6545: fix(render): a Type 3 font without /Widths advances by its glyphs' d0/d1 widths, and the page warns about it (hayro-interpret patch 90)
# Conflicts:
#	crates/render/src/raster/tests.rs
#	vendor/README.md
#	vendor/hayro-interpret/src/font/type3.rs
2026-11-09 08:08:39 +07:00
bflatastic 4c219bb055 Merge #6491: fix(render): a non-embedded Times New Roman draws the glyphs its codes name (hayro-interpret patch 88)
# Conflicts:
#	crates/render/src/raster/tests.rs
#	vendor/README.md
2026-11-09 08:07:55 +07:00
bflatastic 16312e1a10 Merge #6534: M2: a page without a /MediaBox is US Letter (view.render-pages)
# Conflicts:
#	vendor/README.md
#	vendor/hayro-syntax/src/page.rs
2026-11-09 08:07:49 +07:00
bflatastic e81b45a117 Merge #6409: fix(render): a Type 3 glyph shown again isn't decoded again (hayro-interpret patch 87)
# Conflicts:
#	vendor/README.md
2026-11-09 08:07:12 +07:00
bflatastic c90a4115d5 Merge #6368: fix(render): a form field's widget is drawn above the page's comments (hayro-interpret patch 86)
# Conflicts:
#	vendor/README.md
2026-11-09 08:06:57 +07:00
bflatastic cdf7f1b178 Merge #6359: fix(render): a ToUnicode written with CID ranges gives its text (hayro-interpret patch 85)
# Conflicts:
#	crates/render/src/text/tests.rs
#	vendor/README.md
#	vendor/hayro-interpret/src/font/cid.rs
2026-11-09 08:06:43 +07:00
bflatastic 9cb7dc4094 Merge #6510: M1: the renderer reads a cut-off last update's objects, as the document model does (core.repair-broken-files)
# Conflicts:
#	vendor/README.md
2026-11-09 08:05:56 +07:00
bflatastic e7ecc84544 Merge #6506: fix(render): a fax image with more /Rows than its /Height is decoded to its height (hayro-syntax patch 41)
# Conflicts:
#	vendor/README.md
2026-11-09 08:05:40 +07:00
bflatastic 5c42721193 Merge #6501: fix(render): an image whose PNG predictor was declared but never applied draws its samples (hayro-syntax patch 40)
# Conflicts:
#	parity/acrobat-features.toml
#	vendor/README.md
2026-11-09 08:05:23 +07:00
bflatastic 67c1e6a145 Merge #6353: fix(render): an embedded CJK font without a usable ToUnicode reads its text through its collection's UCS2 CMap (hayro-interpret patch 84)
# Conflicts:
#	vendor/README.md
2026-11-09 08:05:10 +07:00
bflatastic d568f0d3d6 Merge #6314: fix(render): a TrueType font marked with an out-of-range loca format draws its letters instead of boxes (hayro-interpret patch 83)
# Conflicts:
#	vendor/README.md
2026-11-09 08:04:53 +07:00
bflatastic 581b5364ec Merge #6287: fix(render): a small image with a soft mask far larger than it draws in seconds, its mask averaged down once (hayro-interpret patch 82)
# Conflicts:
#	vendor/README.md
2026-11-09 08:04:38 +07:00
bflatastic 9d8e21de25 Merge #6355: fix(render): a page whose MediaBox or CropBox encloses no area shows its content (hayro-syntax patch 38)
# Conflicts:
#	vendor/README.md
2026-11-09 08:04:18 +07:00
bflatastic 88edc03ef4 Merge #6292: fix(render): a page of stencil masks painted with a tiling pattern draws in seconds instead of running out of memory (hayro patch 30)
# Conflicts:
#	vendor/README.md
2026-11-09 08:04:05 +07:00
mtlcl410 87bc00a991 M3: Find matches words divided by soft hyphens, zero width characters or a Chinese or Japanese line end (view.find) (#6595) 2026-11-09 08:58:34 +08:00
mtlcl410 58c30af312 fix(render): a JBIG2 scan whose data starts with a JBIG2 file header draws instead of a white page (hayro-jbig2 patch 17) (#6279) 2026-11-09 08:54:03 +08:00
mtlcl410 38ba2e7495 M5: a font a page lists among its annotations is not a comment (comment.list-view) (#6447) 2026-11-09 08:50:25 +08:00
mtlcl410 e83c200598 M6: a field whose /Kids loop back or name a root field keeps its other kids (form.field-list) (#6446) 2026-11-09 08:50:11 +08:00
mtlcl410 608ff62dae M6: a widget whose /Parent names a missing object is a field of its own (form.field-list) (#6445) 2026-11-09 08:49:56 +08:00
mtlcl410 1a28606c64 M10: a layer the document marks screen-only stays off the printed sheet (print.print-ready-pdf) (#6387) 2026-11-09 08:48:28 +08:00
c02341f6c0 M2: a wide stroke of a path with y curves is drawn, not dropped (vello_common patch 4) (#6526)
A cubic whose second control point is its end point (as the `y` operator builds,
ISO 32000-2 8.5.2.1 Table 58) has a zero derivative at its end. kurbo 0.13.1's
offset curve looks for cusps with a root search on the curvature, which grows
without bound towards that end; at some widths the search stops on the end point
and normalising the zero tangent there gives NaN. vello_common's fill drops any
outline with NaN, so the whole stroke vanished (a two-curve `y` path drew nothing
at 16, 32 and 63 pt; a PDFBox tracker file lost its 32 pt "XX" outline).

The NaN fallback that #4913 added to `flatten::stroke` now also moves such a
control point the stroke tolerance towards the previous control point before
stroking again (the curve moves by at most 4/9 of the tolerance). Outlines that
come back finite take the old path unchanged. The vendor ledger row also gets
back #4913's entry, which a merge had dropped.


Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA

Co-authored-by: mtlcl410 <chuanlin@niar.org.tw>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:31:00 +08:00
42b21e5362 fix(render): a form XObject that draws itself is drawn once (hayro-interpret patch 89) (#6515)
* M2: a form XObject that draws itself is drawn once (hayro-interpret patch 89)

A form whose content names itself, directly or through another form, a
pattern or a glyph, drew itself again at every level until the page's
nested-paint budget (50,000) ran out. PDFBOX-5782's poppler-748 page 2,
whose form names a /Pages dictionary as /X0 and so finds itself in the
page's resources, took 38 s.

hayro-interpret now keeps the forms being drawn on the context and skips
a form already on it, reporting ContentTruncated (ISO 32000-2 §8.10.1: a
form is a self-contained description). The lenient fallback from a form's
own resources to the page's stays: MuPDF, Poppler and PDFium all draw a
name from the page's resources when the form's /Resources has no
XObject subdictionary (MuPDF and Poppler also when it has an empty one).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

* fix(render): a form that reaches itself through a pattern or a glyph is drawn once (hayro-interpret patch 89)

The forms being drawn are now kept per page and thread rather than per
context, so the tiling patterns, Type 3 glyphs, soft masks and groups
painted inside a form, which hayro interprets in contexts of their own,
see that the form is being drawn and skip it inside themselves. A form
drawn again after it has finished draws as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA

* chore: re-run CI after the Fill & Sign save comparison failed on the clock (#6066)

`fill_sign_enter_adds_lines_outside_click_commits_and_escape_cancels`
compares two saves whose /ModDate fell in different seconds; it passes
locally on this commit. No change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA

---------

Co-authored-by: mtlcl410 <chuanlin@niar.org.tw>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:30:14 +08:00
9b231f241d perf(render): undo TIFF predictor 2 a byte row at a time at 8 and 16 bits (#6505)
TIFF predictor 2 (ISO 32000-2 §7.4.4.4, Table 10) went through the
bit-level BitChunks/BitWriter path for every bit depth, re-reading the
previous output pixel through a new BitReader per pixel. Whole-byte
samples (8 and 16 bits per component) are now undone on byte slices,
each sample added to the same component of the pixel to its left,
wrapping at its width; 1-, 2- and 4-bit samples keep the bit-level path.
The output is byte-identical, including the dropped partial last row.

A page of 45 full-page 8-bit grey images so predicted (PDFBOX-1350)
renders in about 4 s instead of 23 s with the same pixels.

Vendored hayro-syntax patch 42.


Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

Co-authored-by: mtlcl410 <chuanlin@niar.org.tw>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:29:44 +08:00
b07a84f003 M5: a comment whose colour is written [r g b null] is drawn, as CMYK with the null read as 0 (view.render-annotation-appearances) (#6503)
* M5: a comment whose colour is written [r g b null] is drawn, as CMYK with the null read as 0 (view.render-annotation-appearances)

ISO 32000-2 Table 166 /C (and /IC, Tables 178, 180, 181; /MK /BC and /BG,
Table 192) is an array of 0, 1, 3 or 4 numbers whose length picks the
colour space. A four-entry array with a non-number in it, such as
[1 0 0 null] (PDFBOX-2699), made the /C parser give up, so a shape
without an appearance stream was not drawn at all. PDFium, MuPDF and
Poppler all read such an array as CMYK with the non-number as 0.

- annot: a four-entry /C or /IC reads non-numbers as 0; other lengths
  still need every entry to be a number.
- annot: the properties' fill uses the same parser (it read
  [r g b null] as RGB before), and /C no longer drops a non-number
  to make three numbers.
- forms: /MK /BC and /BG read a four-entry array the same way instead
  of dropping the non-number and drawing RGB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

* M5: comment properties report the stroke colour as drawn; a reference among four colour entries is not read as 0 (view.render-annotation-appearances)

props() reads a non-FreeText /C through the appearance parser, so a
[1 0 0 null] stroke reports CMYK cyan as drawn, and grey and CMYK
strokes report their converted colour. A reference among the four
entries of a /C array (ISO 32000-2 7.3.10) is left unreadable instead
of standing in as 0, so /C [1 0 0 6 0 R] is never drawn cyan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

* M5: re-run CI (fill_sign Escape test depends on the clock's second, passes locally)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

* M5: the comment list reports a comment's colour as drawn (view.render-annotation-appearances)

summaries() accepted only a three-entry /C, so a Square with /C [1 0 0 null],
drawn cyan and reported cyan by props(), had no colour in the comment list;
grey and CMYK colours were dropped the same way. Non-FreeText comments now
read /C through drawn_color (the array itself followed when it is given by
reference), keeping the three-number fallback and the FreeText /DA handling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

* M5: the render inspector lists a comment's colour as drawn (view.render-annotation-appearances)

The inspector accepted only a three-entry /C, with a referenced entry read
as 0, so a /C [1 0 0 null], a grey or a CMYK colour listed none, unlike the
comment list and the drawing. Non-FreeText comments now read /C by the
appearance builder's rule (one entry grey, four CMYK with a non-number as 0
and a reference unreadable, finite and clamped), with the three-number
fallback reading referenced entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyDBXygTf7jcqdsjcfn

---------

Co-authored-by: mtlcl410 <chuanlin@niar.org.tw>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 08:29:31 +08:00
mtlcl410andClaude Opus 5.5 d983cf6fcd M3: code 32 is the first code a numbered name may name (create.text-extraction)
numbered_glyph_names_read_as_their_own_code gains a font with `/C32` at 32
beside `/C70` at 70 and `/C0071` at 71. The font still reads, and code 32
gives a space, so a guard that also rejected code 32 would now fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA
2026-11-09 07:43:14 +08:00
mtlcl410andClaude Opus 5.5 8c892e6529 M3: a numbered-name counter that starts below 32 is not read as codes (create.text-extraction)
A subset that counts its glyphs in order of first use (`/Differences [1 /C1
/C2 ...]`) names its own codes, so numbered_names_name_their_codes held and
`/C65` (the 65th glyph used) read as `A`. A numbered name at a C0 control
code, which no text shows, now gives the counter away and the font reads
nothing. The check sits in the one function both the Type 1/CFF and the
Type 3 paths call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCHD1R3rywQBPCHXZA
2026-11-09 07:23:00 +08:00
mtlcl410 2303f9e085 Merge remote-tracking branch 'upstream/main' into lane6-6569
# Conflicts:
#	crates/fonts/src/pdf/tests.rs
2026-11-09 02:26:52 +08:00
mtlcl410 31c9d91877 Merge remote-tracking branch 'upstream/main' into lane3-6491
# Conflicts:
#	ROADMAP.md
2026-11-09 02:23:29 +08:00