* fix(render): resolve accented TrueType glyphs across Symbolic flags, Unicode cmaps, post v2.0, and ToUnicode (#2159, #2426)
* fix(render): separate TrueType glyph selection from extraction (#2980)
Restore the existing Symbolic and CFF mapping paths. Keep name-derived Unicode
cmap lookup, post-name aliases, known flag bits, and explicit .notdef handling.
Replace disputed expectations with synthetic glyph/extraction regressions;
the original PDFs in #2159 and #2426 remain unavailable and unverified.
* fix(render): check exact post v2.0 glyph name before suffix-stripped cmap lookup (#2980)
* fix(render): prefer exact post v2.0 name for multi-codepoint AGL glyph names (#2980)
* style: format vendor true_type.rs
* fix(render): keep TrueType vendor patch in upstream style
Restore unchanged upstream formatting around the glyph-mapping fix and use
upstream-default formatting for its new helpers. Preserve the upstream
glyph_name_to_text extraction fallback and every existing functional change.
Validated workspace cargo fmt, git diff --check, and byte-identical rustfmt
canonical output before and after this formatting-only change. The eight
TrueType integration tests passed on the prior head in hosted CI; fresh CI
will validate this follow-up. Local recompilation and optional negative
controls were not attempted because build storage is exhausted.
Full screen can fill the screen edge to edge, fixing the fake full screen
in #379, or keep the normal page display, via a preference. The forms bar
is hidden in full screen. Up-arrow and wheel no longer jump back a page,
and Esc closes one thing at a time (the find bar before leaving full
screen).
Bundles #576, #4273 and #5302.
RUSTSEC-2026-0543 marks every chrono version unmaintained and has no
release to move to. It fails cargo deny on every gate run. It is a
maintenance notice, not a vulnerability.
Add the advisory to [advisories].ignore in deny.toml with justification,
the same way other unmaintained advisories are handled. Replacing chrono
is not a fix for this repository alone: house rules require time to go
through chrono, and craft-libs depend on it. Revisit the ignore when a
successor is chosen in craft-contrib.
Fixes#7647
#5923 made the pptx LibreOffice test and the staging tests build their
folders with a DirBuilder that only Unix sets a mode on. On Windows the
binding is never changed, so -D warnings stops the build with unused_mut
and main's Windows gate is red.
Pinning craft-pdf to the #1852 merge SHA also picked up d74e60b2, which
makes create() and set_encryption() refuse RC4-40 and RC4-128. Tests,
helpers and the protect example that still write those schemes now use
create_legacy and set_encryption_legacy. Edit::Protect does the same
when the chosen algorithm is legacy, so a file that must stay readable
by a reader without AES can still be written.
The parser, serializer and matrices now live in craft-pdf (craft-libs#1852,
pin 8e03cd016d42032b867fef6bad86bc69bf2c1920). pdfcraft-content becomes a
facade, like pdfcraft-cos. The unit tests moved with the implementation;
hayro_sign_tokens stays here. Other craft-libs pins are unchanged.
Real Ctrl events carry both ctrl and command, so a Cmd+Ctrl+M binding,
which the registry tries first, would also match them. The test now
sends that shape on Windows instead of the command modifier alone.
Bind comment.list to Ctrl+M (Cmd+M on macOS). The command opens the
panel rather than toggling it, so pressing it with the panel already
open keeps it open. The binding comes from the command registry, so the
View menu, the palette and Help > Keyboard shortcuts show it.
* Search field receives a focus request
* Find keeps an IME composition when the find field already has the keyboard
Selecting the query on Find made the next IME update replace the whole
query when the field was composing: egui replaces the selected range,
and only egui can end a composition from inside the field. The query is
now selected only when the field takes the keyboard from elsewhere, in
one helper for the find bar and the Search panel.
* Test that the Search panel keeps an IME composition when asked for the keyboard again
* A repeated Find selects the query while the field has the keyboard
`owns_ime_events` is only `has_focus` on the pinned egui, so a second Find
while the find field (or the Search panel field) still had the keyboard
kept the caret and typing appended to the old query. Follow the IME
composition from the field's own events and cursor instead: a non-empty
pre-edit starts it, a commit or empty pre-edit ends it, and any other edit,
click or loss of focus ends it too. Only a live composition keeps the
selection; every other Find selects all of the query.
Tests: a repeated Find with the keyboard still in the field, for both
fields, and a Find after a committed composition.
---------
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
* Add Bosnian (bs) to the interface languages
bs.tsv: Bosnian (Latin script, Ijekavian) catalog covering every key of
PdfCraft's other catalogs, its wording shared with storytold/craft-i18n
locales/bs/ and the strings craft-i18n lacks translated new. Every bs-*
locale selects it; counts use one/few/other. Locale and plural tests,
localization docs and an attribution entry (AI-assisted, not yet
reviewed by a native speaker).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z
* Bosnian: date-format language, English picker name, word-count ellipsis
Preferences > Date format offers exactly the interface languages, so
Bosnian gets its month and day names there; the picker falls back to
"Bosnian" when no face can draw the native name; Word Count keeps the
command label's trailing ellipsis.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z
* bs: wording from the craft-i18n catalog review
The Bosnian catalog review (storytold/craft-i18n#72) asked for one word
per concept; this catalog follows: pan is "pomjeranje" (not
"pomicanje"), a spreadsheet is "proračunska tabela", Greek & Cyrillic
reads "Grčko pismo i ćirilica". Placeholders and ellipses are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z
* bs: take the catalog from craft-i18n, keep only PdfCraft's code
PdfCraft now reads its translations from storytold/craft-i18n (#6055),
and this PR's Bosnian rows are there (storytold/craft-i18n#141, in the
pinned commit), so crates/ui-egui/src/i18n/bs.tsv goes. What stays is
PdfCraft's part, redone against the new registry: the bs row in
LANGUAGES, "Bosnian" as its English picker name, Bosnian date names,
locale, persistence and one/few/other plural tests (Bosnian follows the
Russian rule in the legacy rule table), and the docs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z
* docs: Bosnian revision row in the revision history; language totals
The 2026-11-04 Bosnian row had landed in the key-languages table instead
of the revision history; it is now the history's first row. The summary
counts 21 other languages, 35 catalogs plus English, 36 in Preferences,
as LANGUAGES lists.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Tayw8nmxoLLmKv13jK93z
* Docs: list bs as a ui.set / ui.state language value
---------
Co-authored-by: Claude <noreply@anthropic.com>
This reverts commit 5410dc1c. The XFA prototype-walk optimization is
unrelated to the #778 Base64 cutover; keep it for its own PR with a
measured benchmark (craft-libs#778 consumer PRs stay single-purpose).
* M2: a JPX image on a rotated page draws instead of crashing (#3884)
The decode-size hint `image_draw_size` hands hayro-jpeg2000 mapped the
image's corners (w, 0) and (0, h) as points, so it took in the
translation. On a /Rotate 90 page (Acrobat Paper Capture scans) one
corner lands on the device origin, the hint gets a side of 0, and
hayro-jpeg2000 0.3.5 divides the image size by it: "renderer crashed on
page N: attempt to divide by zero" on every rotated JPX page.
The hint now comes from the transform's linear part (the axis lengths
the preview tiny-image check already used, now computed once), and each
side is at least 1. As a side effect, translated JPX images no longer get
an overestimated hint, so they can decode at a reduced resolution level
when drawn small, which is what the hint is for.
Regression test: a 1x1 JPX image filling a 40x40 page at /Rotate 0, 90,
180 and 270, rendered at 0.5x, 1x and 1.5x. It fails before the fix
(/Rotate 90 at 0.5x: attempt to divide by zero) and passes after.
Supersedes the guard in #1883 and does not depend on the hayro-jpeg2000
bump in #2309; both are open and conflicting with main.
Fixes#3884
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C19EMwwBCMSkqew7KepPV2
* M2: decode an offset JPX image area at full size (#3884 review)
hayro-jpeg2000 0.3.5 places a reduced resolution's samples using the
image area's reference-grid offset (XOsiz, YOsiz) unscaled. When a size
hint skips a level, an offset image either loses rows (offset 7, 7: no
reduced row is copied) or is sliced past a reduced row and panics
(offset 7, 0: "range start index 3 out of range for slice of length 2"
at decode.rs:486). The accurate hint from the previous commit makes
reduced decoding more common, so this matters more now.
filter::jpx::decode now passes the hint only when both offsets are 0,
read from the SIZ segment of a raw codestream or a JP2 jp2c box;
codestreams without an offset keep reduced decoding.
Tests: jpx_size_hint_is_dropped_only_for_an_offset_image_area fails
before the fix (the panic above, and 2x2 instead of 4x4 for the other
offsets) and passes after; the (0, 0) case pins that reduced decoding
is kept. image_area_offset_reads_raw_codestreams_and_jp2_files covers
raw, JP2 and truncated inputs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C19EMwwBCMSkqew7KepPV2
* M2: pin invalid /Rotate values in the rotated JPX test (#3884 review)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C19EMwwBCMSkqew7KepPV2
* M2: restore the /UserUnit test's rotations (#3884 review)
7928399 widened the rotation list in the rotated-JPX test with a sed that
also matched the identical loop in user_unit_scales_the_page_and_everything_on_it,
which then failed on /Rotate 45. Only the JPX test was meant to change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C19EMwwBCMSkqew7KepPV2
* M2: decode a colour-keyed JPX image at full size (#3884 review)
A colour-key /Mask (ISO 32000-2 8.9.6.4) is matched against the decoded
samples in resolve_alpha. A JPX image decoded at a reduced resolution for
the size hint has wavelet low-pass averages instead of its samples, so
keyed pixels next to unkeyed ones turned opaque, and unkeyed averages
could fall in the key range. The accurate hint from the first commit
makes reduced decodes more common.
ImageXObject::decoded_raster now drops the hint when a colour key is the
image's mask (no /SMask stream and no /SMaskInData 1, the precedence
resolve_alpha uses), so it is decoded at full size and resampled with its
mask like an image under any other filter. A /SMask keeps the reduced
decode. The decode cache key follows, since it is built from the same
hint.
Test: jpx_with_a_colour_key_mask_is_decoded_at_full_size decodes a 4x4
one-level JPX image with a 2x2 hint: without a mask, with /Mask [0 0],
and with /Mask [0 0] plus /SMask. The /Mask case gave 2x2 before the fix
and gives 4x4 after; the other two stay 2x2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C19EMwwBCMSkqew7KepPV2
* M2: pin a colour-keyed JPX image's transparency as drawn (#3884 review)
The colour-key test checked the size the image was decoded at. This one
checks the page: a 4x2 JPX checkerboard of samples 0 and 1 with
/Mask [0 0], drawn over red at 2x1 pixels, where the size hint skips a
resolution level. Half of each pixel's samples are keyed, so both pixels
come out half red (128, 1, 1).
With the fix in decoded_raster reverted, the reduced decode's averaged
samples no longer match the key and the image covers the red: both
pixels are (1, 1, 1) and the test fails.
The codestream is the one inside the 4x2 JP2 fixture in hayro-syntax's
filter::jpx tests.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
## What this changes
A JPEG 2000 image is now refused when its codestream's SIZ marker declares more than 2^28 pixels, the same cap `image_size_ok` applies to `/Width` x `/Height`. The check runs in `vendor/hayro-syntax/src/filter/jpx.rs` on the header read at full resolution, before `Image::decode` (which makes the infallible allocation), and fails the same way as other undecodable images. It uses the full-resolution size because a `target_resolution` shrinks the reported `width()`/`height()` but each tile's coefficient buffers are still allocated at full size (review on this PR); the header is then re-read at the target resolution only when one is set. Logged as hayro-syntax patch (36) in `vendor/README.md` (main has since taken 29-35).
Fixes#5078
## How you verified it
`cargo fmt --check` and `cargo clippy --all-targets -- -D warnings` are clean on `pdfcraft-render` (which compiles the vendored hayro-syntax). Regression tests in `jpx.rs`'s `tests` module, adopted from the reviewers' patches:
- `a_codestream_over_the_pixel_cap_is_refused` (croquete1): a `/Width 1 /Height 1` image whose single-tile codestream declares 65536 x 65536 (2^32 pixels) returns `None` from `jpx::decode`, with and without a 1x1 target resolution (the target case has four decomposition levels, so the target really shrinks the reported size to 4096 x 4096, under the cap); the same builder at 1x1 decodes, so the `None` is the cap, not a parse error.
- `jpx_size_guard_uses_full_resolution_before_target_resolution` (Harrison-Booth): `decode` delegates to `decode_with_pixel_limit`, so a 1024-pixel limit can show that a 64x64 image with four decomposition levels, which a 1x1 target decodes under 1024 pixels, is still refused at that target. The first version used `PALETTE_JP2`, which a target can't shrink (its JP2 palette makes hayro-jpeg2000 drop the target, and it has no decomposition levels), so it passed with the check measuring the target size; the current one was seen failing at that assertion with the header read at the target resolution before the check, and passing with the fix.
The vendored crates are excluded from the workspace, so CI's `cargo test --workspace` doesn't run these unit tests. They were run on a copy of `vendor/hayro-syntax` (with the vendored `hayro-jbig2` patched in): `cargo test --lib filter::jpx`, 12 passed.
- [x] `cargo fmt --check`
- [x] clippy with `-D warnings` on the crates I changed
- [x] tests pass on the crates I changed
## Anything a reviewer should look at first
- `Image::new` only parses the header (croquete1 measured the 65536 x 65536 single-tile case at about 0 ms), so the cap runs before any coefficient buffer is allocated.
- `u64::from(width) * u64::from(height)` can't overflow (two u32 values). Component and tile counts aren't bounded here; that's a separate allocation path, outside #5078.
- `MAX_PIXELS` is a local constant. The shared `MAX_IMAGE_PIXELS` lives in `hayro`, which hayro-syntax can't depend on.
- rustfmt wasn't run over `jpx.rs` (the vendored crate is outside the workspace, and the workspace config would reformat older blocks). The new lines are formatted by hand.
## What this changes
On the web build, `PdfCraftApp::open_url` now opens links with `window.open(url, "_blank", "noopener,noreferrer")` via `web-sys`, instead of `egui::OpenUrl::new_tab`. eframe opens new tabs without features, which gave the opened page a `window.opener` handle it could use to navigate the PdfCraft tab. Every app-level open goes through `open_url`: document links, button URI actions, `app.launchURL`, help links and the releases page. Desktop builds are unchanged.
The web packaging now sends `Cross-Origin-Opener-Policy: same-origin`: `_headers`, `.htaccess`, and the nginx example in `packaging/web/README.md` (`HOSTING.md`), whose old "doesn't need COOP" note is rewritten.
Fixes#5084
## How you verified it
`cargo fmt --check` and `cargo clippy --all-targets -- -D warnings` are clean on `pdfcraft-ui-egui`, including the review fixes. Tests not run yet; CI runs them. `cargo check -p pdfcraft-ui-egui --target wasm32-unknown-unknown` passes too, with no warnings in `links.rs`.
- [x] `cargo fmt --check`
- [x] clippy with `-D warnings` on the crates I changed
- [ ] tests pass on the crates I changed
## Anything a reviewer should look at first
- COOP `same-origin` has no effect inside an iframe, so the `postMessage` embedding bridge is unaffected. A page on another origin that opens PdfCraft with `window.open` does lose its window handle. Nothing in the repo does that.
- Not covered: `dialogs/credits.rs` uses `ui.hyperlink_to` for fixed GitHub URLs, which on the web may open in the PdfCraft tab itself.