Files
cbf6840b10 Add craft-ppt-binary: DeckCraft's PowerPoint 97-2003 reader on craft-cfb and craft-pptx (#2316)
* ppt-binary: open PowerPoint 97-2003 .ppt/.pot/.pps files

New crate deckcraft-ppt (L3), written from the public [MS-CFB], [MS-PPT]
and [MS-ODRAW] Open Specifications: a compound-file reader (ported from
FilmCraft's clean-room reader), the edit chain and persist directory, and
the OfficeArt drawings. Main masters become masters (colours, fonts, text
styles, background, decorations), title masters become layouts; slides
keep their shapes (presets, freeforms, groups, rotation, flips), fills,
lines, shadows, pictures (PNG, JPEG, DIB, TIFF, EMF, WMF), text with the
master styles resolved into it, fields, notes and hidden flags.

Import only: an opened .ppt has no save path, so Save asks for a new
name. A .pps from the system starts the slide show. File dialogs, drag
and drop, the web shell and the macOS, Windows and Linux file
associations offer the three extensions. Tests build .ppt files from
records and sweep hostile input.

From storytold/deckcraft@0aef89cb1a (storytold/deckcraft#1137).

* ppt-binary: address review: budget picture decoding, read each persist directory once, macOS .pot/.pps types

- Pictures decode lazily, when a shape first uses them, each at most once and all
  within a shared 4 GiB budget: many store entries pointing at one deflated blob
  can no longer ask for unbounded memory.
- A persist directory named by many edits is read once.
- Info.plist declares com.microsoft.powerpoint.pot and .pps alongside .ppt.

From storytold/deckcraft@9e575ccecc (storytold/deckcraft#1137).

* ppt-binary: address review: check the picture budget before copying bitmap data

From storytold/deckcraft@470a429392 (storytold/deckcraft#1137).

* ppt-binary: build against current main

- convert.rs: set `flip: None` on imported gradients. `Gradient` gained the field in
  ad97533a; None is what an unflipped gradient was before.
- tests.rs: split `imports_a_presentation` into one check per section (title, picture,
  group, text box, master) for the workspace `cognitive_complexity` lint (6ddd2fb8).
  The assertions are unchanged.
- Cargo.lock: deckcraft-ppt takes the workspace version, 0.15.0.

From storytold/deckcraft@a0ececefeb (storytold/deckcraft#1137).

* ppt-binary: keep the picture budget on 32-bit targets

`MAX_TOTAL` was `4 << 30` as a `usize`. On wasm32 that is 2^32, which wraps to 0
without any error, so the web build's picture budget was zero and every .ppt
picture was dropped. Use the address space as the limit there. A compile-time
assertion that the budget holds at least one picture keeps it from happening
again on any target: the CI wasm step (`cargo check`) now fails if it does.

From storytold/deckcraft@4fd930ce1a (storytold/deckcraft#1137).

* ppt-binary: read past the character fields PowerPoint 2002 and later add

A TextCFException can end with pp10runid (mask bit 20), newEAFontRef (24),
csFontRef (25) and pp11ext (26), after `position`. read_cf stopped at
`position`, so in a StyleTextPropAtom the next run's count and mask were read
from the leftover bytes, and every later run got garbage formatting or the
walk ended. Master text styles go through the same reader. The fields are
read past and not used. The test has a run carrying all four followed by a
bold 18 pt run, which now reads as written.

From storytold/deckcraft@773af639c9 (storytold/deckcraft#1137).

* ppt-binary: convert each listed object once and index notes pages

Nothing stopped a slide list from naming one persist object many times, and
each listing converted its whole drawing again: a 100k-shape slide listed
180k times fits in about 10 MB and makes 1.8e10 shapes. An object is now
listed once across the slide, master and notes lists (PowerPoint never lists
one twice), and a repeat is logged and skipped. Notes pages are looked up
through a map built once, instead of a scan per slide (slides x notes). The
first matching page still wins.

From storytold/deckcraft@b3aa0983bd (storytold/deckcraft#1137).

* ppt-binary: find formatting runs by binary search

paragraphs() found the run at a position (rposition) and the next run start
(find) by scanning the run starts for every run, break and field, so text
cost grew with chars x runs. The starts are a running sum and never
decrease, so both lookups are now partition_point. Measured in a debug
build, 640k one-character runs (about 6 MB of file): 75 s before, about 2 s
after. The test uses a 20 s bound, like render's pathgrad budget test.

From storytold/deckcraft@b70b022362 (storytold/deckcraft#1137).

* ppt-binary: cap decoded pictures at the .pptx package total

The picture budget was 4 GiB, so a few MB of small deflated metafiles, each
inflating to 64 MiB, could make the import hold 4 GiB. A .pptx package may
inflate to 2 GiB in total (deckcraft-pptx opc MAX_TOTAL), and pictures are
the only part of a .ppt this crate inflates, so use the same 2 GiB. That also
fits a 32-bit usize, which replaces the wasm32 special case. This is a limit
change, so there is no new test: the budget test
(the_store_decodes_lazily_within_a_budget) and the compile-time check that
the budget holds a picture still cover it.

From storytold/deckcraft@a9cefff8b8 (storytold/deckcraft#1137).

* ppt-binary: fall back to the first main master the same way every time

A slide naming a master that doesn't exist fell back to the lowest index in
the masters HashMap. A title master is stored with its main master's index,
so the two tied and the HashMap's random order picked one: the same file got
the "Title Master" layout on some opens and the main master's on others. The
fallback now considers main masters only. The test opens such a deck 30
times; before the fix it took the title master's layout within those opens.

From storytold/deckcraft@60942d5950 (storytold/deckcraft#1137).

* ppt-binary: try the edit scan before calling a file too old

Any Current User token other than the plain or encrypted one, including none
at all from a truncated record, returned TooOld at once. A PowerPoint 97 file
with a damaged Current User stream was reported as "made by PowerPoint 95 or
earlier", and the UserEditAtom scan meant for a missing stream never ran.
[MS-PPT] allows only those two tokens, so an unknown one can't tell a damaged
file from an older format. The scan now runs, and TooOld is returned only when
it finds no edit record behind an unknown token.

From storytold/deckcraft@3869c3dc51 (storytold/deckcraft#1137).

* ppt-binary: read persist directories within one stream's worth of words

dirs_seen only skips a directory named at the same offset again. Directories
nested inside one another, each named by its own UserEditAtom, were each read
to the end of the stream: MAX_EDITS x the stream. In a debug build, 4095 such
edits over a 64 MiB stream took about 48 s. All directories now share a budget
of stream.len() / 4 words. Real directories are separate records inside the
stream, so they always fit. The hostile case stops in milliseconds and is
reported as damaged.

From storytold/deckcraft@5799048d88 (storytold/deckcraft#1137).

* ppt-binary: check two additions on input-derived sizes

- cfb.rs: the mini sector end `at + MINI_SECTOR_SIZE` was unchecked. On a
  32-bit target (wasm32), a sector number near 0x03FF_FFFF puts `at` at the
  top of usize, so the add panics in a debug build and wraps in release.
- text.rs: the style-run total `chars.len() as u32 + 1` truncated and could
  overflow past u32::MAX characters. It now saturates.

Neither case can be reached in a native test (one needs a 32-bit target, the
other more than 4 GiB of text), so there is no new test. The `+ 1`s in
convert.rs paragraphs() that the review also named are bounded by the text
length and can't overflow, so they are unchanged.

From storytold/deckcraft@b58c354246 (storytold/deckcraft#1137).

* ppt-binary: a sector chain that revisits a sector is an error

read_chain stopped at the stream's size, so a FAT loop shorter than the stream returned the
looped sectors again as the stream's bytes. It now tracks visited sectors and fails on a revisit,
and reserves the stream's size (capped at the file length) up front.

a_looping_chain_stops expected the repeated bytes; it now expects the error (eliets2's review).

From storytold/deckcraft@2b0940bff5 (storytold/deckcraft#1137).

* ppt-binary: slide shapes inherit from their own master's shapes

Master shape properties were remembered by shape id alone, so a later master (a title master,
or a second main master) that reused a shape id replaced the first master's entry, and slides
inherited fill and line from the wrong master. They are now keyed by master slide id and shape id,
and a shape's hspMaster is looked up in its slide's master, then a title master's main master.
Notes pages have no imported master, so they inherit nothing.

PowerPoint gives shapes file-unique ids, so this takes a damaged or generated file (eliets2's
review).

From storytold/deckcraft@7ad2f5152b (storytold/deckcraft#1137).

* ppt-binary: drop the unused fBackground field

RawShape.background was set from the FSP flag but never read: the background shape is the
drawing container's own shape (OfficeArtDgContainer.shape, [MS-ODRAW] 2.2.13), which drawing()
already takes. The comment there now says so (eliets2's review).

From storytold/deckcraft@afd57f47e0 (storytold/deckcraft#1137).

* ppt-binary: shadowed text keeps its shadow

TextCFException's shadow bit was read and merged but never reached the run. A shadowed run now
gets a shadow in the colour scheme's shadow colour, at the distance and direction of the app's own
Text Shadow command, with no blur (the record has none). Emboss has no counterpart in the model,
so its field is gone and the loss is listed in the docs (eliets2's review).

From storytold/deckcraft@ab5cf618e1 (storytold/deckcraft#1137).

* ppt-binary: the .pps show-on-open test opens a real 97-2003 file

a_ppsx_from_the_system_starts_the_show saved a .pptx under the name "Old talk.pps", so it went
through the PPTX path and never reached the legacy importer. crates/ppt/tests/fixtures/old-talk.pps
is a one-slide .pps built from records by the ppt tests (rebuilt with DECKCRAFT_WRITE_PPT_FIXTURE=1,
checked on every run), attributed CC0 like the other generated fixtures, and the UI test opens it
(eliets2's review).

From storytold/deckcraft@f511a2a66b (storytold/deckcraft#1137).

* ppt-binary: test mini streams, 4096-byte sectors and the DIFAT chain

The compound-file test builder only made version-3 files with 512-byte sectors, no mini stream
and every FAT sector in the header, so read_mini_chain, 4096-byte sectors and the DIFAT chain never
ran. build_with takes the sector shift and the mini stream cutoff, and lists FAT sectors past the
header's 109 in DIFAT sectors; build is build_with(streams, 9, 0), so existing tests see the same
layout. Three tests read streams back through each path (eliets2's review).

From storytold/deckcraft@212788b693 (storytold/deckcraft#1137).

* ppt-binary: test every picture kind, two-UID blips and blips inside the FBSE

The blip tests covered PNG, deflated WMF and DIB only. New tests decode JPEG (RGB and CMYK), TIFF
and PNG with one and two UIDs, an uncompressed EMF with each UID count, a metafile over the budget
(compressed or not), and a blip held inside its FBSE rather than in the Pictures stream. All
passed as written (eliets2's review).

From storytold/deckcraft@fe8023b9c2 (storytold/deckcraft#1137).

* ppt-binary: placeholder text held only in the slide list is imported

A shape's client text box may hold just an OutlineTextRefAtom, with no TextHeaderAtom ([MS-PPT]
OfficeArtClientTextbox): the text lives in the slide list, and that is the usual form for slide
placeholders. read_block returned None without a header, so text_block never reached its
outline fallback and the placeholder came in empty. A block with a reference and no header is
now returned for the caller to follow.

placeholder_text_can_come_from_the_slide_list covers the reference alone (it failed before this
change) and a header with a reference; the test document builder can put outline blocks in the
slide list (streams_with_outline). Found writing the test eliets2's review asked for.

From storytold/deckcraft@bf8ec603f3 (storytold/deckcraft#1137).

* ppt-binary: test newer edits and the two other encryption signs

doc::read had tests for one edit and the Current User token only. a_later_edit_replaces_a_slide
adds an edit whose persist directory gives the slide a new object; the newer slide is imported and
the master from the older directory is kept. encryption_is_found_in_the_edit_and_the_persist_directory
covers an edit record long enough for encryptSessionPersistIdRef and a CryptSession object named
by a later edit. Both passed as written (eliets2's review).

From storytold/deckcraft@f0b8525cc6 (storytold/deckcraft#1137).

* ppt-binary: test title masters and slides that follow nothing

No test made a slide of a title master or a slide with the follow-master flags off. The new test
checks that a title master becomes a "Title Master" layout with its own background and shapes
and without the master's shapes, that its slide uses that layout and follows its background, and
that a slide with all three flags off keeps its own background and colour scheme and hides the
master's shapes. It passed as written (eliets2's review).

From storytold/deckcraft@a41bf545e7 (storytold/deckcraft#1137).

* ppt-binary: merge boolean properties flag by flag

A boolean property word holds sixteen flags, each with its own fUse bit.
Props::inherit and add_table kept the whole word from the most specific
set, so a placeholder or text box that set only fNoFillHitTest lost the
inherited "not filled" and "no line" and was drawn with a fill and an
outline. Merge those words per flag instead (storytold/deckcraft#1137 review, issue 1).

From storytold/deckcraft@79ae833152 (storytold/deckcraft#1137).

* ppt-binary: recover a broken edit chain and report lost slides

An edit whose previous-edit offset points back at itself (or anywhere
that isn't an edit) cut the older edits off, and with them the persist
directories holding the slides: such a file opened as an empty deck
with no warning. When the chain doesn't end at offset 0, read every
edit's persist directory in the stream, newest first, filling only what
the chain left unset.

Slides the slide list names but whose objects are still missing are now
returned by deckcraft_ppt::import_checked and reported like a damaged
.pptx: lostSlides, a "(Repaired)" copy and the CLI warning
(storytold/deckcraft#1137 review, issue 3).

From storytold/deckcraft@135674101f (storytold/deckcraft#1137).

* ppt-binary: picture frames, inline picture fills, gradients, footers, numbering

The remaining differences from LibreOffice in the storytold/deckcraft#1137 stress test:

- Picture frames (and OLE frames) that say nothing about fill or line
  start with neither, as placeholders and text boxes do, instead of the
  drawing defaults' fill.
- A pib or fillBlip held in the property's own complex bytes (fBid) is
  decoded within the picture budget: table cells with a picture fill
  showed a plain colour.
- Shaded fills put the back colour at fillFocus ([MS-ODRAW]), and the
  linear angle follows how LibreOffice writes and reads it (0 degrees
  from the top): the linear gradient was reversed, the radial inside out.
- HeadersFooters (the slide's, else the document's) add the date,
  footer and slide number placeholders; the master's footer placement,
  alignment, size and colour reach every layout.
- Numbering from the document's ___PPT9 tag (OutlineTextProps9, pp9rt
  in the runs' fontStyle) turns bulleted paragraphs into numbered ones.
- Wingdings diamonds draw as a diamond, not a dot.

From storytold/deckcraft@24437bd075 (storytold/deckcraft#1137).

* ppt-binary: read CString records up to their first NUL

Header/footer text and the ___PPT9 tag name were decoded from the whole
CString body. A writer that ends the string with a NUL would put the NUL
into the footer text and make the tag name fail to match, losing the
numbering. Stop at the first NUL, as the font names already do.

From storytold/deckcraft@110e1420fd (storytold/deckcraft#1137).

* ppt-binary: on craft-cfb and craft-pptx (the move from DeckCraft)

What the move from storytold/deckcraft#1137 changes; the commits before this one are that
PR's crates/ppt as it is on its branch, without its manifest.

- craft-cfb replaces the crate's own compound-file reader (cfb.rs, 552 lines). Streams are
  read capped at the file's length, as before. Its six tests (looping chains, mini streams,
  version 4 sectors, the DIFAT) are covered by craft-cfb's own. The byte helpers move to
  record.rs. Test files are written by craft-cfb's writer.
- deckcraft-model, deckcraft-color and deckcraft-geom become craft-pptx and craft-drawingml,
  the same types (storytold/deckcraft#2179, storytold/deckcraft#2180 and #792's plan). A gradient now states its
  shape and rotate-with-shape explicitly, as craft-drawingml's are optional.
- DeckCraft's default master (defaults::build_master and blank_presentation) becomes the
  caller's craft_pptx::Defaults: import(bytes, &defaults), as craft_pptx::import takes. The
  file's masters take the default master's layouts and placeholders, then the file's theme,
  placeholder boxes and styles. The tests use a default master with title, body and footer
  placeholders and the seven layouts .ppt layout types map to; a new test reads with
  craft_pptx::Plain.
- The two tests that drive DeckCraft's engine (open and save, lost slides in the app) stay in
  DeckCraft.
- The fixture's rebuild variable is CRAFT_WRITE_PPT_FIXTURE; old-talk.pps is unchanged and
  gets its ATTRIBUTION row. Bare #1137 references in comments name storytold/deckcraft#1137.
- README, crate README (doctested) and the workspace entry.

* ppt-binary: bound text, strings, paths and repeated work from hostile files

Tab stops keep the first 64 entries while still reading past the rest, string properties stop
at 4096 units, and a freeform path uses at most 8192 vertices, since each of these is copied
into every paragraph or inheriting shape. An outline block in the slide list is the text of
one shape only; a second reference keeps the shape's own text.

The fallback master and each master's layout per type are found once before the slides are
converted, a shape's primary property tables are collected without inserting at the front,
and a compressed metafile that fails to inflate is charged to the picture budget.

* ppt-binary: review fixes for footers, rulers, title masters, paths and numbering

A slide's own headers and footers record (instance 0) now wins over the document's, and a
text box that points at an outline block keeps the margins and indents of its own ruler. A
slide list entry whose object is not a slide is reported as lost.

Title masters place their layout's placeholders from their own placeholder boxes, adding any
the title layout lacks, and copy only placeholders from an earlier title layout. Slides that
don't name a title master no longer pick its layout.

Freeform paths skip the points of escape segments, and without segments follow shapePath
(closed lines by default, open lines or curves). DIB colour tables are sized by bit depth and
refused when they run past the bitmap. Numbering schemes 0x10 to 0x28 map to their DrawingML
names, master style levels go to the level they name, and a broken edit chain reads the newest
edits rather than the oldest.

The nested persist directory test now checks the file is reported damaged, the footer test
fails when a layout has no slide number, and the README says tables come in as groups of
shapes.

* ppt-binary: second review round: failed pictures, title layouts, notes, arcs and property tables

Inflating a compressed metafile is now charged its compressed bytes as well as its output, and
is refused when those bytes alone pass the remaining budget, so many entries pointing at one
stream that inflates to nothing can't each read it again for free.

A title master's layout starts only from the defaults' own title layout, not one made for an
earlier title master. A notes page shared by two slide records with the same slide id goes to
the first only. After elliptical quadrants or a quadratic Bezier escape a path goes on from
their last point; after an arc or angle ellipse, whose end isn't one of its vertices, the path
stops rather than draw from the wrong place. A property set keeps at most 1024 distinct
properties, so copying the drawing defaults into each shape costs a bounded amount.

* ppt-binary: take each main master's title-layout base once; test outline notes

A title master's layout starts from the placeholders of the defaults' title layout. They are now
taken once, when the main master is made, instead of rebuilding the set of title-master layouts
and rescanning the master's layouts for every title master, which was quadratic in title masters.

A notes page whose body text is in the notes list's outline block also goes to one slide only.

---------

Co-authored-by: Oliwier Kulczycki <oleknuso282@gmail.com>
Co-authored-by: kiwi4boy <kiwi4boy@gmail.com>
2026-11-18 23:23:02 -05:00

299 lines
14 KiB
TOML

[workspace]
resolver = "3"
members = ["crates/*"]
exclude = ["vendor/krilla", "vendor/hayro", "vendor/hayro-interpret", "vendor/hayro-syntax", "vendor/hayro-jbig2", "vendor/hayro-cmap", "vendor/hayro-postscript", "vendor/linesweeper"]
[workspace.package]
version = "0.1.0"
edition = "2024"
license = "MIT OR Apache-2.0"
rust-version = "1.95"
repository = "https://github.com/storytold/craft-libs"
[workspace.dependencies]
craft-xfa = { path = "crates/xfa" }
craft-evm = { path = "crates/evm" }
craft-java-class = { path = "crates/java-class" }
craft-sourcemap = { path = "crates/sourcemap" }
craft-pcap = { path = "crates/pcap" }
craft-har = { path = "crates/har" }
craft-xfdf = { path = "crates/xfdf" }
craft-jsonc = { path = "crates/jsonc" }
craft-palette = { path = "crates/palette" }
craft-score = { path = "crates/score" }
craft-shx = { path = "crates/shx" }
craft-http-url = { path = "crates/http-url" }
craft-usd = { path = "crates/usd" }
craft-smime = { path = "crates/smime" }
craft-ssip = { path = "crates/ssip" }
craft-ber = { path = "crates/ber" }
craft-proto = { path = "crates/proto" }
craft-render-parity = { path = "crates/render-parity" }
acadrust = "=0.6.6"
log = "0.4"
# internal: add each crate here as `craft-<name> = { path = "crates/<name>" }`
craft-plist = { path = "crates/plist" }
craft-wasm = { path = "crates/wasm" }
craft-platform = { path = "crates/platform" }
craft-aep = { path = "crates/aep" }
craft-affinity = { path = "crates/affinity" }
craft-ai = { path = "crates/ai" }
craft-ai-core = { path = "crates/ai-core" }
craft-anicraft-format = { path = "crates/anicraft-format" }
craft-pdf = { path = "crates/pdf", version = "=0.1.0" }
craft-pe = { path = "crates/pe" }
craft-ps = { path = "crates/ps", version = "=0.1.0" }
craft-pdn = { path = "crates/pdn" }
craft-plate-test = { path = "crates/plate-test" }
pdf-writer = "0.15"
miniz_oxide = "0.8"
weezl = "0.1"
skrifa = "0.47"
krilla = { version = "=0.8.2", default-features = false, features = ["raster-images"] }
hayro = { version = "=0.7.1", default-features = false }
hayro-interpret = { version = "=0.7.0", default-features = false, features = ["embed-fonts", "embed-cmaps"] }
hayro-syntax = { version = "=0.7.2", default-features = false, features = ["std"] }
bytemuck = "1"
kurbo = "0.13"
thiserror = "2"
craft-gzip = { path = "crates/gzip" }
craft-gridcraft-format = { path = "crates/gridcraft-format" }
craft-aaf = { path = "crates/aaf" }
craft-atomic = { path = "crates/atomic" }
# The ArtCraft Launcher's app list for AI agents (storytold/craft-ai-integrations, crates/app/ai-agents).
craft-ai-agents = { git = "https://github.com/storytold/craft-ai-integrations", rev = "d94a3593adcff504eaaad9e5aee4c84fd2f07a72" }
craft-dex = { path = "crates/dex" }
craft-xtask = { path = "crates/xtask" }
craft-captions = { path = "crates/captions" }
craft-cfb = { path = "crates/cfb" }
craft-codepage = { path = "crates/codepage" }
craft-cms = { path = "crates/cms" }
craft-cloud = { path = "crates/cloud" }
craft-cloud-local = { path = "crates/cloud-local" }
craft-color = { path = "crates/color" }
craft-color-transform = { path = "crates/color-transform" }
craft-frame = { path = "crates/frame" }
craft-crs = { path = "crates/crs" }
craft-crw = { path = "crates/crw" }
craft-csv = { path = "crates/csv" }
craft-dav = { path = "crates/dav" }
craft-dialogs = { path = "crates/dialogs" }
craft-doc-binary = { path = "crates/doc-binary" }
craft-docx = { path = "crates/docx" }
craft-document-bundle = { path = "crates/document-bundle" }
craft-mcmat = { path = "crates/mcmat" }
craft-deckcraft-format = { path = "crates/deckcraft-format" }
craft-designcraft-format = { path = "crates/designcraft-format" }
craft-dxf = { path = "crates/dxf" }
craft-drawingml = { path = "crates/drawingml" }
craft-eps = { path = "crates/eps" }
craft-elf = { path = "crates/elf" }
craft-file-formats = { path = "crates/file-formats" }
craft-file-import = { path = "crates/file-import" }
vectorcraft-doc = { git = "https://github.com/storytold/vectorcraft.git", rev = "6b3a6b8788ebcb420d69449199cbdf323888d27e" }
vectorcraft-eps = { git = "https://github.com/storytold/vectorcraft.git", rev = "6b3a6b8788ebcb420d69449199cbdf323888d27e" }
vectorcraft-geom = { git = "https://github.com/storytold/vectorcraft.git", rev = "6b3a6b8788ebcb420d69449199cbdf323888d27e" }
vectorcraft-pathops = { git = "https://github.com/storytold/vectorcraft.git", rev = "6b3a6b8788ebcb420d69449199cbdf323888d27e" }
craft-doc = { path = "crates/doc" }
craft-docpath = { path = "crates/docpath" }
craft-dpx = { path = "crates/dpx" }
craft-dwg = { path = "crates/dwg" }
craft-fcproj-format = { path = "crates/fcproj-format" }
craft-ecproj-format = { path = "crates/ecproj-format" }
craft-esign = { path = "crates/esign" }
craft-figma-rest = { path = "crates/figma-rest" }
craft-exr = { path = "crates/exr" }
craft-flags = { path = "crates/flags" }
craft-font-catalog = { path = "crates/font-catalog" }
craft-font-manager = { path = "crates/font-manager" }
craft-font-store = { path = "crates/font-store" }
craft-gainmap = { path = "crates/gainmap" }
craft-flow = { path = "crates/flow" }
craft-gcode = { path = "crates/gcode" }
craft-gif = { path = "crates/gif" }
craft-hdr = { path = "crates/hdr" }
craft-mesh = { path = "crates/mesh" }
craft-html = { path = "crates/html" }
craft-ipp = { path = "crates/ipp" }
craft-heif = { path = "crates/heif" }
craft-fig = { path = "crates/fig" }
craft-fonts-build = { path = "crates/fonts-build" }
craft-gpu = { path = "crates/gpu" }
craft-gpu-null = { path = "crates/gpu-null" }
craft-gpu-providers = { path = "crates/gpu-providers" }
craft-gpu-wgpu = { path = "crates/gpu-wgpu" }
craft-i18n = { path = "crates/i18n" }
craft-ipc = { path = "crates/ipc" }
craft-idml = { path = "crates/idml" }
craft-indd = { path = "crates/indd" }
craft-jmap = { path = "crates/jmap" }
craft-ical = { path = "crates/ical" }
craft-jpeg = { path = "crates/jpeg" }
craft-control-protocol = { path = "crates/control-protocol" }
craft-jsonrpc = { path = "crates/jsonrpc" }
craft-mcp = { path = "crates/mcp" }
craft-jxl = { path = "crates/jxl", default-features = false }
craft-kiwi = { path = "crates/kiwi" }
craft-keymap = { path = "crates/keymap" }
craft-assuan = { path = "crates/assuan" }
craft-kra = { path = "crates/kra" }
craft-audio = { path = "crates/audio" }
craft-latex = { path = "crates/latex" }
craft-markdown = { path = "crates/markdown" }
craft-macho = { path = "crates/macho" }
craft-math = { path = "crates/math" }
# No default features: craft-audio turns on the craft-media modules each of its features needs.
craft-media = { path = "crates/media", default-features = false }
craft-media-source = { path = "crates/media-source" }
craft-materialx = { path = "crates/materialx" }
craft-media-testkit = { path = "crates/media-testkit" }
craft-midi = { path = "crates/midi" }
craft-sf2 = { path = "crates/sf2" }
craft-mime = { path = "crates/mime" }
craft-odf = { path = "crates/odf" }
craft-ods = { path = "crates/ods" }
craft-prc = { path = "crates/prc" }
craft-lottie = { path = "crates/lottie" }
craft-menu = { path = "crates/menu" }
craft-metafile = { path = "crates/metafile" }
craft-offcrypto = { path = "crates/offcrypto" }
craft-opc = { path = "crates/opc" }
craft-openpgp = { path = "crates/openpgp" }
craft-ora = { path = "crates/ora" }
craft-pptx = { path = "crates/pptx" }
craft-ppt-binary = { path = "crates/ppt-binary" }
craft-penpot = { path = "crates/penpot" }
craft-pcraft-format = { path = "crates/pcraft-format" }
craft-pcraft-bundle = { path = "crates/pcraft-bundle" }
craft-pkcs7 = { path = "crates/pkcs7" }
craft-plotter = { path = "crates/plotter" }
craft-prepress = { path = "crates/prepress" }
craft-press-print = { path = "crates/press-print" }
craft-print = { path = "crates/print" }
craft-proof = { path = "crates/proof" }
craft-raster-codecs = { path = "crates/raster-codecs" }
craft-image-codecs = { path = "crates/image-codecs" }
craft-dds = { path = "crates/dds" }
craft-psd = { path = "crates/psd" }
craft-pst = { path = "crates/pst" }
craft-quit = { path = "crates/quit" }
craft-rtf = { path = "crates/rtf" }
craft-raw = { path = "crates/raw" }
craft-geom = { path = "crates/geom" }
craft-develop = { path = "crates/develop" }
craft-develop-model = { path = "crates/develop-model" }
craft-sheet = { path = "crates/sheet" }
craft-sketch = { path = "crates/sketch" }
craft-settings = { path = "crates/settings" }
craft-scraft-format = { path = "crates/scraft-format" }
craft-time = { path = "crates/time" }
craft-silhouette-studio = { path = "crates/silhouette-studio" }
craft-suite-account = { path = "crates/suite-account" }
craft-svg = { path = "crates/svg" }
craft-stencilcraft-format = { path = "crates/stencilcraft-format" }
craft-stencilcraft-document = { path = "crates/stencilcraft-document" }
craft-svg-paths = { path = "crates/svg-paths" }
craft-stream-codecs = { path = "crates/stream-codecs" }
craft-testkit = { path = "crates/testkit" }
craft-text = { path = "crates/text" }
craft-tcraft = { path = "crates/tcraft" }
craft-texture = { path = "crates/texture" }
craft-tga = { path = "crates/tga" }
craft-timeline = { path = "crates/timeline" }
craft-tiff = { path = "crates/tiff" }
craft-metadata = { path = "crates/metadata" }
craft-ui = { path = "crates/ui" }
craft-update = { path = "crates/update" }
craft-vcard = { path = "crates/vcard" }
craft-vectorcraft-format = { path = "crates/vectorcraft-format" }
craft-vectordrawable = { path = "crates/vectordrawable" }
craft-xls = { path = "crates/xls" }
craft-xfl = { path = "crates/xfl" }
craft-wordmodel = { path = "crates/wordmodel" }
craft-xlsx = { path = "crates/xlsx" }
indd = { git = "https://github.com/storytold/indd-utils", rev = "7f3060e5bce78d21ea70e0d5eacb96edce15dfbe" }
craft-xcf = { path = "crates/xcf" }
craft-xml = { path = "crates/xml" }
craft-zip = { path = "crates/zip" }
craft-y4m = { path = "crates/y4m" }
craft-sniff = { path = "crates/sniff" }
craft-tar = { path = "crates/tar" }
craft-epub = { path = "crates/epub" }
craft-ews = { path = "crates/ews" }
craft-video = { path = "crates/video" }
craft-web-api = { path = "crates/web-api" }
craft-window = { path = "crates/window" }
craft-web-host = { path = "crates/web-host" }
craft-webp = { path = "crates/webp" }
egui = { version = "0.37", default-features = false }
md5 = { package = "md-5", version = "0.10", default-features = false }
jxl-oxide = { version = "0.12", default-features = false }
jixel = "=0.3.4"
rayon = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
proptest = "1"
# Character sets of the WHATWG Encoding Standard (craft-mime). (Apache-2.0 OR MIT) AND BSD-3-Clause.
encoding_rs = "0.8"
# All date/time conversion goes through chrono (no hand-rolled calendar code beyond the 400-year range extension; AGENTS.md).
chrono = { version = "0.4.45", default-features = false, features = ["std"] }
# Foundation crates for craft-gpu-wgpu. The versions match the ones the app repos already pin.
pollster = "0.4"
wgpu = { version = "30", default-features = false, features = ["std", "wgsl"] }
[workspace.lints.rust]
unsafe_code = "forbid"
unexpected_cfgs = { level = "warn", check-cfg = ["cfg(craft_pdf_unicode_fixtures)"] }
[workspace.lints.cargo]
unused_workspace_dependencies = "allow"
[workspace.lints.clippy]
cognitive_complexity = "deny"
too_many_arguments = "deny"
wildcard_imports = "deny"
dbg_macro = "warn"
todo = "warn"
[patch.crates-io]
krilla = { path = "vendor/krilla" }
hayro = { path = "vendor/hayro" }
hayro-interpret = { path = "vendor/hayro-interpret" }
hayro-syntax = { path = "vendor/hayro-syntax" }
hayro-jbig2 = { path = "vendor/hayro-jbig2" }
hayro-cmap = { path = "vendor/hayro-cmap" }
hayro-postscript = { path = "vendor/hayro-postscript" }
linesweeper = { path = "vendor/linesweeper" }
ecolor = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
emath = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
epaint = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui-winit = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_glow = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_extras = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
eframe = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "6d518fc799681571963842f95b55a6b68431b15a" }
winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" }
# symphonia's FLAC decoder restores LPC samples as `residual + (prediction as i32)`. In a valid
# 32-bit stream the prediction can leave the i32 range while the sum does not, so a debug build
# panics where a release build wraps to the right sample. Apps that decode 32-bit FLAC through
# craft-audio's `decode` need the same override in their own workspace.
[profile.dev.package.symphonia-bundle-flac]
overflow-checks = false
# Codec hot loops: the oracle and conformance tests of a debug build take minutes below opt-level 3.
[profile.dev.package.craft-video]
opt-level = 3
# The object-stream parser follows nesting 384 levels deep: unoptimised, its frames overflow the
# 2 MiB stack of a test thread. The apps this reader came from build their crates at this level.
[profile.dev.package.craft-affinity]
opt-level = 1