mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-12 14:46:03 +00:00
File › Open and File › Place refused plotter files: HP-GL/2 files (.plt, .hpgl, .hgl, .hpg) were not a format VectorCraft reads. The format table gets a read-only HP-GL format, read by a new vectorcraft_cad::hpgl module. Each line the pen draws becomes a stroked path in its pen's color and width, with the line type as a dash pattern and the line attributes as caps and joins. Circles, arcs, wedges and Bézier curves are drawn as curves. Filled and edged rectangles, wedges and polygons (polygon mode) become filled or stroked paths, and encoded polylines, scaling points, user units and rotation are read. Plotter units (1016 to the inch, y up) become points, and the artboard holds what the art paints. Place brings the art in as one group. Older HP-GL files are read by the HP-GL/2 rules for the instructions the two share. A file is recognized by its first instructions, after any printer escape sequences and PJL lines, so a plot file also opens under an extension no other format reads. VectorCraft's own rules where the device decides: before the first SP the pen is pen 1, and the hard-clip limits are 11 x 8.5 in, which P2 takes when the file sets no scaling points. Labels, symbol-mode symbols and raster images are not drawn, the input window does not clip, hatched fills are filled solid, and later pages are drawn over the first; the warnings list each. Objects, path points and pen widths are capped, and the import fuzzer covers random, mutated and garbage plot files. An importer plug-in that lists .plt, .hpgl, .hgl or .hpg now opens those files only when document.open names it with `importer`. Docs: docs/mcp.md, docs/file-format-parity.md, docs/target-app-parity.md, docs/releasing.md.