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>
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>
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>
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.
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.
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.
* 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
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.
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
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.
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.
`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.
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.
* 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>
* 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>