The review of wordcraft#6345 found that text in code page 932, 936, 949 or 950
was read a byte at a time, each byte above ASCII becoming U+FFFD, and the file
opened with its characters gone. Such a file is refused as every Word 6.0/95
file was before, until the piece walk decodes byte pairs. The test that
asserted the replacement characters is replaced by one that asserts the
refusal and that the same text in a Western font still opens.
The module comment on the Word 6 stylesheet header now matches the reader (a
u16 header size, then the header), as the other review comment asked.
(cherry picked from commit 92f8dd24d1)
Ported from storytold/wordcraft#6317, #6335 and #6345 (one series): Word 6.0
and Word 95 files are read instead of refused: text in its code page (by font
charset, language and style), character and paragraph formatting, tables and
paragraph styles. Paths follow craft-doc-binary (craft-wordmodel,
craft-codepage, craft-cfb).
(cherry picked from commit aa220afc77)
Port of storytold/wordcraft#3821, whose reader code moved here with storytold/wordcraft#6603. Word's 0.08" cell margin comes from the Normal Table default table style; without a default table style a table that sets no margins (and whose style sets none) has zero margins. The zeros are kept as the table's own, also for the old properties of a tblPrChange, so they survive saving. w:default="on" now marks a default style too.
read_smf_lenient keeps what comes before MAX_EVENTS events or MAX_TRACKS
tracks and only says so in a warning. Those warnings are words, and at
most MAX_WARNINGS of them are kept: when earlier damage has filled them,
nothing tells the caller that the file was cut.
LenientRead gets over_limit, set whenever either limit left something
out, full warnings or not. A caller that refuses over-limit files, as
read_smf does, can now do so after a lenient read. LenientRead is
non_exhaustive, so the new field breaks no caller.
SonarCloud S7688 counts the POSIX [ tests in the Opus vector fetcher. The
script already needs bash for arrays and ${!ranges[@]}, so the tests use
[[ ... ]], which neither word-splits nor globs its operands.
* image-codecs: list InkSet and ExtraSamples on TiffPage
* image-codecs: TiffPage InkSet and ExtraSamples as enums
* image-codecs: InkSet::InkNames, and Invalid for undefined tag values
Measured in Word for Windows: Thai text as a field's result follows the rule ordinary text does. mark_runs_as_word_draws_them counts the result of a field kept as one object as the text of its run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
encode_jpeg_rgb8 wrote the XMP packet straight into an APP1 segment, so a packet past the limit failed the whole encode. It now builds the segment with the shared jpeg::xmp_segment, as the other JPEG paths do, and jpeg_xmp_fits tells callers whether the XMP will be written.
Ported from storytold/lightcraft#3796. The Z 6 and Z 7 join the bodies whose
NikonNEFInfo distortion becomes an OpcodeList3 warp. Three Z 6 and three Z 7
CC0 raw.pixls.us files (NIKKOR Z 24-70mm f/4 S) were matched against the
camera's embedded JPEG: the corrected radial median error is 0.88-0.96 px on
the Z 6 and 1.37-1.46 px on the Z 7, from 83-84 px and 124-125 px uncorrected.
The method and results are in crates/raw/docs/nikon-lens-corrections.md.
DistortionInfo's mode byte must now be 1 (On, optional) or 3 (On, required).
Mode 2 (Off) and unknown modes give no warp, where before only 0 was skipped,
so mode-2 files from the Z 6II, Z 8 and Z f no longer get a warp.
* feat(ps): add craft-ps with an EPS reader (read feature)
The reading half of craft-ps (#115): a clean-room PostScript interpreter
that runs an EPS and returns what it paints as a one-page vector PDF of
its bounding box, colours kept, so apps can draw and export EPS as a
placed PDF. Moved from DesignCraft (storytold/designcraft, where it was
written for placed EPS), with its app-specific names made neutral.
Written from the PostScript Language Reference (3rd ed.), the EPS
specification, the Type 1 Font Format and Adobe TN 5012/5176/5177.
Covers the language, paths, clipping, strokepath, device/Separation/
DeviceN/Indexed/ICCBased/Lab colour, images with lazily decoded filters,
shadings 1-7 and patterns, and Type 1/3/42/CFF/CID text through CMaps,
horizontal and vertical.
Bounded: each operator charges work proportional to its operands
against the step limit as it goes, every byte read or decoded counts,
copies count against the memory cap; defaults 50 M steps / 1 GiB, and
20 M / 256 MiB on wasm32. No panics (deny lints, fuzzed in debug
builds). 34 tests, the Type 42 one on a TrueType font built in the
test. No new external crates: pdf-writer, miniz_oxide, weezl, skrifa
and kurbo are already locked at these versions.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* clippy(ps): document stateful decoder complexity
* fix(ps): bound huge arc angle normalization
* fix(ps): preserve EffectCraft EPS text and limits parity
* fix(ps): address interpreter review findings
* fix(ps): preserve composite glyph paint order
* fix(ps): address interpreter review findings
* fix(ps): bound filter buffers and preserve file aliases
* fix(ps): make predictor allocation fallible
---------
Co-authored-by: markus.doebele <markus.doebele@top21.sh>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>