vectorcraft/crates/mcp/src
bflatastic 9f3b992ecc EPS import: other apps' EPS open as vectors, a preview that stands in says why
Discord feedback: "EPS files are always rasterized: they open as bitmaps, in
other programs as vectors". Every EPS saved by Illustrator 2026 fell back to
its TIFF preview (`gcheck` was unknown), and cairo/Inkscape files stopped at
their first image (`status`), dropped masked images (ImageType 3) and failed
on mesh gradients; the warning didn't say where the program failed.

Fallback never silent:
- The warning names the PostScript error, the operator that raised it and
  the named procedures it ran in, innermost first ("a PostScript error
  (typecheck in `add`), in `inner` in `outer`"); errors caught by `stopped`
  aren't reported. It reaches the status bar, document.open, app.open and
  file.open (which now return document.open's result, so MCP's open_file over
  the control channel gets it), and `vectorcraft-cli info` ("warnings").
- A file whose PostScript can't be read opens as its TIFF preview, else its
  Windows metafile preview (as vectors, scaled to the bounding box), else its
  EPSI bitmap. es @msg rows for the new messages.

Interpreter:
- Operators programs probe or use: gcheck/scheck, rootfont,
  currentcolorrendering, currenthsbcolor, status, token, read,
  bytesavailable, fileposition/setfileposition, resetfile, write*, pdfmark
  (marks dropped, as Ghostscript does), execform, nulldevice, strokepath,
  pathforall, user paths (ufill/ueofill/ustroke/uappend/upath/setbbox, the
  encoded form too), setcachedevice2, findcolorrendering, cache, device and
  VM queries, revision; (%stdout) (w) file gives a sink.
- `//name` is replaced by its value when read, inside procedures too.
- Tiling patterns become pattern swatches (their PaintProc drawn in pattern
  space, one cell; uncoloured ones in the colour under them; makepattern
  copies share one swatch); nested patterns stop at 8 levels.
- Type 3 fonts draw their glyphs (BuildGlyph/BuildChar, widths from
  setcachedevice/setcharwidth) as outlines grouped per string, spaced by
  ashow/widthshow/awidthshow/xshow/yshow/xyshow/kshow; glyphshow and
  stringwidth/cshow use them.
- Shadings of types 1 and 4-7 become gradient meshes (data from arrays,
  strings or files, packed or not, flags sharing edges), as fills through a
  shading pattern too; sampled functions (type 0) are evaluated;
  GradientMesh::coons/triangle are shared with PDF import.
- ImageType 3 masked images, interleaved by sample, by row or in separate
  sources; ReusableStreamDecode reads its data when made; Flate/LZW PNG and
  TIFF predictors.
- Bounded: DeviceN at 32 inks, sampled functions at 2^24 samples and 32
  outputs, 4096 patches a shading, strokepath ignores dashes finer than 1e5
  pieces, Type 3 glyphs nest 8 deep (a glyph that shows itself overflowed the
  stack before the limit), 64-bit index maths for 32-bit targets.

Tests: a synthetic program per generator (cairo/Inkscape, its Type 3 fonts,
matplotlib, CorelDRAW, Affinity, LibreOffice, Ghostscript eps2write,
Illustrator procsets), meshes and function shadings, masked images, fault
messages, probing operators, metafile/EPSI previews, `//name`, user paths,
hostile patterns/glyphs/shadings (run against main, 12 of the 14 generator
and feature tests fail; CorelDRAW- and LibreOffice-style programs already
read there). The import fuzz vocabulary covers the new operators. Checked
against real files made here with Inkscape 1.4 (cairo) and Illustrator 2026
(its own format and the CS-to-CC compatibility formats; all fell back or
stopped early on main and open as vectors now; its Illustrator 8 format
needs the next commit); those files aren't committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 18:23:36 +07:00
..
backend.rs Robustness: VectorCraft never crashes — no panics in shipped code 2026-10-05 06:28:59 +07:00
headless.rs MCP: inspect_document slices too, stricter find filters (review of #416) 2026-10-08 09:17:06 +07:00
lib.rs MCP: prompts, resource templates, completions and logging 2026-10-07 07:25:02 +07:00
logging.rs MCP: prompts, resource templates, completions and logging 2026-10-07 07:25:02 +07:00
prompts.rs MCP: prompts, resource templates, completions and logging 2026-10-07 07:25:02 +07:00
resources.rs MCP: slice summary reads with document.node depth and childLimit 2026-10-08 07:43:07 +07:00
server.rs MCP: a server sends log records only when its own client asked for them 2026-10-07 17:15:56 -04:00
tests.rs Part of #394: Preferences for snapping, handles, rubber bands, pattern tiles, tints and type 2026-10-08 09:43:12 +07:00
tests_distortkeys.rs Fix #392: Cmd+A selects a focused field's text or the type being edited 2026-10-08 07:18:52 +07:00
tests_exportas.rs M4.33: Export As with Use Artboards (All or a range) and art bounds 2026-10-05 09:14:42 +07:00
tests_fileio.rs Fix #421: Document Color Mode can put RGB greys on the black plate 2026-10-08 10:30:32 +07:00
tests_freeform.rs M3.97: freeform points drag out to delete, spread ring drags, Lines mode draws lines 2026-10-05 04:43:43 +07:00
tests_gradient.rs M3.17: interactive gradient annotator — drag the start handle or the bar to move the gradient, the end handle to change length and angle, just past the end to rotate (Shift snaps to 45°); a bar click adds a stop, stops drag along the bar, off it to delete (never below two), Alt-drag copies, diamonds move midpoints; a click inside selected art applies the gradient from that point; double-clicking a stop opens a popover (Color/Swatches, Opacity, Location); the selected stop lives in the session (gradient.selectStop), shared by the tool, the Gradient and Color panels and agents, and takes Delete/Backspace and ←/→ ahead of their shortcuts (Tool::claims_key, also headless); stop chips draw as Overlay::Swatch with generated add/remove-stop cursors; the stop math moves into the color crate 2026-10-04 17:39:36 +07:00
tests_links.rs M4.53: Linked images remember their file and keep a preview; missing links ask Replace or Ignore, modified ones follow Update Links 2026-10-05 10:07:10 +07:00
tests_liquify.rs M8.4: Liquify keeps going while held, leaves non-paths alone, strokes apply incrementally 2026-10-06 12:00:52 +07:00
tests_persp.rs M8.12: Perspective Selection tool scales, copies, moves perpendicular and nudges in perspective 2026-10-06 11:00:15 +07:00
tests_place.rs M4.25: Drop files on the canvas to place them; several placed files load the place cursor 2026-10-05 08:42:30 +07:00
tests_protocol.rs MCP: prompts, resource templates, completions and logging 2026-10-07 07:25:02 +07:00
tests_svg.rs M4.26: SVG Options in the engine, a dialog and MCP 2026-10-05 07:55:59 +07:00
tools.rs EPS import: other apps' EPS open as vectors, a preview that stands in says why 2026-10-08 18:23:36 +07:00