GridCraft's native workbook format, moved from storytold/gridcraft at
1d0b311b: the `.json`/`.scjson` extensions (crates/engine/src/io.rs), the
reader and its error text (io.rs), and the pretty writer with newer macros kept
unread and appended to `macros` as the file held them
(crates/engine/src/macros/mod.rs json_bytes).
The Workbook model, the index rebuilds after a read, and macro reading stay in
GridCraft. The consumer's golden test shows saved bytes are unchanged.
Part of #778.
The package layer of DeckCraft's native format, moved from storytold/deckcraft
crates/format at 0d5c0b85 (lib.rs, finite.rs): the mimetype and legacy
SlideCraft type, sniffing, the presentation.json envelope (generic over the
app's presentation), the NaN-safe JSON writer (Finite), the reader that patches
null numbers in older files, member names and compression choice, and the
bounded, budget-charged member reads with the format's limits.
The presentation model, repair, media and chart-part mapping, and outline/RTF
stay in DeckCraft. Writes go through craft-zip's deterministic writer; the
consumer's golden test shows the package bytes are unchanged.
Part of #778.
Source: storytold/texturecraft bdbb52c9b66b221a55b370105b42f485a76e6fc7. Preserve chunk framing and output cap policy, with fallible allocation and checked offsets.
* 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>
- craft-media: Mp4Writer counts chunk offsets from the first byte of the
file, not from position 0 of the writer, so a file begun mid-writer is
valid. This replaces the seek adapter the M4A writer wrapped its sink in.
- Tests pin the bytes of the roll sample group and each format's feature.
- Docs: ALAC's length comes from the sample durations, not an edit list;
which readers take an empty AAC file; speaker names as the errors print
them; craft-media's README lists roll_distance.
- Error messages for a layout a format has not no longer suggest setting
a layout that was set.
Refs #1230
EncodeFormat gains Aac and Alac (M4A through craft-media's MP4 muxer) and
Mp3, Ac3 and Eac3 (raw streams), so one call writes any of them from
WAV-order f32 audio and EncodeOptions.
- EncodeOptions::rate_control (with_bitrate, with_quality): a bit rate is
moved to the nearest one the stream can carry; quality is AAC's VBR.
- Channels are mapped onto the codec's order by speaker, from
EncodeOptions::layout. A layout the format has not is Unsupported
instead of reaching the wrong speakers.
- M4A: the edit list skips the AAC priming, and the last sample's duration
is cut so the track ends at the last frame written.
- encode_format_for, ENCODE_EXTENSIONS and EncodeFormat::ALL list the new
formats; aac-encode and alac-encode now turn on craft-media's isobmff.
Refs #1230
Adds crates/texture (craft-texture), the first step of RFC-0032
(storytold/craft-contrib#50). The code comes from MaterialCraft
crates/image/src/lib.rs at 31330629, with its six tests unchanged. No app
uses the crate yet.
Changes from the source:
- Image fields are private; from_data checks the size and the buffer
length, so a zero side can no longer reach a panic and a short buffer
is rejected instead of read with defaults.
- Limits caps the side, pixels and bytes; the try_ constructors and
try_map, try_to_kind, try_resize and try_to_rgba8_display reserve
memory first and return an error.
- Repeat sampling reduces the coordinate to its fractional part, so the
period holds at large coordinates.
- Bilinear sampling sums the four weighted texels and skips zero weights;
box shrinking sums in f64.
- generate_uv clamps the size before computing pixel centers.
- linear_to_srgb(NaN) returns NaN.
- rayon is behind the parallel feature.