nigig-org/crates/apps/pdf/tests/corpus
andodeki a82c8f7ff7
Some checks failed
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
nigig-build (CAD) / cad-engine-coverage (push) Has been cancelled
nigig-build (CAD) / doc-workspace-coverage (push) Has been cancelled
nigig-build (CAD) / cad-widget-coverage (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
spreadsheet / engine-coverage (push) Has been cancelled
spreadsheet / ui-controller-coverage (push) Has been cancelled
doc-engine / engine (push) Has been cancelled
doc-engine / coverage (push) Has been cancelled
sms / robius-sms (push) Has been cancelled
sms / android (push) Has been cancelled
sms / nigig-sms (push) Has been cancelled
sms / supply-chain (push) Has been cancelled
doc-engine / consumer (push) Has been cancelled
email / gates (push) Has been cancelled
email / email-domain (push) Has been cancelled
email / nigig-email (push) Has been cancelled
email / supply-chain (push) Has been cancelled
nigig-map / test (push) Has been cancelled
PDF engine / engine (push) Has been cancelled
PDF engine / makepad-integration (push) Has been cancelled
PDF engine / fuzz (push) Has been cancelled
sms / gates (push) Has been cancelled
feat(pdf): Unicode-aware search and layout-aware reading order
Phase 8 bullets one and two. Probing the existing code first, as the
workflow requires, found five defects rather than the one the plan names:

    SPLIT MATCH 'Hello': 0 hits
      plain_text: "Hello"
    PRECOMPOSED 'café': 0 hits
    COLUMNS plain_text: "LeftTopRightTop\nLeftBotRightBot"
    OUT OF ORDER plain_text: "second\nfirst"

`PageText::find` searched one run at a time and documented that as a known
limitation. It is a limitation from inside the code and a broken feature
from outside it: a writer starts a new run wherever it adjusts kerning, so
an ordinary word arrives as two runs, and the find bar says a word plainly
visible on the page is not there.

`search.rs` indexes the page as one flattened string with a map back to
(run, character), so a cross-run match is found and highlighted with one
rectangle per run — never a merged box, which across a line break covers
half the paragraph.

The separator between two runs is a geometric question with three answers:
abutting runs join with nothing (one word, split by kerning), separated
runs with a space, and a different line or column with a newline. The
newline matters as much as the empty join: joining lines with a space lets
"one Right" match across a column gutter, text that appears nowhere.
Whether two runs share a column is *asked* of the layout analysis rather
than re-derived, or the extracted text and the searched text disagree about
where a column ends — the original defect wearing a different hat.

NFD, never NFC: composition needs the next character, so an NFC fold
applied per character composes nothing and the two spellings of an accent
stay different. That was a real bug in the first draft. And case *folding*,
not lowercasing — Rust lowercases ß to ß, so "Strasse" never found
"Straße".

Columns are detected before lines, because two columns share their
baselines; that is what makes them columns. Bands are separated by a gutter
rather than by bare non-overlap, since two abutting runs on a line do not
overlap either.

Also fixed, found by running the gates rather than by looking: a stream
reader trimmed a trailing CR before `endstream` as if it were the writer's
separator. Binary data ends in CR about one time in 256, and when it did
the reader returned a stream one byte short — no longer AES-block-aligned,
so decryption produced garbage and Flate failed. Roughly one encrypted
document in 250 was silently corrupt on read. The test failed once under
coverage, passed five times in isolation, and failed 2 in 40 when actually
counted. A /Length consistent with the file is now the authority; both
stream readers are fixed and a test reads one file through each.

1477 tests pass (was 1426), coverage 88.37%, all floors met, external
readers pass. 10 mutations across the two modules, all killed.

ADR 0034.
2026-08-19 16:12:12 +00:00
..
annotations fix(pdf): fuzz every target, and close two ADR 0004 gaps 2026-07-31 18:34:25 +00:00
basic feat(pdf): Unicode-aware search and layout-aware reading order 2026-08-19 16:12:12 +00:00
color feat(pdf): real colour spaces, ICC profiles and PDF functions 2026-07-28 20:48:55 +00:00
destinations feat(pdf): internal links that actually go somewhere 2026-08-16 19:34:01 +00:00
edge feat(pdf): complete Phase 6 testing infrastructure 2026-07-27 17:08:23 +00:00
encrypted test(pdf): prove the AES-256 path and harden malformed encryption 2026-07-28 17:50:44 +00:00
filters fix(pdf): LZW was broken outright; refuse image codecs instead of faking them 2026-08-16 18:04:07 +00:00
fonts feat(pdf): glyph outlines from TrueType and CFF, and glyph-aware text runs 2026-08-18 19:44:18 +00:00
forms feat(pdf): AcroForm actions and validation; JavaScript refused, not run 2026-07-31 22:41:50 +00:00
images feat(pdf): render a form XObject to pixels — the golden caught what the 2026-08-18 20:06:50 +00:00
jpx feat(pdf): JPEG 2000 decoding — Phase 3 complete, all three codecs 2026-08-16 22:17:40 +00:00
malformed test(pdf): harden the xref revision chain 2026-07-28 16:58:16 +00:00
perf feat(pdf): complete Phase 7 performance work 2026-07-27 17:30:50 +00:00
resources test(pdf): assert what a file declares is delivered, and floor the coverage 2026-08-16 19:04:57 +00:00
revisions test(pdf): harden the xref revision chain 2026-07-28 16:58:16 +00:00
shading fix(pdf): mesh shadings — three bugs in code that had no fixture 2026-08-18 19:10:49 +00:00
signatures feat(pdf): read signatures, and fix a third ObjRef-destroying resolve 2026-07-31 20:02:29 +00:00
structure feat(pdf): tagged structure tree, and the BMC bug that turned red green 2026-07-31 22:19:45 +00:00
transparency feat(pdf): compositing and overprint — the blend maths had no backdrop 2026-08-18 19:25:15 +00:00
type3 feat(pdf): Type 3 fonts and streaming interpretation — Phase 2 complete 2026-08-16 17:28:44 +00:00
xref feat(pdf): read xref streams and object streams (PDF 1.5+) 2026-08-16 17:10:42 +00:00
generate.py feat(pdf): Unicode-aware search and layout-aware reading order 2026-08-19 16:12:12 +00:00