[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81860":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":12,"contributorsCount":12,"subscribersCount":12,"size":12,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":12,"forks30d":12,"starsTrendScore":15,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":12,"starSnapshotCount":12,"syncStatus":14,"lastSyncTime":24,"discoverSource":25},81860,"retro-ps","mist64\u002Fretro-ps","mist64","Classic PostScript interpreter binaries running inside a CPU-emulator sandbox, on the command line or in your browser.",null,"Rust",26,0,24,2,6,42.2,false,"main",true,[],"2026-06-12 04:01:35","# retro-ps\n\nClassic PostScript interpreter binaries running inside a CPU-emulator sandbox, on the command line or in your browser.\n\nThe [HP C2089A \"PostScript Cartridge Plus\"](https:\u002F\u002Fwww.pagetable.com\u002F?p=1673) turns an HP LaserJet II\u002FIII into a PostScript printer. It contains a 2 MB ROM with Adobe's reference Level 2 PostScript interpreter (version 2010.118). We feed it bytes, emulate the 68k, fake the bits of the printer's main board it expects to be there, and collect each page it draws – and its status\u002Ferror messages.\n\nThe original cart only renders at 300 DPI, with a 0.25\" margin, on some pre-defined paper sizes. We generalise on top of that:\n\n- Any resolution.\n- Any paper size.\n- Any lpi for the screening dots. We default to 1\u002F5 of the printing dpi.\n- No margins.\n\nThe only hard limit is 16,000 pixels in each dimension.\n\n## CLI\n\n```\ncargo build --release\ntarget\u002Frelease\u002Fretro-ps some.ps -o \u002Ftmp\u002Fout\n```\n\nOutput is one 1-bit grayscale PNG per page; the cart's PS-side `print` \u002F `==` \u002F error output goes to stderr unprefixed, like a real PostScript printer.\n\nFlags:\n\n| | |\n|---|---|\n| `\u003CINPUT>` | PostScript file to render (positional) |\n| `-o, --output PREFIX` | output prefix; files land at `\u003Cprefix>_NN.png` (default `page`) |\n| `--rom PATH` | use a different ROM image instead of the baked-in one |\n| `--paper-w PT` \u002F `--paper-h PT` | paper size in PostScript points (default `612` × `792`) |\n| `--paper-dpi N` | render DPI (default `300`) |\n| `--paper-w-px N` \u002F `--paper-h-px N` | raw pixel override; wins over `--paper-w` × DPI |\n| `--lpi N` \u002F `--screen-angle DEG` | force halftone frequency \u002F angle via a `setscreen` prolog |\n| `--lj3` | mimic the original LaserJet III: 612 × 792 at 300 DPI with the 0.25\" hardware margin and imageable-area crop |\n| `--exit-after N` | stop after N captured pages |\n| `--max-insns N` | hard cap on cart instructions executed |\n| `-v, --verbose` | also print emulator boot\u002Fteardown chatter, LCD status text, and per-page write notices |\n| `--ram-snapshot PATH` \u002F `--ram-snapshot-force` | dump cart RAM to disk for offline inspection |\n\n## Browser\n\n```\ncd retro-ps-web\n.\u002Fbuild.sh                            # wasm-pack into pkg\u002F\npython3 -m http.server 8080\nopen http:\u002F\u002F127.0.0.1:8080\u002F\n```\n\nDrop a `.ps` file onto the page; the wasm runs in a Web Worker so the render doesn't block the UI.\n\nA live build is at \u003Chttps:\u002F\u002Fwww.pagetable.com\u002Fretro-ps\u002F>.\n\n## Internals\n\nA few things worth knowing about how this differs from a real cartridge in a real LaserJet:\n\n- **CPU and RAM.** The emulator's 68020 sees more than the original 68000's max. 16 MB of RAM here. That headroom is what lets the cart render high-DPI pages without us rewriting its allocator.\n- **Pixel ceiling.** The PS interpreter's `clip` operator caps content at about 16,000 device pixels per axis. That's a cart-firmware limit we can't paper over without patching the ROM, so the practical DPI max scales with paper size — about 1450 DPI on Letter, less on bigger paper.\n- **No mainboard, no engine.** We have the cartridge ROM, not the LaserJet III's mainboard ROM, and we don't have a print engine at all. The emulator stands in for the half-dozen low-memory soft-traps the mainboard would have provided (printer-model byte, IPC byte stream, engine status polling) and fakes the engine-done interrupt so the cart's state machine can move on to the next page.\n- **Halftone scaling.** Adobe hand-tuned the cart's halftone cell for 300 DPI; above that the default cell renders too sparse and grayscale fills look chalky. We inject a DPI-scaled `setscreen` prolog so the cart builds an appropriately-sized dot itself.\n\n## Author\n\nClaude, directed by Michael Steil &lt;mist64@mac.com&gt;.\n\n## License\n\nPublic domain.\n","retro-ps 是一个在CPU模拟器沙箱中运行的经典PostScript解释器，支持命令行和浏览器环境。项目使用Rust语言开发，通过模拟68k处理器并伪造打印机主板部分功能来解析和渲染PostScript文件。它支持任意分辨率、纸张大小及半色调频率，并且去除了原始硬件的边距限制。适用于需要跨平台处理PostScript文档的场景，尤其是在希望保留经典打印效果的同时享受现代技术带来的灵活性时。此外，提供CLI与Web两种使用方式，便于集成到不同类型的项目中。","2026-06-11 04:06:59","CREATED_QUERY"]