Commit Graph
156 Commits
Author SHA1 Message Date
FredApps a2cdfdb2fb Merge branch 'main' into fix/cjk-vertical-forms 2026-11-26 10:22:00 +01:00
BFlat fa912e0b95 Merge pull request #2157 from dotCooCoo/feat/raster-image-color-space
hayro-interpret: RasterImage::default_color_space reports each draw's default space
2026-11-26 10:32:34 +07:00
BFlat fa3d028bba Merge pull request #2016 from dotCooCoo/fix/codec-image-pixel-limit
hayro-syntax: the CCITT and JPEG 2000 decoders apply the document's pixel limit
2026-11-26 10:30:13 +07:00
BFlat 22a29fc058 Merge pull request #675 from dotCooCoo/fix/linesweeper-coincident-touch-rescan
linesweeper: exact copies of a shape no longer rescan the bundle for every touch
2026-11-26 10:19:12 +07:00
BFlat 3a33bfbf40 Merge pull request #658 from dotCooCoo/fix/linesweeper-sweep-doc-crossing-t
linesweeper: the crossing height in docs/sweep.typ divides the starting gap
2026-11-26 10:17:59 +07:00
BFlat 5632c89adf Merge pull request #729 from dotCooCoo/fix/linesweeper-transversal-negative-dy
linesweeper: curves that cross just after a shared start are not reported as ordered
2026-11-26 10:14:01 +07:00
alehelandClaude Opus 5.5 a5a72f1fe6 hayro-interpret: a script that lists no vertical feature leaves the choice to the next
The search for a face's vert lookups took the first script with a default
language system, even one that lists no vert or vrt2: a kana that lists
horizontal features only hid DFLT's vert, and the vertical CID drew its
ordinary glyph. A script now counts only when it lists a vertical feature that
has lookups; else DFLT's applies, else every one of the face.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 12:01:31 +01:00
aiongg 2476d07bdd Merge remote-tracking branch 'upstream/main' into next-sync-1124
# Conflicts:
#	.github/workflows/workspace.yml
#	Cargo.lock
#	crates/font-manager/Cargo.toml
#	crates/font-manager/README.md
#	crates/font-manager/src/lib.rs
#	crates/font-manager/src/panel/app.rs
#	crates/font-manager/src/panel/browse.rs
#	crates/font-manager/src/panel/details.rs
#	crates/font-manager/src/panel/faces.rs
#	crates/font-manager/src/panel/mod.rs
#	crates/font-manager/src/store.rs
#	crates/font-manager/tests/flows.rs
#	crates/font-store/src/language_packs.rs
#	crates/font-store/src/lib.rs
#	crates/font-store/src/store.rs
#	crates/font-store/src/tests.rs
2026-11-24 05:26:41 +00:00
alehelandClaude Opus 5.5 0bc0be34a1 hayro-interpret: the UCS-2 CMaps alone tell vertical forms when the UTF-16 ones are missing
A caller's CMap resolver may lack the UTF-16 -H/-V pair, or it may fail to
parse; the UCS-2 pair then still decides which CIDs are vertical forms. The
UTF-16 horizontal-CID check still applies when that pair is readable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 16:00:59 +01:00
alehelandClaude Opus 5.5 341c1dc91a hayro-interpret: a non-embedded CJK font draws vertical CIDs in their vertical forms
Port of storytold/pdfcraft#7665 (PdfCraft patch 107, storytold/pdfcraft#7167).
For a font of an Adobe CJK collection that the PDF doesn't embed, a CID that the
collection's -V CMap gives for its character, where the -H CMap gives another
(UTF-16 CMaps, then UCS-2 for the forms only they name), draws the substitute's
glyph through its GSUB vert lookups (vrt2 when it has no vert), honouring a
language system's required feature. Embedded fonts and text are unchanged.

The tests are adapted to craft-pdf's interpretation tests, with the fonts-build
fixture Tiny-glyf.ttf as the substitute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 12:47:34 +01:00
FredApps d69bdaf0b3 style: drop rustfmt churn on the rest of context.rs
The first commit had run rustfmt with the workspace max_width on the
whole vendored file. This keeps only the patch 89 behaviour change and
the regression tests.
2026-11-23 08:52:26 +07:00
FredApps 9fcd7ea22d hayro-interpret: a form that draws itself is not content-truncated
Patch 89 still skips a form already on the drawing stack (ISO 32000-2
§8.10.1). Reporting that skip as InterpreterWarning::ContentTruncated
made VectorCraft reject legitimate knockout-mask PDFs after the #2472
pin, because a soft mask may paint a form already being drawn. The skip
stays; the truncation flag does not.

Refs storytold/craft-libs#778.
2026-11-23 08:51:58 +07:00
bflatastic 03df09a1c3 hayro-interpret: a soft mask's group draws within the forms where the mask was set, so a mask drawing the form it masks is not a form drawing itself 2026-11-22 23:28:59 +07:00
David MannandClaude Opus 5.5 1929e79ebb Merge storytold main into next (20 Nov, second sync)
Merges main at 8f92ed1334 (#2550 and the rest of main since the 20 Nov sync).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 16:38:55 +01:00
Dylan M. Taylor 9eb02be84f Merge pull request #2546 from dylanmtaylor/feat/pdf-max-coverage
feat(pdf): enforce max_coverage budget via vendored vello_cpu 0.0.8
2026-11-20 08:27:48 -05:00
Dylan M. Taylor c470ed170d hayro-interpret: restore FormXObject RESOURCES presence check and Indexed image recovery in x_object.rs (#2497)
* hayro-interpret: port remaining pdfcraft resource-scope, indexed-image, and text-clip patches

* hayro-interpret: keep craft-libs resource-scope and text contracts; retain x_object.rs fixes
2026-11-19 23:46:01 -05:00
dotCooCoo 7ca2a37101 hayro-interpret: SOURCE.json records the committed files' hashes
The sha256 of 25 entries no longer matched the committed files after
the merge of main: the three files this branch changes
(src/interpret/mod.rs, src/types.rs, src/x_object.rs) and 22 files
that #2472 changed. Each value is now the SHA-256 of the committed blob.
2026-11-19 19:27:19 -08:00
dotCooCoo 970388d546 Merge main into fix/codec-image-pixel-limit 2026-11-19 19:08:23 -08:00
dotCooCoo 713128f9da Merge main into feat/raster-image-color-space 2026-11-19 19:07:44 -08:00
Dylan M. Taylor c8087acbd9 hayro*: port pdfcraft vendor/hayro* patches (#2472)
* hayro*: port pdfcraft vendor/hayro* patches (storytold/craft-libs#778)

* hayro-syntax: fix test and merge compile errors from port

* fix(hayro-syntax): avoid moving params.control in lzw_flate test

* fix(hayro-syntax): include early_change in lzw_flate test

* hayro*: fix hayro-interpret compile errors and hayro-syntax test failures

* hayro*: fix duplicate char_code_to_unicode and super::LETTER in test

* hayro-syntax: fix predictor cancellation and ArrayIter parse failure tests

* hayro-syntax: restore bit-level PNG predictor fallback when control is set

* hayro-syntax: support Checkpoints cancellation inside unfilter_png

* hayro-interpret: remove duplicate blob::tests and require hayro-syntax 0.7.2

* hayro-interpret: cast MAX_COLOR_SPACE_DEPTH u32 as usize in test

* hayro: drop unvendored vello_cpu set_max_coverage/coverage_full calls

* hayro-interpret: restore interpret_form_contents call and TextPass order

* hayro-interpret: split ExtendedWarning out of InterpreterWarning for vectorcraft compatibility

* hayro-interpret: clone extended_warning_sink before ImageXObject::new closure

* hayro-interpret: restore OP/op/OPM ExtGState handling for overprint

* hayro-interpret: restore DecodeLimits and truncation reporting in decode_content

* hayro: restore on_plate DefaultColorSpaces bypass and cmyk_luminosity soft mask
2026-11-19 21:57:15 -05:00
Martin Ball 6dedbe4fe6 skeleton: merge up/next into area/ribbon-fw with conflict markers left in (land step 1) 2026-11-19 20:42:08 +00:00
aiongg ca58dfe6c9 Merge storytold main into next (19 Nov sync)
Merges main at d7c9632bfb.

- Cargo.toml: both sides' new workspace crates (next's font-subset, harfbuzz-subset-sys and
  host; main's gpu, gpu-null, gpu-providers and gpu-wgpu).
- crates/jpeg: next split lib.rs into modules; main's reduced-size decoding goes to them: the
  scaled IDCT, reconstruction and render_scaled to idct.rs, MAX_SHRINK, reduced_estimate and
  decode_reduced stay public in lib.rs. Main's new test added; the frame test next removed
  stays removed.
- crates/audio, crates/media: next builds the integration tests into the library's test
  executable (autotests off, tests/main.rs); main's new DSD and MPEG-TS mux tests are modules
  there behind their features instead of [[test]] targets, and the mux tests reach their shared
  helper module through the integration module.
- crates/media/src/matroska/track.rs: main's new FFV1 codec-parameter test added; the test
  modules next removed stay removed.
- crates/file-formats: main's JXL capability test, which asks the codec whether JXL reads,
  replaces next's interim check.
2026-11-19 16:22:24 +00:00
mtlcl410 d2a7d88d2e hayro-postscript: a \ddd escape above \377 keeps its low eight bits (#2321) (#2324)
A literal string's octal escape was converted with `u8::from_str_radix`,
which fails above 0o377, so the byte was dropped. Read one to three octal
digits into a u16 (at most 0o777) and push the low byte, as ISO 32000-2
7.3.4.2 and the PostScript Language Reference (third edition, 3.2.2)
specify: "high-order overflow shall be ignored". Escapes up to `\377`
decode as before.

Record the patch in SOURCE.json and vendor/README.craft-reader.md.

Fixes #2321
2026-11-18 23:20:45 -05:00
Dylan M. Taylor 07d5165036 hayro-postscript: add Scanner::parse_object_or_skip (#2287) 2026-11-18 18:59:47 -05:00
Martin Ball b21c69300c Contract stubs: craft-codepage craft-i18n craft-host craft-quit craft-theme craft-keymap craft-behavior craft-settings craft-platform 2026-11-18 08:01:14 +00:00
dotCooCoo d53c84d01b hayro-interpret: RasterImage::default_color_space reports each draw's default space
An image drawn where a /DefaultGray, /DefaultRGB or /DefaultCMYK is in scope
is drawn in that default, and the same image drawn elsewhere is not. A device
receiving the image could not tell the two draws apart.

RasterImage::default_color_space returns the default space a draw uses in
place of the image's device space, with the cache key of the object it was
read from, or None when the draw uses the image's own space. An inline image
that names a /ColorSpace resource that is a device space reports the default
substituted for it too.
2026-11-17 19:29:27 -08:00
aiongg ac3dfd1f53 Merge storytold main into next (17 Nov sync)
storytold main 83cb1133dd (291 commits) into the integration head bab1a99b85; 47 conflicted files.

- Domain test files (metafile, prepress, pdf plates, settings store, heif, media-testkit, atomic): tests next cut stay cut; tests new on main are kept, as trials where the crate's test target runs trials.
- atomic: main's group-bits test and Faulty::set_group go to src/tests.rs. audio: main's GSM and SBC oracles join tests/main.rs. cms constructors, pdf knockout_backdrop and testing_pdf join their crates' one test binary; timeline's preflight tests become src/preflight_tests.rs trials.
- update: main's changes to detect, install (linux, macos) and the tests land in next's split modules. The app's own offer is inspected on a thread of its own, picked up by tick's polling; settle_for_tests settles offers too. Later on a ready update drops the close it asked for. updater_pin_tests.rs stays deleted; its new pin test is in tests/it/update.rs.
- craft-color: main added a different crate at crates/color (the colour tags of compositor and display frames); it is next's craft-color module `tags`, re-exported at the root.
- Old crates/ui (combo, docking, testing, README) and keymap's ui/view.rs stay deleted; main's new crates/ui/src/testing files are dropped with them.
- New crates in the craft facade: ai, control, dds, frame, ipc, media-source, palette, press-print, score, ssip. testkit and xtask are listed outside it.
- Cargo.lock: the union of both locks, resolved by cargo metadata. Workflow: main's nextest Windows leg, with next's --keep-going clippy.
2026-11-17 12:44:52 +00:00
dotCooCoo 01a4aca8eb hayro-syntax: the CCITT and JPEG 2000 decoders apply the document's pixel limit
`DecodeLimits::with_max_image_pixels` raised the interpreter's check, but the
CCITT and JPEG 2000 filters kept a fixed cap of 2^28 pixels, so an image
between the two limits passed the interpreter and then failed to decode.
Both filters now take the document's `max_image_pixels`: CCITT for its size
check and for the rows decoded when the height is unknown, JPEG 2000 for the
codestream's dimensions. `ccitt_size_ok` keeps the 2^28 default. JBIG2 keeps
its own 2^28 cap.
2026-11-16 21:46:10 -08:00
dotCooCoo 6e9efbdba1 Merge main into fix/linesweeper-transversal-negative-dy 2026-11-16 19:26:45 -08:00
dotCooCoo b86124fc93 Merge main into fix/linesweeper-coincident-touch-rescan 2026-11-16 19:02:34 -08:00
dotCooCoo 1f71c86ad5 Merge main into fix/linesweeper-sweep-doc-crossing-t 2026-11-16 19:00:16 -08:00
.CooCoo 47153d5bec linesweeper: the vendored copy passes clippy 1.100.0 with every feature (#1248) 2026-11-16 21:37:04 -05:00
.CooCoo 5724da0f2e linesweeper: short chords at huge x and subnormal line x stay finite and exact (#1258) 2026-11-16 21:36:59 -05:00
Ken Mantle b8eaa8e2f3 pdf: blend each element of a non-isolated knockout group with its backdrop (#1137) 2026-11-16 21:32:26 -05:00
.CooCoo ff5a8af742 hayro-syntax, hayro-interpret: callers set the image byte and pixel limits (#1901) 2026-11-16 21:30:21 -05:00
aiongg dffc61a7e0 Merge storytold main 832883b5 (sync 16 Nov)
961 upstream commits since 7bb6c900. Resolutions:
- Test-only conflicts: upstream tests from before the base that our side
  cut stay cut; tests new upstream are kept (audio aac/config, layout,
  encode_format; cms lutfile; media mux; print windows_native, ticket;
  update self_update; xml hostile).
- Code our side moved, with upstream's change carried to the new place:
  craft-media mux roll sample groups (mux/boxes.rs) and writer-start
  offsets with overflow checks (mux/progressive.rs); craft-print's
  shrink-to-fit scale guard (sheets/plan.rs); craft-update's nextest
  archive detection (self_update/detect.rs); craft-vectorcraft-format's
  Tail::write_to_with (container.rs); craft-i18n's pedantic fixes
  (bidi.rs, negotiation.rs).
- craft-ui: the old crate's modules stay removed; gpu_test_lock guarded
  their per-test wgpu renderers, which the snapshot kit does not have.
- New upstream tests in crates that build their integration tests into
  the library's test executable are modules of tests/main.rs (audio
  flac_decode and qoa_oracle, cms, docpath, pcraft-format,
  vectorcraft-format).
- The 22 new crates are optional members of the craft facade.
2026-11-16 01:52:09 +00:00
Dylan M. Taylor abe4aca262 vendor: record the hayro-syntax transmute as an audited exception 2026-11-14 14:44:00 -05:00
Dylan M. Taylor b6b222afb0 fix(prepress): address PDF/X review findings 2026-11-14 17:45:53 +00:00
dotCooCoo c599e9485c Merge main into fix/linesweeper-transversal-negative-dy 2026-11-14 09:11:24 -08:00
dotCooCoo d9c81f3c2f Merge main into fix/linesweeper-coincident-touch-rescan 2026-11-14 08:56:51 -08:00
dotCooCoo 85d7690235 Merge main into fix/linesweeper-sweep-doc-crossing-t 2026-11-14 08:48:10 -08:00
aiongg 7808f7f6d2 Lints: fix clippy, rustdoc and test findings (shadowed f32 module, unused import, private doc link, struct-update defaults, test attributes lost in the 13 Nov sync) 2026-11-14 00:15:29 +00:00
dotCooCoo b7af29fe55 Merge main into fix/linesweeper-transversal-negative-dy 2026-11-12 23:06:26 -08:00
dotCooCoo 81301d3225 Merge main into fix/linesweeper-sweep-doc-crossing-t 2026-11-12 22:51:46 -08:00
dotCooCoo 63751aceaa Merge main into fix/linesweeper-coincident-touch-rescan 2026-11-12 13:02:18 -08:00
dotCooCoo 32ffa0b58a Merge main into fix/linesweeper-sweep-doc-left-scan 2026-11-12 09:02:06 -08:00
dotCooCoo 7c9a633bba Merge main into fix/linesweeper-transversal-negative-dy 2026-11-12 08:43:25 -08:00
dotCooCoo facd8f7546 Merge main into fix/linesweeper-sweep-doc-crossing-t 2026-11-12 08:32:28 -08:00
Hamza NaveedandHamza 75af6f589a PDF interpret: a glyph shown in a clipping mode clips even with no outline
* PDF interpret: a glyph shown in a clipping mode clips even with no outline

A glyph shown in a clipping render mode (`4 Tr` to `7 Tr`) adds its outline to
the clipping path, and that clip applies to everything painted after `ET` until
the enclosing `Q`. When the glyphs shown have no outline -- a space, say -- the
clip they contribute is empty, and an empty clip admits nothing.

`interpret_window` applied a clip only once a glyph had contributed an outline,
so such a text object applied *no* clip and what followed painted unmasked.

A text object that shows no glyph at all is a different case and is left alone:
the clipping path is unchanged there, as readers leave it, and a glyph whose
outline is unavailable (Type 3) leaves the real clip unknown, so both stay
unclipped. pdf.js draws the same line in `endText`: it builds the clip from the
glyphs shown, empty outlines and all, and applies none when none were shown.

Measured on a page filled red behind the text object, Preview (CoreGraphics)
and Firefox (pdf.js) agreeing on the case this changes:

    a space shown in 7 Tr    before: the fill paints   after: nothing paints
    no glyph shown in 7 Tr   unchanged: the fill paints

Companion to storytold/pdfcraft#3451.

The first push of this branch also carried 803 build-artifact files from
`crates/pdf/read-only-contract/target/`, which `.gitignore` did not cover: its
`/target` is anchored to the repository root, so a sub-crate's own build
directory is not ignored. Recommitted without them, and `target/` added so the
next one cannot slip in either (#185 review).

* pdf: test visible glyphs in a clipping mode, and what each clip leaves on the page

---------

Co-authored-by: Hamza <mail.hamzanaveed@gmail.com>
2026-11-12 10:38:02 -05:00
Hamza NaveedandHamza 9b7b748fbb krilla: TrueType subsets keep the font's OS/2 table (embedding permissions)
* krilla: TrueType subsets keep the font's OS/2 table (embedding permissions)

The subsetter writes only the tables it subsets, so a FontFile2 program
had no OS/2 table and the font's embedding permissions (OS/2.fsType)
never reached the PDF: a Preview & Print or Restricted font looked
unrestricted to anything reading the file later (designcraft#1781).

Patch 18 adds the source font's OS/2 table, byte for byte, to a
TrueType subset that lacks one, rewriting the table directory with its
checksums and head.checkSumAdjustment. CFF programs are still embedded
bare. Ledger, patch file and SOURCE.json updated; craft-pdf's new
font_tables test checks the table, its fsType and the font's checksums.

* krilla: the OS/2 test checks the embedded program is a subset

Its sfnt and re-read checks also pass for the source font embedded whole. A subset has fewer glyphs than the fixture's 11, and a shorter glyf.

---------

Co-authored-by: Hamza <mail.hamzanaveed@gmail.com>
2026-11-12 10:36:53 -05:00