mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 17:05:55 +01:00
train: #7331
This commit is contained in:
commit
3ef1ab5d24
46 files changed
+810
-25
No files matched your search
@@ -198,14 +198,24 @@ pub fn export(doc: &Document, opts: &HpglOptions) -> Result<HpglOutput, String>
|
||||
Ok(export_regions(doc, opts, &[opts.region])?.pop().unwrap_or_default())
|
||||
}
|
||||
|
||||
/// An error unless a plot can cover `region`: its corners are finite and it has a width and a
|
||||
/// height (either corner may come first).
|
||||
pub fn check_region(region: Rect) -> Result<(), String> {
|
||||
let r = region.abs();
|
||||
if ![r.x0, r.y0, r.x1, r.y1].iter().all(|v| v.is_finite()) || r.width() <= 0.0 || r.height() <= 0.0 {
|
||||
return Err("the export region is empty".into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Write the visible art of `doc` over each of `regions` as an HP-GL plot, one per region, as
|
||||
/// [`export`] does with `opts.region`. The plots share one pen numbering, so a color is the same
|
||||
/// pen in each, and one point budget.
|
||||
pub fn export_regions(doc: &Document, opts: &HpglOptions, regions: &[Rect]) -> Result<Vec<HpglOutput>, String> {
|
||||
let regions: Vec<Rect> = regions.iter().map(|r| r.abs()).collect();
|
||||
if regions.iter().any(|r| ![r.x0, r.y0, r.x1, r.y1].iter().all(|v| v.is_finite()) || r.width() <= 0.0 || r.height() <= 0.0) {
|
||||
return Err("the export region is empty".into());
|
||||
for r in regions {
|
||||
check_region(*r)?;
|
||||
}
|
||||
let regions: Vec<Rect> = regions.iter().map(|r| r.abs()).collect();
|
||||
if !TOLERANCE_RANGE.contains(&opts.tolerance) {
|
||||
return Err("the curve tolerance must be from 0.01 to 10 points".into());
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ mod load;
|
||||
mod mesh3d;
|
||||
pub(crate) use load::{MAX_RASTER_ALLOC, file_clipped, image_clip, size_note};
|
||||
mod heifread;
|
||||
mod hpgl;
|
||||
pub mod hpgl;
|
||||
mod jp2read;
|
||||
mod metafile;
|
||||
mod naming;
|
||||
|
||||
@@ -878,7 +878,7 @@ fn without_nodes(n: &Arc<Node>, left_out: &dyn Fn(&Node) -> bool, changed: Optio
|
||||
/// absent; an error when it is not four finite numbers with a positive size, when the format isn't
|
||||
/// a raster one, or when it comes with an artboard choice (`rect` is the area, so those would
|
||||
/// contradict it). The image size limits are checked with the scale, as for an artboard.
|
||||
fn page_rect(f: &Format, p: &Value) -> Result<Option<Rect>> {
|
||||
pub(super) fn page_rect(f: &Format, p: &Value) -> Result<Option<Rect>> {
|
||||
let v = match p.get("rect") {
|
||||
None | Some(Value::Null) => return Ok(None),
|
||||
Some(v) => v,
|
||||
|
||||
@@ -6,6 +6,7 @@ use serde_json::Value;
|
||||
use vectorcraft_cad::hpgl::write::{DEFAULT_TOLERANCE, MAX_PENS, TOLERANCE_RANGE};
|
||||
use vectorcraft_cad::hpgl::{HpglOptions, Origin, Version};
|
||||
use vectorcraft_doc::Document;
|
||||
use vectorcraft_geom::Rect;
|
||||
|
||||
use super::super::{Result, bad, number_or, switch_or, text_param};
|
||||
use super::{ArtboardPick, Encoded, FormatOption};
|
||||
@@ -92,10 +93,58 @@ fn hex(v: &Value) -> Option<[u8; 3]> {
|
||||
Some([byte(0)?, byte(2)?, byte(4)?])
|
||||
}
|
||||
|
||||
/// Encode `doc` as HP-GL: a plot of the chosen artboard (default the first), or with
|
||||
/// `use_artboards` one plot per chosen artboard (default all), with one pen numbering for them all.
|
||||
pub(super) fn encode(doc: &Document, p: &Value, use_artboards: Option<bool>) -> Result<Encoded> {
|
||||
let opts = parse(p)?;
|
||||
/// Check the HP-GL options and the artboard choice in `p` for an export of `doc`, as the export
|
||||
/// reads them, without exporting (dialogs keep themselves open on an error).
|
||||
pub fn check(doc: &Document, p: &Value) -> std::result::Result<(), String> {
|
||||
let run = || -> Result<()> {
|
||||
parse(p)?;
|
||||
let f = super::format("hpgl").ok_or_else(|| bad(C, "no HP-GL format"))?;
|
||||
// The export refuses `rect` for HP-GL.
|
||||
super::encode::page_rect(f, p)?;
|
||||
with_plotted(doc, p, |_, _| Ok(()))
|
||||
};
|
||||
run().map_err(|e| e.to_string())
|
||||
}
|
||||
|
||||
/// The pen table an export of `doc` with the options and artboard choice in `p`, and no `pens`,
|
||||
/// uses: pen 1's color first, as `#rrggbb` colors. Empty when the options or the artboard choice
|
||||
/// are refused, or nothing is plotted.
|
||||
pub fn automatic_pens(doc: &Document, p: &Value) -> Vec<String> {
|
||||
let run = || -> Result<Vec<[u8; 3]>> {
|
||||
let mut q = p.clone();
|
||||
if let Some(o) = q.as_object_mut() {
|
||||
o.remove("pens");
|
||||
}
|
||||
// The order the paths are drawn in doesn't change which pen a color gets.
|
||||
let opts = HpglOptions { sort: false, inside_first: false, ..parse(&q)? };
|
||||
with_plotted(doc, &q, |doc, regions| {
|
||||
let plots = vectorcraft_cad::hpgl::export_regions(doc, &opts, ®ions).map_err(|e| bad(C, e))?;
|
||||
Ok(plots.first().map(|o| o.pens.clone()).unwrap_or_default())
|
||||
})
|
||||
};
|
||||
run().unwrap_or_default().iter().map(|[r, g, b]| format!("#{r:02x}{g:02x}{b:02x}")).collect()
|
||||
}
|
||||
|
||||
/// Run `f` on the document an export of `doc` with `p` plots and the regions of its plots: with
|
||||
/// `useArtboards: false`, a copy of `doc` whose one artboard is the bounds of the visible art.
|
||||
/// Like the export, it leaves out an opacity-mask or symbol editing layer, and measures the bounds
|
||||
/// without the art a plot draws nothing for.
|
||||
fn with_plotted<T>(doc: &Document, p: &Value, f: impl FnOnce(&Document, Vec<Rect>) -> Result<T>) -> Result<T> {
|
||||
let doc = &*doc.without_edit_modes();
|
||||
let use_artboards = super::encode::use_artboards(C, p)?;
|
||||
if use_artboards == Some(false)
|
||||
&& let Some((art, q)) = super::encode::art_page(C, doc, p, |n| vectorcraft_cad::hpgl::write::plots_nothing(doc, n))?
|
||||
{
|
||||
let (_, regions) = boards(&art, &q, None)?;
|
||||
return f(&art, regions);
|
||||
}
|
||||
let (_, regions) = boards(doc, p, use_artboards)?;
|
||||
f(doc, regions)
|
||||
}
|
||||
|
||||
/// The artboards a plot of `doc` covers and their regions: the chosen artboard (default the
|
||||
/// first), or with `use_artboards` each chosen one (default all).
|
||||
fn boards(doc: &Document, p: &Value, use_artboards: Option<bool>) -> Result<(Vec<usize>, Vec<Rect>)> {
|
||||
let f = super::format("hpgl").ok_or_else(|| bad(C, "no HP-GL format"))?;
|
||||
let pick: ArtboardPick = super::encode::options(f, p)?;
|
||||
let n = doc.artboards.len();
|
||||
@@ -103,10 +152,25 @@ pub(super) fn encode(doc: &Document, p: &Value, use_artboards: Option<bool>) ->
|
||||
Some(true) => pick.resolve(n).map_err(|e| bad(C, e))?.unwrap_or_else(|| (0..n).collect()),
|
||||
_ => vec![pick.one(n).map_err(|e| bad(C, e))?],
|
||||
};
|
||||
if boards.is_empty() {
|
||||
return Err(bad(C, "the document has no artboard"));
|
||||
}
|
||||
let regions = boards
|
||||
.iter()
|
||||
.map(|&b| doc.artboards.get(b).map(|a| a.rect).ok_or_else(|| bad(C, format!("no artboard {}", b + 1))))
|
||||
.collect::<Result<Vec<_>>>()?;
|
||||
// The writer's own region check, so a dialog's check refuses what the writer refuses.
|
||||
for r in ®ions {
|
||||
vectorcraft_cad::hpgl::write::check_region(*r).map_err(|e| bad(C, e))?;
|
||||
}
|
||||
Ok((boards, regions))
|
||||
}
|
||||
|
||||
/// Encode `doc` as HP-GL: a plot of the chosen artboard (default the first), or with
|
||||
/// `use_artboards` one plot per chosen artboard (default all), with one pen numbering for them all.
|
||||
pub(super) fn encode(doc: &Document, p: &Value, use_artboards: Option<bool>) -> Result<Encoded> {
|
||||
let opts = parse(p)?;
|
||||
let (boards, regions) = boards(doc, p, use_artboards)?;
|
||||
let plots = vectorcraft_cad::hpgl::export_regions(doc, &opts, ®ions).map_err(|e| bad(C, e))?;
|
||||
let mut enc = Encoded::default();
|
||||
for (b, out) in boards.into_iter().zip(plots) {
|
||||
@@ -118,9 +182,6 @@ pub(super) fn encode(doc: &Document, p: &Value, use_artboards: Option<bool>) ->
|
||||
}
|
||||
enc.add_setting_notes(out.setting_notes);
|
||||
}
|
||||
if enc.files.is_empty() {
|
||||
return Err(bad(C, "the document has no artboard"));
|
||||
}
|
||||
let regions: Vec<vectorcraft_geom::Rect> = enc.files.iter().filter_map(|(b, _)| b.and_then(|b| doc.artboards.get(b))).map(|a| a.rect).collect();
|
||||
enc.warnings.extend(crate::cmd::fonts::export_overflow_warning(doc, &doc.layers, Some(®ions)));
|
||||
Ok(enc)
|
||||
|
||||
@@ -534,6 +534,71 @@ fn export_options_are_checked() {
|
||||
let p = json!({"format": "hpgl", "origin": "CENTER", "pens": ["#ff0000", "#000000"], "curveTolerance": 10, "sortPaths": true});
|
||||
let plot = String::from_utf8(bytes(&s.execute("document.export", &p).unwrap())).unwrap();
|
||||
assert_eq!(plot, "IN;PU;SP2;PU-141,141;PD-564,141,-564,564,-141,564,-141,141;PU;SP0;");
|
||||
// The check a dialog runs refuses the same options, and passes the given ones.
|
||||
let doc = s.doc().unwrap().doc.clone();
|
||||
assert!(hpgl::check(&doc, &json!({"pens": ["#ff0000", "red"]})).unwrap_err().contains("`pens`"));
|
||||
assert!(hpgl::check(&doc, &json!({"curveTolerance": 11})).unwrap_err().contains("`curveTolerance`"));
|
||||
assert_eq!(hpgl::check(&doc, &p), Ok(()));
|
||||
// It checks the artboard choice as the export does: an artboard or range past the document's,
|
||||
// a `useArtboards` that isn't true or false, and the art's bounds when no art shows.
|
||||
let mut blank = Session::new();
|
||||
blank.execute("file.new", &json!({"width": 100, "height": 100})).unwrap();
|
||||
let blank_doc = blank.doc().unwrap().doc.clone();
|
||||
for (on_blank, p) in [
|
||||
(false, json!({"format": "hpgl", "artboard": 2})),
|
||||
(false, json!({"format": "hpgl", "useArtboards": true, "range": "1-3"})),
|
||||
(false, json!({"format": "hpgl", "artboards": [0, 1]})),
|
||||
(false, json!({"format": "hpgl", "useArtboards": "yes"})),
|
||||
(true, json!({"format": "hpgl", "useArtboards": false})),
|
||||
] {
|
||||
let (session, d) = if on_blank { (&mut blank, &blank_doc) } else { (&mut s, &doc) };
|
||||
assert!(hpgl::check(d, &p).is_err(), "{p}");
|
||||
assert!(session.execute("document.export", &p).is_err(), "{p}");
|
||||
}
|
||||
// An artboard with no width is refused before the writer refuses it.
|
||||
let mut flat = vectorcraft_doc::Document::clone(&doc);
|
||||
flat.artboards[1].rect = vectorcraft_geom::Rect::new(200.0, 0.0, 200.0, 100.0);
|
||||
assert_eq!(hpgl::check(&flat, &json!({"artboard": 1})).unwrap_err(), hpgl::check(&flat, &json!({"useArtboards": true})).unwrap_err());
|
||||
assert!(hpgl::check(&flat, &json!({"artboard": 1})).unwrap_err().contains("the export region is empty"));
|
||||
assert_eq!(hpgl::check(&flat, &json!({})), Ok(()));
|
||||
// A document with no artboard has nothing to plot on one, or on each.
|
||||
flat.artboards.clear();
|
||||
for p in [json!({}), json!({"useArtboards": true})] {
|
||||
assert!(hpgl::check(&flat, &p).unwrap_err().contains("the document has no artboard"), "{p}");
|
||||
}
|
||||
// An area of the page is a raster export's option: the export refuses it, and so does the check.
|
||||
let rect = json!({"format": "hpgl", "rect": [0, 0, 10, 10]});
|
||||
assert!(s.execute("document.export", &rect).is_err());
|
||||
assert!(hpgl::check(&doc, &rect).unwrap_err().contains("rect applies to raster formats"));
|
||||
assert_eq!(hpgl::check(&doc, &json!({"useArtboards": true, "range": "2"})), Ok(()));
|
||||
assert_eq!(hpgl::check(&doc, &json!({"useArtboards": false})), Ok(()));
|
||||
}
|
||||
|
||||
/// The pens an export without a pen table uses: one per color the plotted art draws in, in the
|
||||
/// order it first draws in each, over the artboards or the art's bounds the export plots.
|
||||
#[test]
|
||||
fn automatic_pens_list_the_plotted_art_s_colors_in_pen_order() {
|
||||
let s = two_boards();
|
||||
let doc = &s.doc().unwrap().doc;
|
||||
let pens = |p: Value| hpgl::automatic_pens(doc, &p);
|
||||
assert_eq!(pens(json!({})), ["#000000"], "the first artboard");
|
||||
assert_eq!(pens(json!({"artboard": 1})), ["#ff0000"]);
|
||||
assert_eq!(pens(json!({"useArtboards": true})), ["#000000", "#ff0000"], "one numbering for every file");
|
||||
assert_eq!(pens(json!({"useArtboards": false})), ["#000000", "#ff0000"], "the art's bounds");
|
||||
// The pens given and the path order are not the export's own pens.
|
||||
assert_eq!(pens(json!({"useArtboards": true, "pens": ["#00ff00"], "sortPaths": true})), ["#000000", "#ff0000"]);
|
||||
// A refused artboard choice: no pens.
|
||||
assert!(pens(json!({"artboard": 5})).is_empty());
|
||||
|
||||
// Art outside every artboard is plotted only with the art's bounds.
|
||||
let mut off = Session::new();
|
||||
off.execute("file.new", &json!({"width": 100, "height": 100})).unwrap();
|
||||
off.execute("paint.setFill", &json!({"none": true})).unwrap();
|
||||
off.execute("paint.setStroke", &json!({"color": "#0000ff"})).unwrap();
|
||||
off.execute("shape.rectangle", &json!({"x": 500, "y": 500, "width": 30, "height": 30})).unwrap();
|
||||
let doc = &off.doc().unwrap().doc;
|
||||
assert!(hpgl::automatic_pens(doc, &json!({})).is_empty());
|
||||
assert_eq!(hpgl::automatic_pens(doc, &json!({"useArtboards": false})), ["#0000ff"]);
|
||||
}
|
||||
|
||||
/// `insideFirst` draws the square inside the other one first, though it was made last.
|
||||
|
||||
@@ -1755,6 +1755,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"",
|
||||
"{path?, useArtboards?, range?, …document.exportEps options} open EPS Options (dialog `epsOptions`: fields = these options over the ones used last; Custom… sets `flattener`, which a flattenerPreset given without it drops); OK checks them, remembers them and writes path (else asks). Export As… → EPS opens it too",
|
||||
),
|
||||
(
|
||||
"ui.hpglOptionsDialog",
|
||||
"HP-GL Options Dialog",
|
||||
"",
|
||||
"{path?, useArtboards?, range?, hpglVersion?, curveTolerance?, origin?, pens?, sortPaths?, insideFirst?} open HP-GL Options (dialog `hpglOptions`: fields = these document.export options over the ones used last; pens null is One Pen per Color); OK checks them, remembers them and writes path (else asks). Export As… → HP-GL opens it too",
|
||||
),
|
||||
(
|
||||
"file.saveForWeb",
|
||||
"Save for Web (Legacy)…",
|
||||
|
||||
@@ -60,6 +60,7 @@ pub mod graph_design;
|
||||
pub mod graph_type;
|
||||
pub mod graphic_style_options;
|
||||
pub mod halftone;
|
||||
pub mod hpgl_options;
|
||||
pub mod hyphenation;
|
||||
pub mod import_pdf;
|
||||
pub mod indexed_color;
|
||||
@@ -421,6 +422,7 @@ registry! {
|
||||
DivideSlices: [slices::DIVIDE] => slices::DIVIDE_SPEC,
|
||||
EpsOptions: [eps_options::KIND] => eps_options::SPEC,
|
||||
EpsFlattenerOptions: [eps_options::CUSTOM_KIND] => eps_options::CUSTOM_SPEC,
|
||||
HpglOptions: [hpgl_options::KIND] => hpgl_options::SPEC,
|
||||
Recovery: [crate::recovery::KIND] => recovery::SPEC,
|
||||
PluginStopped: [safe_mode::STOPPED] => safe_mode::STOPPED_SPEC,
|
||||
SafeMode: [safe_mode::KIND] => safe_mode::SPEC,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! artboard, after a central file of the whole document for EPS with two or more when art shows,
|
||||
//! or one page each in a PDF); without artboards the export covers the visible art. OK
|
||||
//! picks the file, then the format's options dialog follows (PNG/JPEG/WebP/PNG-8/GIF Options, SVG
|
||||
//! Options, Text Export Options, DXF Options, EPS Options, and Save PDF),
|
||||
//! Options, Text Export Options, DXF Options, EPS Options, HP-GL Options, and Save PDF),
|
||||
//! else the file is written. DWG is listed, greyed out, with what to use instead. The formats of
|
||||
//! installed exporter plug-ins come after the built-in ones: they write the whole document (from
|
||||
//! Export Selection, the selection), and one with parameters asks for them before writing
|
||||
@@ -14,7 +14,7 @@ use std::sync::LazyLock;
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_engine::cmd::fileio::{self, ArtboardPick, Format};
|
||||
|
||||
use super::{DialogSpec, dxf_options, eps_options, form, plugin, png_options, save_pdf, svg_options, text_export};
|
||||
use super::{DialogSpec, dxf_options, eps_options, form, hpgl_options, plugin, png_options, save_pdf, svg_options, text_export};
|
||||
use crate::state::Dialog;
|
||||
use crate::theme::Tokens;
|
||||
use crate::{VectorcraftApp, io, widgets};
|
||||
@@ -255,6 +255,10 @@ fn options_or_write(
|
||||
eps_options::open(app, ¶ms);
|
||||
return Ok(Value::Null);
|
||||
}
|
||||
if f.id == "hpgl" {
|
||||
hpgl_options::open(app, ¶ms);
|
||||
return Ok(Value::Null);
|
||||
}
|
||||
return io::export(app, Some(f.id), Some(path), ¶ms);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
//! HP-GL Options (Export As → HP-GL): the language version, the curve tolerance, where the plot's
|
||||
//! origin lies, the pens (one per color the art draws in, or a pen table of colors), and the order
|
||||
//! the paths are drawn in (the nearest path next, inner paths first).
|
||||
//!
|
||||
//! Fields: `document.export` params (`format: hpgl`, `path?`, the artboard choice) and the HP-GL
|
||||
//! options (`hpglVersion`, `curveTolerance`, `origin`, `pens`, `sortPaths`, `insideFirst`). OK
|
||||
//! remembers the options for next time and writes the file (asking where when there is no path);
|
||||
//! an option or artboard choice the export refuses keeps the dialog open. A typed Curve Tolerance
|
||||
//! is kept within 0.01 to 10 points.
|
||||
|
||||
use serde_json::{Map, Value, json};
|
||||
use vectorcraft_cad::hpgl::write::{DEFAULT_TOLERANCE, MAX_PENS, TOLERANCE_RANGE};
|
||||
use vectorcraft_cad::hpgl::{Origin, Version};
|
||||
use vectorcraft_engine::cmd::fileio;
|
||||
|
||||
use super::DialogSpec;
|
||||
use super::document_setup::{LABEL, check, choice};
|
||||
use crate::state::Dialog;
|
||||
use crate::{VectorcraftApp, io, widgets};
|
||||
|
||||
pub(super) const KIND: &str = "hpglOptions";
|
||||
|
||||
pub(super) const SPEC: DialogSpec = DialogSpec {
|
||||
heading: |_| tl!("HP-GL Options").into(),
|
||||
body,
|
||||
confirm,
|
||||
ok: Some("Export"),
|
||||
min_width: 420.0,
|
||||
max_width: Some(460.0),
|
||||
inputs: |_| &["path"],
|
||||
..DialogSpec::FORM
|
||||
};
|
||||
|
||||
/// Fields that are not remembered between exports (they belong to one export).
|
||||
const PER_EXPORT: [&str; 7] = ["format", "path", "useArtboards", "range", "artboard", "artboards", "selectedOnly"];
|
||||
|
||||
/// The pen table set aside while One Pen per Color is chosen, so Pen Table shows it again.
|
||||
const SET_ASIDE: &str = "__pens";
|
||||
|
||||
/// The Origin menu's names, in [`Origin::ALL`] order.
|
||||
pub(crate) const ORIGIN_NAMES: [&str; 2] = ["Bottom Left", "Center"];
|
||||
|
||||
/// The options a first HP-GL Options dialog starts from (the export's defaults).
|
||||
fn defaults() -> Map<String, Value> {
|
||||
let mut m = Map::new();
|
||||
for (k, v) in [
|
||||
("hpglVersion", json!(Version::default().id())),
|
||||
("curveTolerance", json!(DEFAULT_TOLERANCE)),
|
||||
("origin", json!(Origin::default().id())),
|
||||
("pens", Value::Null),
|
||||
("sortPaths", json!(false)),
|
||||
("insideFirst", json!(false)),
|
||||
] {
|
||||
m.insert(k.into(), v);
|
||||
}
|
||||
m
|
||||
}
|
||||
|
||||
/// Open HP-GL Options for an export whose params (path, artboard choice, any HP-GL option) are
|
||||
/// `params`, over the options used last.
|
||||
pub fn open(app: &mut VectorcraftApp, params: &Value) {
|
||||
let mut fields = defaults();
|
||||
for given in [&app.ui.hpgl_options, params] {
|
||||
if let Some(o) = given.as_object() {
|
||||
fields.extend(o.iter().map(|(k, v)| (k.clone(), v.clone())));
|
||||
}
|
||||
}
|
||||
fields.insert("format".into(), json!("hpgl"));
|
||||
app.ui.dialog = Some(Dialog::new(KIND, Value::Object(fields)));
|
||||
}
|
||||
|
||||
fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
|
||||
let versions: Vec<(&str, &str)> = Version::ALL.iter().map(|v| (v.id(), v.label())).collect();
|
||||
choice(ui, d, "hpglVersion", tl!("Version:"), &versions);
|
||||
ui.add_space(4.0);
|
||||
widgets::label_row(ui, tl!("Curve Tolerance:"), LABEL, |ui| {
|
||||
let x = d.f64("curveTolerance", DEFAULT_TOLERANCE);
|
||||
if let Some(v) = widgets::plain_field(ui, "hpgl-tolerance", x, " pt", 2, 80.0) {
|
||||
let (lo, hi) = (*TOLERANCE_RANGE.start(), *TOLERANCE_RANGE.end());
|
||||
d.fields.insert("curveTolerance".into(), json!(v.clamp(lo, hi)));
|
||||
}
|
||||
});
|
||||
ui.add_space(4.0);
|
||||
let origins: Vec<(&str, &str)> = Origin::ALL.iter().map(|o| o.id()).zip(ORIGIN_NAMES).collect();
|
||||
choice(ui, d, "origin", tl!("Origin:"), &origins);
|
||||
ui.add_space(10.0);
|
||||
pens(app, ui, d);
|
||||
ui.add_space(8.0);
|
||||
check(ui, d, "sortPaths", tl!("Draw the Nearest Path Next"));
|
||||
check(ui, d, "insideFirst", tl!("Draw Inner Paths First"));
|
||||
false
|
||||
}
|
||||
|
||||
/// Pens: One Pen per Color (`pens` null) or Pen Table (`pens` the colors, pen 1's first), with a
|
||||
/// row per pen (its number, color and a Remove button) and Add.
|
||||
fn pens(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) {
|
||||
let table = d.fields.get("pens").is_some_and(Value::is_array);
|
||||
widgets::label_row(ui, tl!("Pens:"), LABEL, |ui| {
|
||||
if widgets::radio(ui, tl!("One Pen per Color"), !table, true) {
|
||||
set_pen_table(d, false, Vec::new);
|
||||
}
|
||||
ui.add_space(12.0);
|
||||
if widgets::radio(ui, tl!("Pen Table"), table, true) {
|
||||
let params = super::form::params(d);
|
||||
set_pen_table(d, true, || automatic_pens(app, ¶ms));
|
||||
}
|
||||
});
|
||||
// The table as the radio buttons left it, so a row edit committed this frame can't undo a switch.
|
||||
// A table longer than a plot takes (set through `ui.dialog.set`) draws no rows: OK refuses it.
|
||||
let Some(mut list) = d.fields.get("pens").and_then(Value::as_array).filter(|a| a.len() <= MAX_PENS).cloned() else { return };
|
||||
let t = crate::theme::Tokens::get(ui.ctx());
|
||||
let n = list.len();
|
||||
let (mut changed, mut remove) = (false, None);
|
||||
egui::ScrollArea::vertical().id_salt("hpgl-pens").max_height(180.0).auto_shrink([false, true]).show(ui, |ui| {
|
||||
for (i, v) in list.iter_mut().enumerate() {
|
||||
ui.horizontal(|ui| {
|
||||
ui.add_space(LABEL + 8.0);
|
||||
ui.add_sized([28.0, 18.0], egui::Label::new(egui::RichText::new((i + 1).to_string()).color(t.text)));
|
||||
let hex = v.as_str().and_then(|s| s.strip_prefix('#')).unwrap_or_default().to_string();
|
||||
let (rect, _) = ui.allocate_exact_size(egui::vec2(20.0, 18.0), egui::Sense::hover());
|
||||
if let Some([r, g, b]) = rgb(&hex) {
|
||||
ui.painter().rect_filled(rect, 2.0, egui::Color32::from_rgb(r, g, b));
|
||||
}
|
||||
ui.painter().rect_stroke(rect, 2.0, egui::Stroke::new(1.0, t.input_border), egui::StrokeKind::Inside);
|
||||
if let Some(typed) = widgets::hex_field(ui, ("hpgl-pen", i), &hex)
|
||||
&& let Some(color) = pen_color(&typed)
|
||||
{
|
||||
*v = json!(color);
|
||||
changed = true;
|
||||
}
|
||||
if widgets::icon_button_enabled(ui, "x", tl!("Remove"), false, n > 1, 22.0).clicked() {
|
||||
remove = Some(i);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
ui.horizontal(|ui| {
|
||||
ui.add_space(LABEL + 8.0);
|
||||
if ui.add_enabled(n < MAX_PENS, |ui: &mut egui::Ui| widgets::flat_button(ui, tl!("Add"), 60.0)).clicked() {
|
||||
// A new pen starts as the last one's color, ready to be changed.
|
||||
list.push(list.last().cloned().unwrap_or_else(|| json!("#000000")));
|
||||
changed = true;
|
||||
}
|
||||
});
|
||||
if let Some(i) = remove.filter(|_| list.len() > 1) {
|
||||
list.remove(i);
|
||||
changed = true;
|
||||
}
|
||||
if changed {
|
||||
d.fields.insert("pens".into(), Value::Array(list));
|
||||
}
|
||||
}
|
||||
|
||||
/// The pens an export with the dialog's `params` and no pen table would get: its options, artboard
|
||||
/// choice and source art (the selection with Export Selected Art Only).
|
||||
pub(super) fn automatic_pens(app: &VectorcraftApp, params: &Value) -> Vec<String> {
|
||||
let Some(st) = app.session.active() else { return Vec::new() };
|
||||
fileio::export_source(st, params).map(|doc| fileio::hpgl::automatic_pens(&doc, params)).unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Choose Pen Table (`on`) or One Pen per Color. Pen Table shows the table set aside when One Pen
|
||||
/// per Color was chosen, else the pens the export would give the art (`automatic`), else one black
|
||||
/// pen; One Pen per Color sets the table aside.
|
||||
pub(super) fn set_pen_table(d: &mut Dialog, on: bool, automatic: impl FnOnce() -> Vec<String>) {
|
||||
let table = d.fields.get("pens").filter(|v| v.is_array()).cloned();
|
||||
match (on, table) {
|
||||
(true, None) => {
|
||||
let kept = d.fields.remove(SET_ASIDE).filter(|v| v.as_array().is_some_and(|a| !a.is_empty()));
|
||||
let list = kept.unwrap_or_else(|| {
|
||||
let mut pens = automatic();
|
||||
pens.truncate(MAX_PENS);
|
||||
if pens.is_empty() {
|
||||
pens.push("#000000".into());
|
||||
}
|
||||
json!(pens)
|
||||
});
|
||||
d.fields.insert("pens".into(), list);
|
||||
}
|
||||
(false, Some(list)) => {
|
||||
d.fields.insert(SET_ASIDE.into(), list);
|
||||
d.fields.insert("pens".into(), Value::Null);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
/// A typed pen color (`ff0000` or `#FF0000`) as the table holds it, `#ff0000`; `None` unless it is
|
||||
/// six hex digits.
|
||||
fn pen_color(typed: &str) -> Option<String> {
|
||||
let s = typed.trim();
|
||||
let s = s.strip_prefix('#').unwrap_or(s);
|
||||
rgb(s).map(|_| format!("#{}", s.to_ascii_lowercase()))
|
||||
}
|
||||
|
||||
/// Six hex digits as a color.
|
||||
fn rgb(hex: &str) -> Option<[u8; 3]> {
|
||||
if hex.len() != 6 || !hex.bytes().all(|b| b.is_ascii_hexdigit()) {
|
||||
return None;
|
||||
}
|
||||
let byte = |i: usize| hex.get(i..i + 2).and_then(|h| u8::from_str_radix(h, 16).ok());
|
||||
Some([byte(0)?, byte(2)?, byte(4)?])
|
||||
}
|
||||
|
||||
/// Check the options, remember them, and write the file(s).
|
||||
fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
|
||||
let params = super::form::params(d);
|
||||
let st = app.session.active().ok_or("no document")?;
|
||||
// A bad option or artboard choice, nothing selected, or no art to export keeps the dialog open.
|
||||
let source = fileio::export_source(st, ¶ms).map_err(|e| e.to_string())?;
|
||||
fileio::hpgl::check(&source, ¶ms)?;
|
||||
let remembered = params.as_object().map(|o| o.iter().filter(|(k, _)| !PER_EXPORT.contains(&k.as_str())).map(|(k, v)| (k.clone(), v.clone())));
|
||||
app.ui.hpgl_options = Value::Object(remembered.into_iter().flatten().collect());
|
||||
app.ui.dialog = None;
|
||||
let path = d.fields.get("path").and_then(Value::as_str).map(str::to_string);
|
||||
io::export(app, Some("hpgl"), path, ¶ms)
|
||||
}
|
||||
@@ -1,28 +1,165 @@
|
||||
//! Export As → HP-GL, drawn headlessly: listed with the other formats, written straight away (no
|
||||
//! options dialog), one plot per artboard with Use Artboards.
|
||||
//! Export As → HP-GL, drawn headlessly: listed with the other formats, then HP-GL Options (version,
|
||||
//! curve tolerance, origin, pens, path order), remembered for the next export, and one plot per
|
||||
//! artboard with Use Artboards.
|
||||
|
||||
use serde_json::json;
|
||||
use vectorcraft_engine::cmd::fileio;
|
||||
|
||||
use super::tests_export::{app, frame, kind, names, set};
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn export_as_lists_hpgl_and_writes_plots() {
|
||||
fn export_as_hpgl_shows_hpgl_options_then_writes_and_remembers_them() {
|
||||
let (mut app, written) = app(2);
|
||||
app.run("file.exportAs", json!({"format": "hpgl"})).unwrap();
|
||||
assert_eq!(kind(&app), Some("exportAs"));
|
||||
assert_eq!(app.ui.dialog.as_ref().unwrap().str("format"), "hpgl");
|
||||
frame(&mut app);
|
||||
confirm(&mut app).unwrap();
|
||||
assert_eq!(kind(&app), Some("hpglOptions"), "HP-GL Options follow");
|
||||
let d = app.ui.dialog.as_ref().unwrap();
|
||||
assert_eq!((d.str("path"), d.str("hpglVersion"), d.str("origin")), ("/out/Untitled-1.plt".into(), "hpgl".into(), "bottomLeft".into()));
|
||||
assert_eq!((d.f64("curveTolerance", 0.0), d.fields["pens"].is_null(), d.bool("sortPaths"), d.bool("insideFirst")), (0.1, true, false, false));
|
||||
frame(&mut app);
|
||||
// The defaults write the plot an export with this artboard choice and no HP-GL options writes.
|
||||
let fields = &app.ui.dialog.as_ref().unwrap().fields;
|
||||
let choice: serde_json::Map<String, serde_json::Value> = fields
|
||||
.iter()
|
||||
.filter(|(k, _)| ["useArtboards", "range", "artboard", "artboards"].contains(&k.as_str()))
|
||||
.map(|(k, v)| (k.clone(), v.clone()))
|
||||
.collect();
|
||||
let plain = fileio::encode(&app.session.active().unwrap().doc, "hpgl", &serde_json::Value::Object(choice)).unwrap();
|
||||
let r = confirm(&mut app).unwrap();
|
||||
assert!(app.ui.dialog.is_none(), "no options dialog follows");
|
||||
assert!(app.ui.dialog.is_none());
|
||||
assert_eq!(r["path"], "/out/Untitled-1.plt");
|
||||
assert!(written.borrow()[0].1.starts_with(b"IN;"));
|
||||
assert!(written.borrow()[0].1.ends_with(b"PU;SP0;"));
|
||||
assert_eq!(written.borrow()[0].1, plain);
|
||||
assert!(plain.starts_with(b"IN;") && plain.ends_with(b"PU;SP0;"));
|
||||
|
||||
// Every control draws, the pen table with a row per pen; OK writes the options given.
|
||||
app.run("file.exportAs", json!({"format": "hpgl"})).unwrap();
|
||||
frame(&mut app);
|
||||
confirm(&mut app).unwrap();
|
||||
set(&mut app, "hpglVersion", json!("hpgl2"));
|
||||
set(&mut app, "origin", json!("center"));
|
||||
set(&mut app, "curveTolerance", json!(0.5));
|
||||
set(&mut app, "pens", json!(["#ff0000", "#000000"]));
|
||||
set(&mut app, "sortPaths", json!(true));
|
||||
set(&mut app, "insideFirst", json!(true));
|
||||
frame(&mut app);
|
||||
confirm(&mut app).unwrap();
|
||||
// HP-GL/2 with the pen table as its palette (the encoded polylines that follow are binary).
|
||||
let plot = String::from_utf8_lossy(&written.borrow()[1].1).into_owned();
|
||||
assert!(plot.starts_with("IN;NP4;PC1,255,0,0;PC2,0,0,0;"), "{plot}");
|
||||
// The next HP-GL Options start from these choices, but not from this export's path.
|
||||
crate::menus::invoke(&mut app, "ui.hpglOptionsDialog", json!({}));
|
||||
let d = app.ui.dialog.as_ref().unwrap();
|
||||
assert_eq!((d.str("hpglVersion"), d.str("origin"), d.f64("curveTolerance", 0.0)), ("hpgl2".into(), "center".into(), 0.5));
|
||||
assert_eq!((d.fields["pens"].clone(), d.bool("sortPaths"), d.bool("insideFirst")), (json!(["#ff0000", "#000000"]), true, true));
|
||||
assert!(!d.fields.contains_key("path"));
|
||||
assert!(app.ui.hpgl_options.get("useArtboards").is_none());
|
||||
app.ui.dialog = None;
|
||||
|
||||
// One plot per artboard.
|
||||
app.run("file.exportAs", json!({"format": "hpgl"})).unwrap();
|
||||
set(&mut app, "useArtboards", json!(true));
|
||||
frame(&mut app);
|
||||
confirm(&mut app).unwrap();
|
||||
assert_eq!(kind(&app), Some("hpglOptions"));
|
||||
confirm(&mut app).unwrap();
|
||||
let n = names(&written);
|
||||
assert_eq!(&n[1..], ["/out/Untitled-1-Artboard-1.plt", "/out/Untitled-1-Artboard-2.plt"]);
|
||||
assert_eq!(&n[2..], ["/out/Untitled-1-Artboard-1.plt", "/out/Untitled-1-Artboard-2.plt"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bad_hpgl_options_keep_the_dialog_open() {
|
||||
let (mut app, written) = app(1);
|
||||
app.run("ui.hpglOptionsDialog", json!({"path": "/out/a.plt"})).unwrap();
|
||||
frame(&mut app);
|
||||
for (field, value, want) in [
|
||||
("hpglVersion", json!("hpgl3"), "`hpglVersion`"),
|
||||
("curveTolerance", json!(20), "`curveTolerance`"),
|
||||
("origin", json!("top"), "`origin`"),
|
||||
("pens", json!(["#ff0000", "red"]), "`pens`"),
|
||||
("pens", json!([]), "`pens`"),
|
||||
// More pens than a plot takes: drawn without rows, refused by OK.
|
||||
("pens", json!(vec!["#000000"; 300]), "`pens`"),
|
||||
("sortPaths", json!("yes"), "`sortPaths`"),
|
||||
// An artboard the document doesn't have.
|
||||
("artboard", json!(3), "artboard"),
|
||||
("useArtboards", json!("yes"), "useArtboards"),
|
||||
] {
|
||||
let before = app.ui.dialog.as_ref().unwrap().fields.get(field).cloned();
|
||||
set(&mut app, field, value.clone());
|
||||
frame(&mut app);
|
||||
let e = confirm(&mut app).unwrap_err();
|
||||
assert!(e.contains(want), "{field} {value}: {e}");
|
||||
assert_eq!(kind(&app), Some("hpglOptions"));
|
||||
set(&mut app, field, before.unwrap_or_default());
|
||||
}
|
||||
assert!(written.borrow().is_empty());
|
||||
assert!(app.ui.hpgl_options.is_null(), "nothing is remembered from a refused OK");
|
||||
confirm(&mut app).unwrap();
|
||||
assert_eq!(names(&written), ["/out/a.plt"]);
|
||||
}
|
||||
|
||||
/// Pen Table starts from the pens the art gets, One Pen per Color sets the table aside, and Pen
|
||||
/// Table shows it again; a document whose art draws nothing starts with one black pen.
|
||||
#[test]
|
||||
fn pen_table_starts_from_the_art_s_pens_and_comes_back() {
|
||||
let (mut app, _) = app(1);
|
||||
let automatic = fileio::hpgl::automatic_pens(&app.session.active().unwrap().doc, &json!({}));
|
||||
assert_eq!(automatic.len(), 1, "the ellipse's fill is one pen");
|
||||
app.run("ui.hpglOptionsDialog", json!({})).unwrap();
|
||||
let d = app.ui.dialog.as_mut().unwrap();
|
||||
hpgl_options::set_pen_table(d, true, || automatic.clone());
|
||||
assert_eq!(d.fields["pens"], json!(automatic));
|
||||
d.fields.insert("pens".into(), json!(["#00ff00", "#0000ff"]));
|
||||
hpgl_options::set_pen_table(d, false, Vec::new);
|
||||
assert!(d.fields["pens"].is_null());
|
||||
// Choosing One Pen per Color again keeps the table set aside.
|
||||
hpgl_options::set_pen_table(d, false, Vec::new);
|
||||
hpgl_options::set_pen_table(d, true, || panic!("the table set aside comes back"));
|
||||
assert_eq!(d.fields["pens"], json!(["#00ff00", "#0000ff"]));
|
||||
// Nothing set aside and nothing drawn: one black pen.
|
||||
d.fields.insert("pens".into(), serde_json::Value::Null);
|
||||
d.fields.remove("__pens");
|
||||
hpgl_options::set_pen_table(d, true, Vec::new);
|
||||
assert_eq!(d.fields["pens"], json!(["#000000"]));
|
||||
// The set-aside table is not an export option.
|
||||
assert!(form::params(d).get("__pens").is_none());
|
||||
frame(&mut app);
|
||||
}
|
||||
|
||||
/// The pens Pen Table starts from are those of what this export plots: the art's bounds without
|
||||
/// Use Artboards (art outside the artboard included), the selection with Export Selected Art Only,
|
||||
/// and only the art on the artboard with Use Artboards.
|
||||
#[test]
|
||||
fn pen_table_starts_from_the_pens_of_what_the_export_plots() {
|
||||
let (mut app, _) = app(1);
|
||||
let on_board = fileio::hpgl::automatic_pens(&app.session.active().unwrap().doc, &json!({}));
|
||||
assert_eq!(on_board.len(), 1, "the ellipse's fill is one pen");
|
||||
// A blue outline outside the artboard (the paint applies to the new rectangle, the selection).
|
||||
app.run("shape.rectangle", json!({"x": 500, "y": 500, "width": 30, "height": 30})).unwrap();
|
||||
app.run("paint.setFill", json!({"none": true})).unwrap();
|
||||
app.run("paint.setStroke", json!({"color": "#0000ff"})).unwrap();
|
||||
app.run("file.exportAs", json!({"format": "hpgl"})).unwrap();
|
||||
set(&mut app, "useArtboards", json!(false));
|
||||
frame(&mut app);
|
||||
confirm(&mut app).unwrap();
|
||||
assert_eq!(kind(&app), Some("hpglOptions"));
|
||||
let seed = |app: &VectorcraftApp| hpgl_options::automatic_pens(app, &form::params(app.ui.dialog.as_ref().unwrap()));
|
||||
assert_eq!(seed(&app), [on_board[0].as_str(), "#0000ff"], "the art's bounds");
|
||||
// The rectangle is the selection.
|
||||
set(&mut app, "selectedOnly", json!(true));
|
||||
assert_eq!(seed(&app), ["#0000ff"]);
|
||||
set(&mut app, "selectedOnly", json!(false));
|
||||
set(&mut app, "useArtboards", json!(true));
|
||||
assert_eq!(seed(&app), on_board);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_hpgl_options_dialog_needs_a_document() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
assert!(app.run("ui.hpglOptionsDialog", json!({})).is_err());
|
||||
assert!(!crate::menus::enabled(&app, "ui.hpglOptionsDialog"));
|
||||
}
|
||||
@@ -1007,6 +1007,15 @@ font-technology Variable Променливи
|
||||
DXF Info Информация за DXF
|
||||
DXF Options Опции за DXF
|
||||
DXF Options Dialog Диалогов прозорец с опции за DXF
|
||||
HP-GL Options Опции за HP-GL
|
||||
HP-GL Options Dialog Диалогов прозорец с опции за HP-GL
|
||||
Curve Tolerance: Толеранс на кривите:
|
||||
Origin: Начало на координатите:
|
||||
Pens: Писци:
|
||||
One Pen per Color Един писец за всеки цвят
|
||||
Pen Table Таблица на писците
|
||||
Draw the Nearest Path Next Следващ да се чертае най-близкият път
|
||||
Draw Inner Paths First Първо да се чертаят вътрешните пътища
|
||||
e.g. 1-3, 5 напр. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Всяка страница се отпечатва като едно изображение при разделителната способност на растерните ефекти на документа.
|
||||
Earth Tones Земни тонове
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1109,6 +1109,15 @@ lighting Light Svjetlo
|
||||
Document Raster Effects Settings Dialog Dijalog postavki rasterskih efekata dokumenta
|
||||
Drop Shadow Sjena
|
||||
DXF Options Dialog Dijalog DXF opcija
|
||||
HP-GL Options HP-GL opcije
|
||||
HP-GL Options Dialog Dijalog HP-GL opcija
|
||||
Curve Tolerance: Tolerancija krivulja:
|
||||
Origin: Ishodište:
|
||||
Pens: Pera:
|
||||
One Pen per Color Jedno pero po boji
|
||||
Pen Table Tabela pera
|
||||
Draw the Nearest Path Next Sljedeću crtaj najbližu putanju
|
||||
Draw Inner Paths First Prvo crtaj unutrašnje putanje
|
||||
Edit Toolbar Uredi traku s alatima
|
||||
Edit Views Uredi poglede
|
||||
Effect… Efekat…
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -1472,6 +1472,15 @@ antiAlias Sharp Nítid
|
||||
DXF Info Informació del DXF
|
||||
DXF Options Opcions del DXF
|
||||
DXF Options Dialog Diàleg d’opcions del DXF
|
||||
HP-GL Options Opcions de l’HP-GL
|
||||
HP-GL Options Dialog Diàleg d’opcions de l’HP-GL
|
||||
Curve Tolerance: Tolerància de les corbes:
|
||||
Origin: Origen:
|
||||
Pens: Plomes:
|
||||
One Pen per Color Una ploma per color
|
||||
Pen Table Taula de plomes
|
||||
Draw the Nearest Path Next Dibuixa després el traçat més proper
|
||||
Draw Inner Paths First Dibuixa primer els traçats interiors
|
||||
e.g. 1-3, 5 p. ex. 1-3, 5
|
||||
Each Design Represents: Cada disseny representa:
|
||||
Each entry of the file is matched to a VectorCraft tool, command or panel. Check the matches and answer what is left. Cada entrada del fitxer s’associa a una eina, una ordre o un panell del VectorCraft. Comprova les coincidències i respon a les que quedin.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1131,6 +1131,15 @@ lighting Light Světlo
|
||||
Document Raster Effects Settings Dialog Dialogové okno Nastavení rastrových efektů dokumentu
|
||||
Drop Shadow Vržený stín
|
||||
DXF Options Dialog Dialogové okno Možnosti DXF
|
||||
HP-GL Options Možnosti HP-GL
|
||||
HP-GL Options Dialog Dialogové okno Možnosti HP-GL
|
||||
Curve Tolerance: Tolerance křivek:
|
||||
Origin: Počátek:
|
||||
Pens: Pera:
|
||||
One Pen per Color Jedno pero pro každou barvu
|
||||
Pen Table Tabulka per
|
||||
Draw the Nearest Path Next Jako další kreslit nejbližší cestu
|
||||
Draw Inner Paths First Nejdřív kreslit vnitřní cesty
|
||||
Edit Toolbar Upravit panel nástrojů
|
||||
Edit Views Upravit zobrazení
|
||||
Effect… Efekt…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3776,6 +3776,15 @@ lighting Light Lys
|
||||
Document Raster Effects Settings Dialog Dialogboks til indstillinger for rasteriseringseffekter i dokumentet
|
||||
Drop Shadow Slagskygge
|
||||
DXF Options Dialog Dialogboks til DXF-indstillinger
|
||||
HP-GL Options HP-GL-indstillinger
|
||||
HP-GL Options Dialog Dialogboks til HP-GL-indstillinger
|
||||
Curve Tolerance: Kurvetolerance:
|
||||
Origin: Origo:
|
||||
Pens: Penne:
|
||||
One Pen per Color Én pen pr. farve
|
||||
Pen Table Pennetabel
|
||||
Draw the Nearest Path Next Tegn den nærmeste sti som den næste
|
||||
Draw Inner Paths First Tegn indre stier først
|
||||
Edit Toolbar Redigér værktøjslinjen
|
||||
Edit Views Redigér visninger
|
||||
Effect… Effekt…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1027,6 +1027,15 @@ font-technology Variable Variabel
|
||||
DXF Info DXF-Informationen
|
||||
DXF Options DXF-Optionen
|
||||
DXF Options Dialog Dialogfeld „DXF-Optionen“
|
||||
HP-GL Options HP-GL-Optionen
|
||||
HP-GL Options Dialog Dialogfeld „HP-GL-Optionen“
|
||||
Curve Tolerance: Kurventoleranz:
|
||||
Origin: Ursprung:
|
||||
Pens: Stifte:
|
||||
One Pen per Color Ein Stift pro Farbe
|
||||
Pen Table Stifttabelle
|
||||
Draw the Nearest Path Next Nächstgelegenen Pfad als Nächstes zeichnen
|
||||
Draw Inner Paths First Innere Pfade zuerst zeichnen
|
||||
e.g. 1-3, 5 z. B. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Jede Seite wird als ein Bild gedruckt, in der Rastereffektauflösung des Dokuments.
|
||||
Earth Tones Erdtöne
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -989,6 +989,15 @@ font-technology Variable Μεταβλητές
|
||||
DXF Info Πληροφορίες DXF
|
||||
DXF Options Επιλογές DXF
|
||||
DXF Options Dialog Παράθυρο επιλογών DXF
|
||||
HP-GL Options Επιλογές HP-GL
|
||||
HP-GL Options Dialog Παράθυρο επιλογών HP-GL
|
||||
Curve Tolerance: Ανοχή καμπυλών:
|
||||
Origin: Αρχή αξόνων:
|
||||
Pens: Πένες:
|
||||
One Pen per Color Μία πένα ανά χρώμα
|
||||
Pen Table Πίνακας πενών
|
||||
Draw the Nearest Path Next Σχεδίαση της πλησιέστερης διαδρομής ως επόμενης
|
||||
Draw Inner Paths First Σχεδίαση πρώτα των εσωτερικών διαδρομών
|
||||
e.g. 1-3, 5 π.χ. 1-3, 5
|
||||
Earth Tones Γήινοι τόνοι
|
||||
East Asian Type Κείμενο Ανατολικής Ασίας
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1038,6 +1038,15 @@ font-technology Variable Variables
|
||||
DXF Info Información DXF
|
||||
DXF Options Opciones DXF
|
||||
DXF Options Dialog Cuadro de diálogo Opciones DXF
|
||||
HP-GL Options Opciones HP-GL
|
||||
HP-GL Options Dialog Cuadro de diálogo Opciones HP-GL
|
||||
Curve Tolerance: Tolerancia de las curvas:
|
||||
Origin: Origen:
|
||||
Pens: Plumas:
|
||||
One Pen per Color Una pluma por color
|
||||
Pen Table Tabla de plumas
|
||||
Draw the Nearest Path Next Dibujar a continuación el trazado más cercano
|
||||
Draw Inner Paths First Dibujar primero los trazados interiores
|
||||
e.g. 1-3, 5 p. ej. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Cada página se imprime como una imagen, con la resolución de efectos de rasterización del documento.
|
||||
Earth Tones Tonos tierra
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1105,6 +1105,15 @@ lighting Light Valo
|
||||
Document Raster Effects Settings Dialog Asiakirjan rasteritehosteiden asetusten valintaikkuna
|
||||
Drop Shadow Pudotusvarjo
|
||||
DXF Options Dialog DXF-asetusten valintaikkuna
|
||||
HP-GL Options HP-GL-asetukset
|
||||
HP-GL Options Dialog HP-GL-asetusten valintaikkuna
|
||||
Curve Tolerance: Käyrien toleranssi:
|
||||
Origin: Origo:
|
||||
Pens: Kynät:
|
||||
One Pen per Color Yksi kynä kullekin värille
|
||||
Pen Table Kynätaulukko
|
||||
Draw the Nearest Path Next Piirrä seuraavaksi lähin polku
|
||||
Draw Inner Paths First Piirrä sisemmät polut ensin
|
||||
Edit Toolbar Muokkaa työkaluriviä
|
||||
Edit Views Muokkaa näkymiä
|
||||
Effect… Tehoste…
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -1041,6 +1041,15 @@ font-technology Variable Variables
|
||||
DXF Info Informations DXF
|
||||
DXF Options Options DXF
|
||||
DXF Options Dialog Boîte de dialogue Options DXF
|
||||
HP-GL Options Options HP-GL
|
||||
HP-GL Options Dialog Boîte de dialogue Options HP-GL
|
||||
Curve Tolerance: Tolérance des courbes :
|
||||
Origin: Origine :
|
||||
Pens: Plumes :
|
||||
One Pen per Color Une plume par couleur
|
||||
Pen Table Table des plumes
|
||||
Draw the Nearest Path Next Tracer ensuite le tracé le plus proche
|
||||
Draw Inner Paths First Tracer d’abord les tracés intérieurs
|
||||
e.g. 1-3, 5 p. ex. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Chaque page s’imprime comme une seule image, à la résolution des effets de pixellisation du document.
|
||||
Earth Tones Tons terre
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1641,6 +1641,15 @@ antiAlias Sharp शार्प
|
||||
DXF Info DXF जानकारी
|
||||
DXF Options DXF ऑप्शन्स
|
||||
DXF Options Dialog DXF ऑप्शन्स डायलॉग
|
||||
HP-GL Options HP-GL ऑप्शन्स
|
||||
HP-GL Options Dialog HP-GL ऑप्शन्स डायलॉग
|
||||
Curve Tolerance: कर्व टॉलरेंस:
|
||||
Origin: ओरिजिन:
|
||||
Pens: पेन:
|
||||
One Pen per Color हर रंग के लिए एक पेन
|
||||
Pen Table पेन टेबल
|
||||
Draw the Nearest Path Next अगला सबसे नज़दीकी पाथ ड्रॉ करें
|
||||
Draw Inner Paths First पहले अंदर के पाथ ड्रॉ करें
|
||||
Dynamic Symbol डायनामिक सिंबल
|
||||
e.g. 1-3, 5 उदाहरण के लिए 1-3, 5
|
||||
Each Design Represents: प्रत्येक डिजाइन का प्रतिनिधित्व करता है:
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1326,6 +1326,15 @@ font-technology Variable Változó
|
||||
DXF Info DXF-adatok
|
||||
DXF Options DXF-beállítások
|
||||
DXF Options Dialog DXF-beállítások párbeszédablak
|
||||
HP-GL Options HP-GL-beállítások
|
||||
HP-GL Options Dialog HP-GL-beállítások párbeszédablak
|
||||
Curve Tolerance: Görbék tűréshatára:
|
||||
Origin: Origó:
|
||||
Pens: Tollak:
|
||||
One Pen per Color Színenként egy toll
|
||||
Pen Table Tolltáblázat
|
||||
Draw the Nearest Path Next A legközelebbi útvonal rajzolása következőként
|
||||
Draw Inner Paths First A belső útvonalak rajzolása először
|
||||
e.g. 1-3, 5 pl. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Minden oldal egyetlen képként nyomtatódik, a dokumentum raszteres effektusainak felbontásával.
|
||||
Earth Tones Földszínek
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1045,6 +1045,15 @@ lighting Light Cahaya
|
||||
Document Raster Effects Settings Dialog Dialog pengaturan efek raster dokumen
|
||||
Drop Shadow Bayangan jatuh
|
||||
DXF Options Dialog Dialog opsi DXF
|
||||
HP-GL Options Opsi HP-GL
|
||||
HP-GL Options Dialog Dialog opsi HP-GL
|
||||
Curve Tolerance: Toleransi kurva:
|
||||
Origin: Titik asal:
|
||||
Pens: Pena:
|
||||
One Pen per Color Satu pena per warna
|
||||
Pen Table Tabel pena
|
||||
Draw the Nearest Path Next Gambar jalur terdekat berikutnya
|
||||
Draw Inner Paths First Gambar jalur bagian dalam lebih dulu
|
||||
Edit Toolbar Edit bilah alat
|
||||
Edit Views Edit tampilan
|
||||
Effect… Efek…
|
||||
|
||||
|
@@ -1048,6 +1048,15 @@ font-technology Variable Variabili
|
||||
DXF Info Informazioni DXF
|
||||
DXF Options Opzioni DXF
|
||||
DXF Options Dialog Finestra di dialogo Opzioni DXF
|
||||
HP-GL Options Opzioni HP-GL
|
||||
HP-GL Options Dialog Finestra di dialogo Opzioni HP-GL
|
||||
Curve Tolerance: Tolleranza delle curve:
|
||||
Origin: Origine:
|
||||
Pens: Penne:
|
||||
One Pen per Color Una penna per colore
|
||||
Pen Table Tabella delle penne
|
||||
Draw the Nearest Path Next Disegna poi il tracciato più vicino
|
||||
Draw Inner Paths First Disegna prima i tracciati interni
|
||||
e.g. 1-3, 5 es. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Ogni pagina viene stampata come un'unica immagine, alla risoluzione degli effetti raster del documento.
|
||||
Earth Tones Toni della terra
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1523,6 +1523,15 @@ antiAlias Sharp シャープ
|
||||
DXF Info DXF 情報
|
||||
DXF Options DXF オプション
|
||||
DXF Options Dialog DXF オプションダイアログ
|
||||
HP-GL Options HP-GL オプション
|
||||
HP-GL Options Dialog HP-GL オプションダイアログ
|
||||
Curve Tolerance: カーブの許容値:
|
||||
Origin: 原点:
|
||||
Pens: ペン:
|
||||
One Pen per Color カラーごとに 1 本のペン
|
||||
Pen Table ペンテーブル
|
||||
Draw the Nearest Path Next 最も近いパスを次に描画
|
||||
Draw Inner Paths First 内側のパスを先に描画
|
||||
Darken 比較 (暗)
|
||||
Darkness 濃さ
|
||||
Dashed 破線
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3212,6 +3212,15 @@ lighting Light სინათლე
|
||||
Document Raster Effects Settings Dialog დოკუმენტის რასტრული ეფექტების პარამეტრების დიალოგი
|
||||
Drop Shadow ჩრდილი
|
||||
DXF Options Dialog DXF პარამეტრების დიალოგი
|
||||
HP-GL Options HP-GL-ის პარამეტრები
|
||||
HP-GL Options Dialog HP-GL პარამეტრების დიალოგი
|
||||
Curve Tolerance: მრუდების დაშვება:
|
||||
Origin: სათავე:
|
||||
Pens: კალმები:
|
||||
One Pen per Color თითო კალამი თითო ფერზე
|
||||
Pen Table კალმების ცხრილი
|
||||
Draw the Nearest Path Next შემდეგ უახლოესი ტრაექტორიის დახატვა
|
||||
Draw Inner Paths First ჯერ შიდა ტრაექტორიების დახატვა
|
||||
Edit Toolbar ხელსაწყოთა ზოლის რედაქტირება
|
||||
Edit Views ხედების რედაქტირება
|
||||
Effect… ეფექტი…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1513,6 +1513,15 @@ antiAlias Sharp 날카롭게
|
||||
DXF Info DXF 정보
|
||||
DXF Options DXF 옵션
|
||||
DXF Options Dialog DXF 옵션 대화상자
|
||||
HP-GL Options HP-GL 옵션
|
||||
HP-GL Options Dialog HP-GL 옵션 대화상자
|
||||
Curve Tolerance: 곡선 허용치:
|
||||
Origin: 원점:
|
||||
Pens: 펜:
|
||||
One Pen per Color 색상마다 펜 하나
|
||||
Pen Table 펜 테이블
|
||||
Draw the Nearest Path Next 가장 가까운 패스를 다음에 그리기
|
||||
Draw Inner Paths First 안쪽 패스를 먼저 그리기
|
||||
Darken 어둡게
|
||||
Darkness 어둡기
|
||||
Dashed 점선
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1647,6 +1647,15 @@ lighting Light Licht
|
||||
Document Raster Effects Settings Dialog Dialoogvenster rastereffectinstellingen van document
|
||||
Drop Shadow Slagschaduw
|
||||
DXF Options Dialog Dialoogvenster DXF-opties
|
||||
HP-GL Options HP-GL-opties
|
||||
HP-GL Options Dialog Dialoogvenster HP-GL-opties
|
||||
Curve Tolerance: Curvetolerantie:
|
||||
Origin: Oorsprong:
|
||||
Pens: Pennen:
|
||||
One Pen per Color Eén pen per kleur
|
||||
Pen Table Pennentabel
|
||||
Draw the Nearest Path Next Het dichtstbijzijnde pad als volgende tekenen
|
||||
Draw Inner Paths First Binnenste paden eerst tekenen
|
||||
Edit Toolbar Werkbalk bewerken
|
||||
Edit Views Weergaven bewerken
|
||||
Effect… Effect…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1067,6 +1067,15 @@ lighting Light Światło
|
||||
Document Raster Effects Settings Dialog Okno ustawień efektów rastrowych dokumentu
|
||||
Drop Shadow Cień
|
||||
DXF Options Dialog Okno opcji DXF
|
||||
HP-GL Options Opcje HP-GL
|
||||
HP-GL Options Dialog Okno opcji HP-GL
|
||||
Curve Tolerance: Tolerancja krzywych:
|
||||
Origin: Początek układu:
|
||||
Pens: Pisaki:
|
||||
One Pen per Color Jeden pisak na kolor
|
||||
Pen Table Tabela pisaków
|
||||
Draw the Nearest Path Next Rysuj następnie najbliższą ścieżkę
|
||||
Draw Inner Paths First Najpierw rysuj ścieżki wewnętrzne
|
||||
Edit Toolbar Edytuj pasek narzędzi
|
||||
Edit Views Edytuj widoki
|
||||
Effect… Efekt…
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -730,6 +730,15 @@ antiAlias Sharp Nítido
|
||||
DXF Info Informações DXF
|
||||
DXF Options Opções DXF
|
||||
DXF Options Dialog Diálogo de Opções DXF
|
||||
HP-GL Options Opções HP-GL
|
||||
HP-GL Options Dialog Diálogo de Opções HP-GL
|
||||
Curve Tolerance: Tolerância das curvas:
|
||||
Origin: Origem:
|
||||
Pens: Canetas:
|
||||
One Pen per Color Uma caneta por cor
|
||||
Pen Table Tabela de canetas
|
||||
Draw the Nearest Path Next Desenhar em seguida o caminho mais próximo
|
||||
Draw Inner Paths First Desenhar primeiro os caminhos internos
|
||||
Dark Escuro
|
||||
Darken Escurecer
|
||||
Dashed Tracejado
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1036,6 +1036,15 @@ font-technology Variable Вариативные
|
||||
DXF Info Сведения о DXF
|
||||
DXF Options Параметры DXF
|
||||
DXF Options Dialog Диалоговое окно «Параметры DXF»
|
||||
HP-GL Options Параметры HP-GL
|
||||
HP-GL Options Dialog Диалоговое окно «Параметры HP-GL»
|
||||
Curve Tolerance: Допуск кривых:
|
||||
Origin: Начало координат:
|
||||
Pens: Перья:
|
||||
One Pen per Color Одно перо на цвет
|
||||
Pen Table Таблица перьев
|
||||
Draw the Nearest Path Next Следующим рисовать ближайший контур
|
||||
Draw Inner Paths First Сначала рисовать внутренние контуры
|
||||
e.g. 1-3, 5 напр. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Каждая страница печатается как одно изображение с разрешением растровых эффектов документа.
|
||||
Earth Tones Земляные тона
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1021,6 +1021,15 @@ font-technology Variable Variabla
|
||||
DXF Info DXF-info
|
||||
DXF Options DXF-alternativ
|
||||
DXF Options Dialog Dialogruta för DXF-alternativ
|
||||
HP-GL Options HP-GL-alternativ
|
||||
HP-GL Options Dialog Dialogruta för HP-GL-alternativ
|
||||
Curve Tolerance: Kurvtolerans:
|
||||
Origin: Origo:
|
||||
Pens: Pennor:
|
||||
One Pen per Color En penna per färg
|
||||
Pen Table Penntabell
|
||||
Draw the Nearest Path Next Rita den närmaste banan härnäst
|
||||
Draw Inner Paths First Rita inre banor först
|
||||
e.g. 1-3, 5 t.ex. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Varje sida skrivs ut som en bild, med dokumentets upplösning för rastereffekter.
|
||||
Earth Tones Jordtoner
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -928,6 +928,16 @@ fn eps_option_menu_names_are_in_complete_catalogs() {
|
||||
}
|
||||
}
|
||||
|
||||
/// HP-GL Options' Origin menu names (drawn translated by the dropdown, not through `tl!`).
|
||||
#[test]
|
||||
fn hpgl_origin_menu_names_are_in_complete_catalogs() {
|
||||
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
|
||||
for label in crate::dialogs::hpgl_options::ORIGIN_NAMES {
|
||||
assert!(lang.catalog().plain(label).is_some(), "{} is missing {label}", lang.code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Each language counts with its own plural rule: the form a count picks (`one`, then `few`, then
|
||||
/// `other`/`many`).
|
||||
#[test]
|
||||
|
||||
@@ -1017,6 +1017,15 @@ font-technology Variable Değişken
|
||||
DXF Info DXF Bilgisi
|
||||
DXF Options DXF Seçenekleri
|
||||
DXF Options Dialog DXF Seçenekleri İletişim Kutusu
|
||||
HP-GL Options HP-GL Seçenekleri
|
||||
HP-GL Options Dialog HP-GL Seçenekleri İletişim Kutusu
|
||||
Curve Tolerance: Eğri Toleransı:
|
||||
Origin: Başlangıç Noktası:
|
||||
Pens: Kalemler:
|
||||
One Pen per Color Her Renk İçin Bir Kalem
|
||||
Pen Table Kalem Tablosu
|
||||
Draw the Nearest Path Next Sonra En Yakın Yolu Çiz
|
||||
Draw Inner Paths First Önce İç Yolları Çiz
|
||||
e.g. 1-3, 5 örneğin 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Her sayfa, belgenin tarama efektleri çözünürlüğünde tek bir görüntü olarak yazdırılır.
|
||||
Earth Tones Toprak Tonları
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1042,6 +1042,15 @@ font-technology Variable Варіативні
|
||||
DXF Info Відомості про DXF
|
||||
DXF Options Параметри DXF
|
||||
DXF Options Dialog Діалогове вікно «Параметри DXF»
|
||||
HP-GL Options Параметри HP-GL
|
||||
HP-GL Options Dialog Діалогове вікно «Параметри HP-GL»
|
||||
Curve Tolerance: Допуск кривих:
|
||||
Origin: Початок координат:
|
||||
Pens: Пера:
|
||||
One Pen per Color Одне перо на колір
|
||||
Pen Table Таблиця пер
|
||||
Draw the Nearest Path Next Наступним малювати найближчий контур
|
||||
Draw Inner Paths First Спершу малювати внутрішні контури
|
||||
e.g. 1-3, 5 напр. 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Кожна сторінка друкується як одне зображення з роздільною здатністю растрових ефектів документа.
|
||||
Earth Tones Земляні тони
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1218,6 +1218,15 @@ font-technology Variable Biến thiên
|
||||
DXF Info Thông tin DXF
|
||||
DXF Options Tùy chọn DXF
|
||||
DXF Options Dialog Hộp thoại tùy chọn DXF
|
||||
HP-GL Options Tùy chọn HP-GL
|
||||
HP-GL Options Dialog Hộp thoại tùy chọn HP-GL
|
||||
Curve Tolerance: Dung sai đường cong:
|
||||
Origin: Gốc tọa độ:
|
||||
Pens: Bút:
|
||||
One Pen per Color Một bút cho mỗi màu
|
||||
Pen Table Bảng bút
|
||||
Draw the Nearest Path Next Vẽ đường dẫn gần nhất tiếp theo
|
||||
Draw Inner Paths First Vẽ các đường dẫn bên trong trước
|
||||
e.g. 1-3, 5 ví dụ: 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. Mỗi trang in như một ảnh, theo độ phân giải hiệu ứng raster của tài liệu.
|
||||
Earth Tones Tông màu đất
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -980,6 +980,15 @@ antiAlias Sharp 锐利
|
||||
DXF Info DXF 信息
|
||||
DXF Options DXF 选项
|
||||
DXF Options Dialog DXF 选项对话框
|
||||
HP-GL Options HP-GL 选项
|
||||
HP-GL Options Dialog HP-GL 选项对话框
|
||||
Curve Tolerance: 曲线容差:
|
||||
Origin: 原点:
|
||||
Pens: 笔:
|
||||
One Pen per Color 每种颜色一支笔
|
||||
Pen Table 笔表
|
||||
Draw the Nearest Path Next 接着绘制最近的路径
|
||||
Draw Inner Paths First 先绘制内部路径
|
||||
e.g. 1-3, 5 例如 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. 每页会以文档的栅格效果分辨率打印为单一图像。
|
||||
Earth Tones 大地色
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1010,6 +1010,15 @@ font-technology Variable 可變
|
||||
DXF Info DXF 資訊
|
||||
DXF Options DXF 選項
|
||||
DXF Options Dialog DXF 選項對話框
|
||||
HP-GL Options HP-GL 選項
|
||||
HP-GL Options Dialog HP-GL 選項對話框
|
||||
Curve Tolerance: 曲線容許度:
|
||||
Origin: 原點:
|
||||
Pens: 筆:
|
||||
One Pen per Color 每種顏色一支筆
|
||||
Pen Table 筆表
|
||||
Draw the Nearest Path Next 接著繪製最近的路徑
|
||||
Draw Inner Paths First 先繪製內部路徑
|
||||
e.g. 1-3, 5 例如 1-3, 5
|
||||
Each page prints as one image, at the document's raster effects resolution. 每頁會以文件的點陣效果解析度列印為單一影像。
|
||||
Earth Tones 大地色系
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1061,6 +1061,11 @@ fn run_ui_part12(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result
|
||||
crate::dialogs::eps_options::open(app, p);
|
||||
Ok(Value::Null)
|
||||
}
|
||||
"ui.hpglOptionsDialog" if app.session.active().is_none() => Err("no document".into()),
|
||||
"ui.hpglOptionsDialog" => {
|
||||
crate::dialogs::hpgl_options::open(app, p);
|
||||
Ok(Value::Null)
|
||||
}
|
||||
// Save for Web: its dialog; with settings, write the files.
|
||||
"file.saveForWeb" if p.as_object().is_none_or(|o| o.is_empty()) => crate::dialogs::save_for_web::open(app),
|
||||
"file.saveForWeb" => crate::dialogs::save_for_web::save(app, p.clone()),
|
||||
|
||||
@@ -324,7 +324,7 @@ pub fn enabled(app: &VectorcraftApp, id: &str) -> bool {
|
||||
"ui.findLinksInFolder" => crate::picks::can(app, &crate::picks::PickRequest::Folder) && app.session.active().is_some(),
|
||||
"ui.packageDialog" | "docInfo.save" => app.session.active().is_some(),
|
||||
"ui.batchDialog" => !app.ui.action_sets.is_empty() && app.ui.action_sets.iter().any(|s| !s.actions.is_empty()),
|
||||
"ui.epsOptionsDialog" => app.session.active().is_some(),
|
||||
"ui.epsOptionsDialog" | "ui.hpglOptionsDialog" => app.session.active().is_some(),
|
||||
"file.saveForWeb" | "file.saveForWeb.browser" => app.session.active().is_some(),
|
||||
"file.exportSelection" => app.session.active().is_some_and(|d| !d.selection.is_empty()),
|
||||
"css.copy" | "css.exportFile" => app.session.active().is_some(),
|
||||
|
||||
@@ -1756,6 +1756,12 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"",
|
||||
"{path?, useArtboards?, range?, …document.exportEps options} open EPS Options (dialog `epsOptions`: fields = these options over the ones used last; Custom… sets `flattener`, which a flattenerPreset given without it drops); OK checks them, remembers them and writes path (else asks). Export As… → EPS opens it too",
|
||||
),
|
||||
(
|
||||
"ui.hpglOptionsDialog",
|
||||
"HP-GL Options Dialog",
|
||||
"",
|
||||
"{path?, useArtboards?, range?, hpglVersion?, curveTolerance?, origin?, pens?, sortPaths?, insideFirst?} open HP-GL Options (dialog `hpglOptions`: fields = these document.export options over the ones used last; pens null is One Pen per Color); OK checks them, remembers them and writes path (else asks). Export As… → HP-GL opens it too",
|
||||
),
|
||||
(
|
||||
"file.saveForWeb",
|
||||
"Save for Web (Legacy)…",
|
||||
|
||||
@@ -829,6 +829,9 @@ pub struct UiState {
|
||||
/// The EPS Options chosen last (`document.exportEps` options; null: never used).
|
||||
#[serde(default)]
|
||||
pub eps_options: Value,
|
||||
/// The HP-GL Options chosen last (`document.export` HP-GL options; null: never used).
|
||||
#[serde(default)]
|
||||
pub hpgl_options: Value,
|
||||
/// The Offset Path fields confirmed last (offset, joins, miterLimit; null: never used): its
|
||||
/// dialog opens on them (#1152).
|
||||
#[serde(default)]
|
||||
@@ -1300,6 +1303,7 @@ impl Default for UiState {
|
||||
links_search: None,
|
||||
dxf_options: Value::Null,
|
||||
eps_options: Value::Null,
|
||||
hpgl_options: Value::Null,
|
||||
offset_path: Value::Null,
|
||||
smart_punctuation: Value::Null,
|
||||
average_join: Value::Null,
|
||||
|
||||
@@ -879,8 +879,16 @@ EMF and WMF: Export As… lists both formats (`file.exportAs {format: "emf"}` or
|
||||
dialog, so `ui.dialog.confirm` asks for the path and writes the file (one per artboard with Use Artboards). Open and
|
||||
Place read `.emf` and `.wmf`; a paste of `image/emf` from a system clipboard service runs `clipboard.importEmf`.
|
||||
|
||||
HP-GL: Export As… lists it (`file.exportAs {format: "hpgl"}`); it has no options dialog, so `ui.dialog.confirm` asks
|
||||
for the path and writes the `.plt` file with the default options (one per artboard with Use Artboards).
|
||||
HP-GL Options: Export As… with the HP-GL format (`file.exportAs {format: "hpgl"}`, then the save dialog), or
|
||||
`ui.hpglOptionsDialog {path?, …HP-GL options}` for agents, opens the `hpglOptions` dialog. Its fields are
|
||||
`document.export` params: `hpglVersion` (`hpgl`, `hpgl2`), `curveTolerance` (points, 0.01 to 10), `origin`
|
||||
(`bottomLeft`, `center`), `pens` (null for One Pen per Color, or the pen table's `"#rrggbb"` colors, pen 1's first),
|
||||
`sortPaths` and `insideFirst`, plus `path` and the artboard choice (`useArtboards`, `range`). A typed Curve
|
||||
Tolerance is kept within 0.01 to 10. Choosing Pen Table fills the table with the table set aside when One Pen per
|
||||
Color was chosen, else with the pens One Pen per Color gives the art this export plots (its artboards or the art's
|
||||
bounds), or one black pen when that art draws nothing. `ui.dialog.confirm` checks the options and the artboard choice
|
||||
(one the export refuses keeps the dialog open), remembers the options for the next HP-GL Options and writes the
|
||||
`.plt` file(s), asking for a path when there is none (one per artboard with Use Artboards).
|
||||
|
||||
TIFF, BMP and Targa Options: Export As… with the TIFF, BMP or Targa format (`file.exportAs {format: "tiff"}`, then
|
||||
the save dialog) opens `tiffOptions`, `bmpOptions` or `tgaOptions`: the raster rows of PNG Options (`ppi`,
|
||||
|
||||
@@ -321,7 +321,7 @@ Gradient meshes in the editing data keep each point's own color where a patch's
|
||||
| DCS 1.0 / 2.0 | place linked | place linked only (one image of the plates; spot plates as spot swatches; the composite's clipping path; each plate on its own ink in Separations Preview and print separations) | no | `crates/eps/src/dcs/tests.rs`, `crates/engine/src/tests/dcs.rs` |
|
||||
| SVG / SVGZ | open, place, save | yes | yes (SVG Options, Preserve Editing, symbols, filters, rich text) | strongest format; tests in `crates/svg/tests`; text on a path follows basic shapes as their SVG 2 equivalent paths (#1527); CSS transforms and the `font` shorthand (#1565), percentage lengths in symbols (#1596), Inkscape flowed text as area type (#1568) and Inkscape pages as artboards (#1601) import; an unsupported filter is named in its warning (#1598); an artboard exported on its own (Export As with Use Artboards, Export for Screens, Asset Export) has the artboard's name as `<title>`, Save the document's (#3544); attributes in other applications' XML namespaces (`plotter:pen="2"`) kept on their objects from import to export, as `data-*` attributes are (`crates/svg/tests/it/foreign_attributes.rs`); simple shapes export as `<rect>`, `<circle>`, `<ellipse>`, `<line>`, `<polygon>` and `<polyline>` where they draw the same as the path (#4652, `crates/svg/tests/it/basic_shapes.rs`); the regions of exported masks and filters (opacity masks, inverted masks, knockout groups) cover the art they apply to, and over type keep a region that covers any artwork (#6401, `crates/svg/tests/it/blend_export.rs`); a masked group, or a knockout group's masked group, whose content has a shadow, glow, blur or feather starts with a hidden, unpainted rectangle over the mask's region, so readers that draw a masked group only inside the box of its shapes draw those effects too (`crates/svg/tests/it/blend_export.rs`); SVG Options › Include Variable Data writes the text variables, data sets and bound type objects, and opening the SVG reads them back (`tests::variables::an_svg_with_variable_data_opens_with_its_variables_data_sets_and_bindings`) |
|
||||
| DXF | open, export | yes | yes (R12–2018) | R13–2018 closed SPLINE flags and control-point closure on import verified (#1299); circular cubic paths export as native CIRCLE/ARC where stroke semantics permit; R12 weighted strokes remain POLYLINE while non-circular curves keep the existing fallback (`crates/cad/src/tests.rs`); [Autodesk group 70](https://help.autodesk.com/cloudhelp/2024/ENU/AutoCAD-DXF/files/GUID-E1F884F8-AA90-4864-A215-3182D47A9C74.htm). DXF 2000–2018 LAYOUT objects write the paper image origin as 148/149 (was a stray 158), the shade plot codes (2004+) and the model type flag, and the plot style placeholder carries no subclass marker (#3085; structure test `r2000_and_later_files_have_the_structure_cad_apps_require`, checked with ezdxf's audit; not yet confirmed in Autodesk Fusion). DXF Options' Preset menu and `document.exportDxf`'s `dxfPreset: "cnc"` set the CNC / CAM options (#5500); VCarve QA remains open |
|
||||
| HP-GL/2 `.plt`, `.hpgl`, `.hgl`, `.hpg` | — | yes (pen moves, pens and widths, line types and attributes, circles, arcs, wedges and Bézier curves, filled and edged rectangles, wedges and polygons, encoded polylines, scaling and rotation; labels, symbol mode, raster images and hatching aren't drawn) | yes (`.plt`: each visible path once along its line, a pen per color or a pen table, type as outlines, clipping applied, HP-GL or HP-GL/2 with pen colors and encoded polylines) | recognized by its first instructions after any printer escapes, under its own extensions or one no other format reads; `crates/cad/src/hpgl/tests.rs`, `crates/cad/src/hpgl/write/tests.rs` (plots read back by the reader), `tests_hpgl.rs`, `import_fuzz.rs` |
|
||||
| HP-GL/2 `.plt`, `.hpgl`, `.hgl`, `.hpg` | — | yes (pen moves, pens and widths, line types and attributes, circles, arcs, wedges and Bézier curves, filled and edged rectangles, wedges and polygons, encoded polylines, scaling and rotation; labels, symbol mode, raster images and hatching aren't drawn) | yes (`.plt`: each visible path once along its line, a pen per color or a pen table, type as outlines, clipping applied, HP-GL or HP-GL/2 with pen colors and encoded polylines; Export As opens HP-GL Options) | recognized by its first instructions after any printer escapes, under its own extensions or one no other format reads; `crates/cad/src/hpgl/tests.rs`, `crates/cad/src/hpgl/write/tests.rs` (plots read back by the reader), `tests_hpgl.rs`, `import_fuzz.rs` |
|
||||
| DWG | open, export | no | no | no open spec; DXF instead |
|
||||
| EMF / WMF | open, export | yes | yes | an oversized embedded PNG or JPEG is refused from its header, before any pixels are decoded (#1776); a picture cut short by a reader limit, images and pattern brushes that are not read, clips that are not applied and raster operations other than a plain copy come back as warnings; tests in `crates/metafile/src/tests/import.rs` |
|
||||
| PSD | open, place, export | yes (open: layers as layers, or the merged image with `layers: false`; place: merged image, or the layers embedded as a group of objects with `layers: true`; the merged image comes in clipped by the file's clipping path; every mode and depth; `.psd` and `.pdd`) | yes (layered, max editability, point type as editable type layers with `preserveText`; `tests_psd.rs`) | PSD Import Options on File › Open and on File › Place without Link (Convert Layers to Objects, Flatten Layers to a Single Image, Import Hidden Layers, Import Slices; `tests_psdlayers.rs`, `dialogs/psd_import.rs`); slices (image resource 1050, version 6 and the version 7 and 8 descriptor) open and embed as user slices with `importSlices` (`tests_psdslices.rs`); layer comps aren't read; the embedded ICC profile's tags are 4-byte aligned (#1584) |
|
||||
|
||||
@@ -9616,6 +9616,13 @@ a warning.
|
||||
{"name":"run_command","arguments":{"command":"document.export","params":{"format":"hpgl","path":"/tmp/stencil.plt","sortPaths":true,"insideFirst":true}}}
|
||||
```
|
||||
|
||||
In the app, Export As… with the HP-GL format opens HP-GL Options (`ui.hpglOptionsDialog` opens it too): Version,
|
||||
Curve Tolerance, Origin (Bottom Left or Center), Pens (One Pen per Color, or Pen Table with a row per pen to type
|
||||
its color, remove it or add one), Draw the Nearest Path Next (`sortPaths`) and Draw Inner Paths First
|
||||
(`insideFirst`). Pen Table starts from the pens One Pen per Color gives the art this export plots (the chosen
|
||||
artboards, or the bounds of the art), or one black pen when that art draws nothing. OK checks the options and the
|
||||
artboard choice, and remembers the options for the next export.
|
||||
|
||||
## TIFF, BMP and Targa export
|
||||
|
||||
`document.export` (and `export`) writes them like the other raster formats: one artboard (or `useArtboards`, one
|
||||
|
||||
@@ -2183,6 +2183,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- EMF and WMF import warns about what the reader leaves out or does not play as the file asks, with counts: a file, or a metafile image inside it, cut short by one of the reader's limits (items, bytes kept, saved states, clip paths), images and pattern brushes that are not read, clips that are not applied, and raster operations other than a plain copy (`a_file_cut_short_by_another_limit_says_so`, `images_the_reader_does_not_read_are_counted`, `clips_that_are_not_applied_are_counted`, `raster_operations_that_are_not_played_are_counted`, `a_wmf_reports_unread_pattern_brushes_and_raster_operations`).
|
||||
- Export As › HP-GL (`document.export {format: "hpgl"}`) writes a `.plt` plot of an artboard, each artboard or the art for pen plotters and cutters: each visible path once along its line in plotter units from the artboard's bottom-left corner or center, a pen per color or a pen table, curves flattened to a tolerance, type as outlines, clipping masks and the artboard's edges applied, and HP-GL or HP-GL/2 (pen colors and encoded polylines); plots read back by the HP-GL reader give the same lines (`crates/cad/src/hpgl/write/tests.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`).
|
||||
- HP-GL export's `insideFirst` cuts each pen's paths inside before outside: a path is drawn only after the pen's paths that lie inside it (a letter's counter, a part's holes, rings within rings), touching outlines counted as inside and crossing ones not, in paint order or nearest first with `sortPaths`, within the plot's work budget; these order rules are VectorCraft's own (`crates/cad/src/hpgl/write/nest.rs`, `crates/cad/src/hpgl/write/tests.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`).
|
||||
- Export As › HP-GL opens HP-GL Options (`ui.hpglOptionsDialog`): Version, Curve Tolerance, Origin, Pens (One Pen per Color, or a Pen Table that starts from the pens the plotted art gets, with a row per pen to type its color, remove it or add one), Draw the Nearest Path Next and Draw Inner Paths First; OK checks the options and the artboard choice as the export does and remembers the options for the next export (`crates/ui-egui/src/dialogs/tests_hpgl.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`).
|
||||
- EPS and DXF in and out, EMF/WMF in and out; PNG (with PNG-8), JPEG, WebP, GIF, TIFF, BMP, Targa and layered PSD export; grayscale TIFFs with an alpha channel or other extra channels place, relink and open, the alpha as the image's transparency (#1466 in part); PSD and PSB files open and place, linked or embedded, as their merged image in every colour mode and depth (#918). EPS import runs a PostScript Level 3 interpreter written from the PostScript Language Reference: resource categories and `resourceforall`, local and global VM (`currentglobal`/`setglobal`/`gcheck`), `clipsave`/`cliprestore`, subarrays and substrings that share storage, the standard dictionaries in `systemdict`, `dictstack`, `internaldict`, executable filters and strings, `load` by any key, `//name` immediate names, `token`, `execform`, user paths, `cshow`, `rootfont`, `cachestatus`, colour rendering and halftone queries, file `status` and data read with `flushfile`, and `pdfmark` marks dropped (Discord feedback, #466, #469, #474). Masked images (`ImageType 3` in its three interleavings) and reusable streams are read, and an image's several data sources are read in turn, as the reference defines (procedures that read one file get their own rows: such images came in banded, #498). `restore` puts dictionaries back as they were at the `save`, so programs that count their saves in a dictionary read to their end (part of #505). Tiling patterns come in as pattern swatches, uncoloured ones too; Type 3 fonts' glyphs as their outlines, spaced by `ashow`/`widthshow`/`xshow`/`kshow`; mesh and function-based shadings (types 1, 4–7) as gradient meshes; sampled functions (type 0) and Flate/LZW predictors are read. It is tested with programs written from the specification in the ways common generators use these features; Inkscape/cairo EPS files open as vectors. When a file's PostScript still can't be read, it opens as its TIFF preview, its Windows metafile preview (as vectors) or its EPSI preview, and the warning (in the status bar, `document.open`/`app.open`/MCP `open_file` replies and `vectorcraft-cli info`) names the error, the operator that raised it and the procedures it ran in. Legacy PostScript `.ai` files (Illustrator 3–8, written with the prolog that defines their operators) keep their groups and nested groups (`u` … `U`), between and inside clipping groups; EPS and EMF/WMF import nest clips (and groups) at most 128 deep, so a hostile file can't exhaust the stack. DXF TEXT justified Fit or Aligned spans its two points (stretched, or scaled as a whole). PDF export writes type as real, searchable text in embedded subset fonts by default, as Illustrator's PDF presets do (Convert Text to Outlines is an option; printer's marks stay shapes), so text-heavy PDFs stay small (#733). DXF export writes each fill as its outlines followed by its hatch, so laser and cutter software, which skips hatches, gets filled art and type too (#546).
|
||||
- TIFFs that store each channel as its own plane (PlanarConfiguration 2) place, relink and open as the same image stored pixel by pixel does, 8 and 16 bits: grayscale with an alpha channel or other extra channels, and CMYK with or without them. A planar CMYK TIFF keeps its ink amounts and is stored as a CMYK TIFF with each pixel's inks together, at the file's resolution. A TIFF whose header claims more strips or tiles than can be counted is refused as too large to draw (#1466 in part; `crates/engine/src/cmd/fileio/tests.rs`).
|
||||
- A 16-bit CMYK or grayscale TIFF with an alpha channel is converted from its 16-bit samples, and only the resulting color and alpha are rounded to 8 bits; associated alpha is divided out at 16 bits, and a pixel whose associated alpha is zero has no color. [TIFF 6.0](https://printtechnologies.org/standards/files/tiff-v6.pdf) gives extra samples the depth in BitsPerSample, and its Associated Alpha Handling section states the arithmetic and the zero-alpha rule for RGB data; applying them to CMYK and gray samples is VectorCraft's own rule. Each sample was cut to its high byte first, so a faint ink or a low alpha could be lost (`crates/doc/src/cmyk.rs`, `crates/engine/src/cmd/fileio/tests.rs`).
|
||||
|
||||
Reference in new issue
Block a user