vectorcraft/crates/eps/src
bflatastic b43b15a6e8 Part of #505: restore puts dictionaries back as they were at the save
The PostScript Language Reference (3rd ed., §3.7.3 "Save and Restore")
has `restore` reset composite objects in local VM to their values at the
`save`. The reader only restored the graphics state, so dictionary
entries changed between `save` and `restore` stayed changed: a program
that counts its open saves in a dictionary and refuses to go past a depth
stopped after that many saves in sequence, and the file fell back to its
preview. EPS files with many images, each drawn between `save` and
`restore`, are a likely case of #505; its reporter hasn't sent a file, so
this is part of it.

- While a `save` is open, `def`, `store`, `put`, `undef` and dictionary
  `copy` keep each entry's old value in a journal (counted against the
  memory budget); `restore` undoes it, newest change first, down to its
  save. A save restored already, itself or through an outer one, is no
  longer valid (`invalidrestore`, §3.7.3).
- `cachestatus` reports a device's cache sizes (chapter 8) instead of
  zeros: its last value, the most bytes one cached glyph may take, is what
  programs divide by.
- Tests (programs written from the reference): 100 saves counted in a
  dictionary under a depth limit, each dictionary change undone, saves
  restored twice, `cachestatus`'s glyph limit. Mutation-checked: without
  the journal or with a zero `cachestatus` the test fails. The import fuzz
  vocabulary has saves and restores around dictionary changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 23:43:51 +07:00
..
import Part of #505: restore puts dictionaries back as they were at the save 2026-10-08 23:43:51 +07:00
print M4.92: Print to a PostScript file 2026-10-05 17:01:36 +07:00
lib.rs EPS import: other apps' EPS open as vectors, a preview that stands in says why 2026-10-08 18:23:36 +07:00
ps.rs M4.67: TIFF export in RGB, CMYK or grayscale, with LZW, either byte order and the profile 2026-10-05 15:24:29 +07:00
scene.rs M8.16: Envelopes bend images, symbols, gradients, patterns and appearance; warps keep their frame 2026-10-06 12:01:47 +07:00
tests.rs M4.76: EPS export (PostScript Level 2 and 3) with EPS Options, TIFF previews and the document embedded 2026-10-05 13:50:50 +07:00
tiff.rs Fix #234: EPS files from the reference app open 2026-10-07 09:34:27 +07:00