From be27667228f9edf6f06134328700512fa92f0752 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 07:16:50 -0800 Subject: [PATCH 1/3] =?UTF-8?q?EPS=20Options:=20Custom=E2=80=A6=20sets=20t?= =?UTF-8?q?he=20flattener=20options=20the=20export=20uses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit EPS Options gets a Custom… button beside the flattener Preset. It opens Custom Transparency Flattener Options over EPS Options, on the options the export would use (the raster/vector balance, both resolutions, the outline switches, Clip Complex Regions and Anti-alias Rasters). OK sends them as `flattener` with the export, and the preset shows [Custom] when they differ from its options; Cancel goes back unchanged. Choosing a preset, in the dropdown or with `ui.dialog.set`, drops the custom options. Preserve Alpha Transparency stays off for EPS, and overprints follow the Overprints choice. --- crates/mcp/src/ui_catalog.rs | 2 +- crates/ui-egui/src/dialogs.rs | 8 +- crates/ui-egui/src/dialogs/eps_options.rs | 122 ++++++++++++++++++++-- crates/ui-egui/src/dialogs/flatten.rs | 28 +++-- crates/ui-egui/src/dialogs/tests_eps.rs | 102 ++++++++++++++++++ crates/ui-egui/src/i18n/bg.tsv | 3 + crates/ui-egui/src/i18n/bs.tsv | 3 + crates/ui-egui/src/i18n/ca.tsv | 3 + crates/ui-egui/src/i18n/cs.tsv | 3 + crates/ui-egui/src/i18n/da.tsv | 3 + crates/ui-egui/src/i18n/de.tsv | 3 + crates/ui-egui/src/i18n/el.tsv | 3 + crates/ui-egui/src/i18n/es.tsv | 3 + crates/ui-egui/src/i18n/fi.tsv | 3 + crates/ui-egui/src/i18n/fr.tsv | 3 + crates/ui-egui/src/i18n/gu.tsv | 3 + crates/ui-egui/src/i18n/hi.tsv | 3 + crates/ui-egui/src/i18n/hu.tsv | 3 + crates/ui-egui/src/i18n/id.tsv | 3 + crates/ui-egui/src/i18n/it.tsv | 3 + crates/ui-egui/src/i18n/ja.tsv | 3 + crates/ui-egui/src/i18n/ka.tsv | 3 + crates/ui-egui/src/i18n/ko.tsv | 3 + crates/ui-egui/src/i18n/nl.tsv | 3 + crates/ui-egui/src/i18n/pl.tsv | 3 + crates/ui-egui/src/i18n/pt-br.tsv | 3 + crates/ui-egui/src/i18n/ru.tsv | 3 + crates/ui-egui/src/i18n/sv.tsv | 3 + crates/ui-egui/src/i18n/tr.tsv | 3 + crates/ui-egui/src/i18n/uk.tsv | 3 + crates/ui-egui/src/i18n/vi.tsv | 3 + crates/ui-egui/src/i18n/zh-hans.tsv | 3 + crates/ui-egui/src/i18n/zh-hant.tsv | 3 + crates/ui-egui/src/menus/ui_commands.rs | 2 +- docs/control-protocol.md | 10 +- docs/mcp.md | 5 +- docs/target-app-parity.md | 1 + 37 files changed, 341 insertions(+), 23 deletions(-) diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 0e3d6df203..a8b477fe63 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -1658,7 +1658,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.epsOptionsDialog", "EPS Options Dialog", "", - "{path?, useArtboards?, range?, …document.exportEps options} open EPS Options (dialog `epsOptions`: fields = these options over the ones used last); OK checks them, remembers them and writes path (else asks). Export As… → EPS opens it too", + "{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", ), ( "file.saveForWeb", diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index da1062838f..685642f323 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -415,6 +415,7 @@ registry! { SliceOptions: [slices::OPTIONS] => slices::OPTIONS_SPEC, DivideSlices: [slices::DIVIDE] => slices::DIVIDE_SPEC, EpsOptions: [eps_options::KIND] => eps_options::SPEC, + EpsFlattenerOptions: [eps_options::CUSTOM_KIND] => eps_options::CUSTOM_SPEC, Recovery: [crate::recovery::KIND] => recovery::SPEC, PluginStopped: [safe_mode::STOPPED] => safe_mode::STOPPED_SPEC, SafeMode: [safe_mode::KIND] => safe_mode::SPEC, @@ -652,7 +653,8 @@ pub(crate) fn parent(d: &Dialog) -> Option { } /// `ui.dialog.set` changed `field` of the open dialog from `old`: a choice that sets other fields -/// sets them as choosing it in the dialog does (Export for Screens' `exportPreset`), a change +/// sets them as choosing it in the dialog does (Export for Screens' `exportPreset`, EPS Options' +/// `flattenerPreset`, which drops the Custom… options), a change /// to Export for Screens' sub-folder controls ends an applied preset's item folders, as it does in /// the dialog, and Transform Each's Relative / Absolute keeps the Scale fields' size. A value /// Composite Fonts' Show Sample can't take is refused. @@ -664,6 +666,10 @@ pub(crate) fn field_set(app: &mut VectorcraftApp, field: &str, old: Option<&Valu if let Some(d) = app.ui.dialog.as_ref().filter(|d| d.kind == composite_fonts::KIND) { return composite_fonts::field_set(d, field); } + if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == eps_options::KIND) { + eps_options::field_set(d, field); + return Ok(()); + } let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == export_for_screens::KIND) else { return Ok(()) }; match field { "exportPreset" => export_for_screens::preset_set(app), diff --git a/crates/ui-egui/src/dialogs/eps_options.rs b/crates/ui-egui/src/dialogs/eps_options.rs index 8d34706df4..afe0553f87 100644 --- a/crates/ui-egui/src/dialogs/eps_options.rs +++ b/crates/ui-egui/src/dialogs/eps_options.rs @@ -6,14 +6,20 @@ //! Fields: `document.export` params (`format: eps`, `path?`, the artboard choice) and the EPS //! options of `document.exportEps`. OK remembers the options for next time and writes the file //! (asking where when there is no path); bad options keep the dialog open. +//! +//! Custom… beside the flattener preset opens Custom Transparency Flattener Options over the +//! dialog: its OK sets every flattener option as `flattener` (the preset then shows [Custom]) and +//! goes back to EPS Options; Cancel goes back with the options as they were. Choosing a preset +//! drops the custom options. use serde_json::{Map, Value, json}; -use vectorcraft_engine::cmd::{FlattenOptions, fileio}; +use vectorcraft_engine::cmd::{FlattenOptions, FlattenerPreset, fileio}; use vectorcraft_eps::{Level, Overprint, Preview}; use super::DialogSpec; use super::document_setup::{LABEL, check, choice}; use crate::state::Dialog; +use crate::theme::Tokens; use crate::{VectorcraftApp, io, widgets}; pub(super) const KIND: &str = "epsOptions"; @@ -25,7 +31,18 @@ pub(super) const SPEC: DialogSpec = DialogSpec { ok: Some("Export"), min_width: 420.0, max_width: Some(460.0), - inputs: |_| &["path"], + inputs: |_| &["path", "flattener"], + ..DialogSpec::FORM +}; + +/// Custom Transparency Flattener Options, opened over EPS Options by Custom…. +pub(super) const CUSTOM_KIND: &str = "epsFlattenerOptions"; + +pub(super) const CUSTOM_SPEC: DialogSpec = DialogSpec { + heading: |_| tl!("Custom Transparency Flattener Options").into(), + body: custom_body, + confirm: custom_confirm, + min_width: 420.0, ..DialogSpec::FORM }; @@ -61,11 +78,12 @@ pub fn open(app: &mut VectorcraftApp, params: &Value) { fields.extend(o.iter().map(|(k, v)| (k.clone(), v.clone()))); } } - fields.insert("format".into(), json!("eps")); - // A built-in preset named by id (`medium`) shows as its name. - if let Some(label) = fields.get("flattenerPreset").and_then(Value::as_str).and_then(|p| FlattenOptions::preset_label(&p.to_ascii_lowercase())) { - fields.insert("flattenerPreset".into(), json!(label)); + // A preset asked for without options of its own replaces the custom options used last. + if params.get("flattenerPreset").is_some() && params.get("flattener").is_none() { + fields.remove("flattener"); } + fields.insert("format".into(), json!("eps")); + builtin_label(&mut fields); app.ui.dialog = Some(Dialog::new(KIND, Value::Object(fields))); } @@ -90,8 +108,19 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { let overprints: Vec<(&str, &str)> = Overprint::ALL.iter().map(|o| (o.id(), o.label())).collect(); choice(ui, d, "overprints", tl!("Overprints:"), &overprints); let presets = app.session.flattener_presets(); - let names: Vec<(&str, &str)> = presets.iter().map(|p| (p.name.as_str(), p.name.as_str())).collect(); - choice(ui, d, "flattenerPreset", tl!("Preset:"), &names); + let current = flattener(d, &app.session.prefs.flattener_presets).ok(); + let mut custom = false; + widgets::label_row(ui, tl!("Preset:"), LABEL, |ui| { + if let Some(p) = super::flatten::preset_dropdown(ui, "eps-flattener-preset", &presets, &d.str("flattenerPreset"), current.as_ref(), 180.0) { + d.fields.insert("flattenerPreset".into(), json!(p.name)); + d.fields.remove("flattener"); + } + custom = widgets::flat_button_fit(ui, tl!("Custom…"), 72.0).clicked(); + }); + if custom { + *d = over(d, &app.session.prefs.flattener_presets); + return false; + } ui.add_space(8.0); widgets::subheader(ui, tl!("Fonts")); // Type is written as glyph outlines, which need no fonts. @@ -122,6 +151,83 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { false } +/// `ui.dialog.set` changed `field` of EPS Options `d`: a preset set there drops the Custom… +/// options, as choosing it in the dropdown does, and a built-in one named by id shows as its name. +pub(super) fn field_set(d: &mut Dialog, field: &str) { + if field == "flattenerPreset" { + d.fields.remove("flattener"); + builtin_label(&mut d.fields); + } +} + +/// A built-in preset named by id (`medium`) in `fields` shows as its name. +fn builtin_label(fields: &mut Map) { + if let Some(label) = fields.get("flattenerPreset").and_then(Value::as_str).and_then(|p| FlattenOptions::preset_label(&p.to_ascii_lowercase())) { + fields.insert("flattenerPreset".into(), json!(label)); + } +} + +/// The flattener options EPS Options `d` exports with: its preset, with the Custom… options over it. +fn flattener(d: &Dialog, saved: &[FlattenerPreset]) -> Result { + FlattenOptions::for_export(d.fields.get("flattenerPreset").and_then(Value::as_str), d.fields.get("flattener"), saved) +} + +/// Custom Transparency Flattener Options over EPS Options `parent`, on the options it exports with +/// (the default preset's while those are not valid), without alpha: EPS has none. +pub(super) fn over(parent: &Dialog, saved: &[FlattenerPreset]) -> Dialog { + let mut o = flattener(parent, saved).unwrap_or_default(); + o.preserve_alpha = false; + let mut d = Dialog::new(CUSTOM_KIND, json!({})); + super::flatten::put_options(&mut d.fields, &o); + d.fields.insert(super::PARENT.into(), serde_json::to_value(parent).unwrap_or_default()); + d +} + +/// The options Custom Transparency Flattener Options `d` holds. +fn custom_options(d: &Dialog) -> Result { + FlattenOptions::from_params_with(&Value::Object(d.fields.clone()), &[]) +} + +/// Whether the EPS Options under `d` keep overprints (Overprints: Preserve). +fn overprints_kept(d: &Dialog) -> bool { + super::parent(d).is_none_or(|p| Overprint::from_id(&p.str("overprints")) != Some(Overprint::Discard)) +} + +/// The flattener options; the two Preserve switches show what the export does and are set by the +/// format (no alpha) and by EPS Options' Overprints. +fn custom_body(_app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { + let current = custom_options(d); + let mut o = current.clone().unwrap_or_default(); + let kept = o.preserve_overprints; + o.preserve_alpha = false; + o.preserve_overprints = kept && overprints_kept(d); + if super::flatten::options_editor_fixed_preserve(ui, "eps-flattener", &mut o) { + o.preserve_overprints = kept; + super::flatten::put_options(&mut d.fields, &o); + } + if let Err(e) = ¤t { + ui.label(egui::RichText::new(e).color(Tokens::get(ui.ctx()).text_dim).size(11.5)); + } + ui.add_space(8.0); + super::form::caption(ui, tl!("EPS has no alpha transparency, and Overprints sets whether overprints are kept.")); + false +} + +/// OK: EPS Options again, exporting with these options (a built-in preset under them, so that +/// deleting a saved preset leaves them whole); bad options keep the dialog open. +fn custom_confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result { + let mut o = custom_options(d)?; + o.preserve_alpha = false; + let mut parent = super::parent(d).ok_or("the dialog it was opened over is no longer open")?; + if FlattenOptions::preset(&parent.str("flattenerPreset")).is_none() { + let medium = FlattenOptions::preset_label(FlattenOptions::PRESETS[1]).unwrap_or_default(); + parent.fields.insert("flattenerPreset".into(), json!(medium)); + } + parent.fields.insert("flattener".into(), serde_json::to_value(&o).map_err(|e| e.to_string())?); + app.ui.dialog = Some(parent); + Ok(Value::Null) +} + /// Check the options, remember them, and write the file(s). fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result { let params = fileio::eps::resolve(&super::form::params(d), &app.session.prefs.flattener_presets)?; diff --git a/crates/ui-egui/src/dialogs/flatten.rs b/crates/ui-egui/src/dialogs/flatten.rs index 0c5bc7dbee..bb392557af 100644 --- a/crates/ui-egui/src/dialogs/flatten.rs +++ b/crates/ui-egui/src/dialogs/flatten.rs @@ -180,6 +180,16 @@ const FIELD: f32 = 56.0; /// panel edit them: the raster/vector balance, both resolutions and the six switches. Returns true /// when one changed. pub(crate) fn options_editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions, enabled: bool) -> bool { + editor(ui, id, o, enabled, false) +} + +/// [`options_editor`] with Preserve Alpha Transparency and Preserve Overprints and Spot Colors +/// shown but not editable (the file format or another control sets them). +pub(crate) fn options_editor_fixed_preserve(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions) -> bool { + editor(ui, id, o, true, true) +} + +fn editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions, enabled: bool, fixed_preserve: bool) -> bool { let t = Tokens::get(ui.ctx()); let before = o.clone(); let dim = |ui: &mut egui::Ui, s: &str| { @@ -226,16 +236,16 @@ pub(crate) fn options_editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions } }); ui.add_space(4.0); - let switches: [(&str, &mut bool); 6] = [ - (tl!("Convert All Text to Outlines"), &mut o.text_to_outlines), - (tl!("Convert All Strokes to Outlines"), &mut o.strokes_to_outlines), - (tl!("Clip Complex Regions"), &mut o.clip_complex_regions), - (tl!("Anti-alias Rasters"), &mut o.anti_alias), - (tl!("Preserve Alpha Transparency"), &mut o.preserve_alpha), - (tl!("Preserve Overprints and Spot Colors"), &mut o.preserve_overprints), + let switches: [(&str, &mut bool, bool); 6] = [ + (tl!("Convert All Text to Outlines"), &mut o.text_to_outlines, false), + (tl!("Convert All Strokes to Outlines"), &mut o.strokes_to_outlines, false), + (tl!("Clip Complex Regions"), &mut o.clip_complex_regions, false), + (tl!("Anti-alias Rasters"), &mut o.anti_alias, false), + (tl!("Preserve Alpha Transparency"), &mut o.preserve_alpha, fixed_preserve), + (tl!("Preserve Overprints and Spot Colors"), &mut o.preserve_overprints, fixed_preserve), ]; - for (label, v) in switches { - if widgets::check(ui, label, *v, enabled) { + for (label, v, fixed) in switches { + if widgets::check(ui, label, *v, enabled && !fixed) { *v = !*v; } } diff --git a/crates/ui-egui/src/dialogs/tests_eps.rs b/crates/ui-egui/src/dialogs/tests_eps.rs index bebe8a1407..f97207e215 100644 --- a/crates/ui-egui/src/dialogs/tests_eps.rs +++ b/crates/ui-egui/src/dialogs/tests_eps.rs @@ -67,6 +67,108 @@ fn eps_options_take_saved_flattener_presets_and_refuse_bad_ones() { assert!(written.borrow()[0].1.starts_with(b"%!PS-Adobe-3.0 EPSF-3.0"), "{:?}", &written.borrow()[0].1[..8]); } +/// Two overlapping squares, the second half transparent, so that an EPS export flattens them. +fn transparent_art(app: &mut VectorcraftApp) { + for (x, color) in [(5, "#ff0000"), (20, "#0000ff")] { + app.run("select.none", json!({})).unwrap(); + app.run("paint.setFill", json!({"color": color})).unwrap(); + app.run("shape.rectangle", json!({"x": x, "y": 5, "width": 30, "height": 30})).unwrap(); + } + app.run("transparency.set", json!({"opacity": 50})).unwrap(); +} + +/// Custom… over EPS Options, as its button opens it. +fn open_custom(app: &mut VectorcraftApp) { + let parent = app.ui.dialog.clone().expect("EPS Options are open"); + app.ui.dialog = Some(eps_options::over(&parent, &app.session.prefs.flattener_presets)); + frame(app); +} + +#[test] +fn custom_flattener_options_start_from_the_preset_and_cancel_goes_back_unchanged() { + let (mut app, _) = app(1); + app.run("ui.epsOptionsDialog", json!({"path": "/out/a.eps", "flattenerPreset": "high"})).unwrap(); + frame(&mut app); + let before = app.ui.dialog.as_ref().unwrap().fields.clone(); + open_custom(&mut app); + assert_eq!(kind(&app), Some(eps_options::CUSTOM_KIND)); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.f64("balance", 0.0), d.f64("lineArtPpi", 0.0), d.bool("clipComplexRegions")), (100.0, 1200.0, true), "High Resolution's"); + assert!(!d.bool("preserveAlpha"), "EPS has no alpha"); + set(&mut app, "balance", json!(10)); + cancel(&mut app); + assert_eq!(kind(&app), Some("epsOptions")); + assert_eq!(app.ui.dialog.as_ref().unwrap().fields, before, "Cancel leaves EPS Options as they were"); +} + +#[test] +fn custom_flattener_options_are_exported_and_remembered_until_a_preset_is_chosen() { + let (mut app, written) = app(1); + transparent_art(&mut app); + app.run("flattener.presets.save", json!({"name": "Mine", "balance": 100})).unwrap(); + let opts = json!({"path": "/out/a.eps", "flattenerPreset": "Mine", "previewFormat": "none", "thumbnails": false}); + app.run("ui.epsOptionsDialog", opts).unwrap(); + frame(&mut app); + open_custom(&mut app); + assert_eq!(app.ui.dialog.as_ref().unwrap().f64("balance", 0.0), 100.0, "the saved preset's"); + set(&mut app, "balance", json!(0)); + confirm(&mut app).unwrap(); + assert_eq!(kind(&app), Some("epsOptions"), "OK goes back to EPS Options"); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.fields["flattener"]["balance"].as_f64(), d.fields["flattener"]["preserveAlpha"].as_bool()), (Some(0.0), Some(false))); + assert_eq!(d.str("flattenerPreset"), "Medium Resolution", "a built-in preset under options that set everything"); + frame(&mut app); + // The custom options don't need the saved preset they started from. + app.run("flattener.presets.delete", json!({"name": "Mine"})).unwrap(); + confirm(&mut app).unwrap(); + assert!(ps(&written.borrow()[0].1).contains("image"), "balance 0 rasterizes the flattened art"); + // The next EPS Options start from them; a preset asked for without options drops them. + crate::menus::invoke(&mut app, "ui.epsOptionsDialog", json!({})); + assert_eq!(app.ui.dialog.as_ref().unwrap().fields["flattener"]["balance"].as_f64(), Some(0.0)); + cancel(&mut app); + app.run("ui.epsOptionsDialog", json!({"path": "/out/b.eps", "flattenerPreset": "medium"})).unwrap(); + assert!(!app.ui.dialog.as_ref().unwrap().fields.contains_key("flattener")); + confirm(&mut app).unwrap(); + assert!(!ps(&written.borrow()[1].1).contains("image"), "Medium Resolution keeps the squares vector"); +} + +#[test] +fn a_flattener_preset_set_from_outside_drops_the_custom_options() { + let (mut app, _) = app(1); + app.run("ui.epsOptionsDialog", json!({"path": "/out/a.eps"})).unwrap(); + frame(&mut app); + open_custom(&mut app); + set(&mut app, "balance", json!(20)); + confirm(&mut app).unwrap(); + assert!(app.ui.dialog.as_ref().unwrap().fields.contains_key("flattener")); + // `ui.dialog.set {flattenerPreset: "low"}`, as the control channel sets it. + let old = app.ui.dialog.as_ref().unwrap().fields.get("flattenerPreset").cloned(); + set(&mut app, "flattenerPreset", json!("low")); + field_set(&mut app, "flattenerPreset", old.as_ref()).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert!(!d.fields.contains_key("flattener"), "the preset replaces the custom options"); + assert_eq!(d.str("flattenerPreset"), "Low Resolution"); +} + +#[test] +fn bad_custom_flattener_options_keep_the_dialog_open() { + let (mut app, _) = app(1); + app.run("ui.epsOptionsDialog", json!({"path": "/out/a.eps", "overprints": "discard"})).unwrap(); + frame(&mut app); + open_custom(&mut app); + set(&mut app, "gradientPpi", json!(9000)); + frame(&mut app); + let e = confirm(&mut app).unwrap_err(); + assert!(e.contains("resolutions"), "{e}"); + assert_eq!(kind(&app), Some(eps_options::CUSTOM_KIND)); + // Overprints decides whether overprints are kept, so OK keeps the option as it was. + set(&mut app, "gradientPpi", json!(150)); + set(&mut app, "preserveAlpha", json!(true)); + confirm(&mut app).unwrap(); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!((d.fields["flattener"]["preserveOverprints"].as_bool(), d.fields["flattener"]["preserveAlpha"].as_bool()), (Some(true), Some(false))); +} + #[test] fn the_eps_options_dialog_needs_a_document() { let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 613d5cd1e3..8f6b8c29cd 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -2467,6 +2467,9 @@ font-technology Variable Променливи Overprint Напечатване върху друго Overprint and Transparency Flattener Сплескване на надпечатването и прозрачността Overprint and Transparency Flattener Options Опции за сплескване на надпечатването и прозрачността + Custom… Потребителски… + Custom Transparency Flattener Options Потребителски опции за сплескване на прозрачността + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS няма алфа прозрачност, а „Надпечати“ определя дали надпечатванията се запазват. Overprint Black… Напечатване на черното върху друго… Overprint Fill Напечатване на запълването върху друго Overprint Preview Преглед на напечатването върху друго diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index fcc034cd0f..cb0b20955b 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -2858,6 +2858,9 @@ digits Malayalam Malajalam Open a document to preview its pages Otvorite dokument da pregledate njegove stranice Output › Mode Izlaz › Način Overprint and Transparency Flattener Options Opcije pretiska i spljoštavanja prozirnosti + Custom… Prilagođeno… + Custom Transparency Flattener Options Prilagođene opcije spljoštavanja prozirnosti + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS nema alfa prozirnost, a Pretisci određuju da li se pretisci zadržavaju. Place the pages with the placement again Ponovo postavi stranice s postavljanjem Placement: Postavljanje: Preserve CMYK Numbers Očuvaj CMYK brojeve diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index ac55a78ff4..ce25f2f1ab 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3136,6 +3136,9 @@ digits Malayalam Malaiàlam Overprint Sobrimpressió Overprint and Transparency Flattener Aplanador de sobremipressió i transparència Overprint and Transparency Flattener Options Opcions de l’aplanador de sobremipressió i transparència + Custom… Personalitzat… + Custom Transparency Flattener Options Opcions personalitzades de l’aplanador de transparència + EPS has no alpha transparency, and Overprints sets whether overprints are kept. L’EPS no té transparència alfa, i Sobreimpressions determina si es conserven les sobreimpressions. Overprint Black… Sobrimpressió del negre… Overprint Fill Sobrimpressió del farciment Overprint Preview Previsualització de la sobremipressió diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 69dd46dc23..4a54d08ee6 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -2942,6 +2942,9 @@ digits Malayalam Malajálamské Open a document to preview its pages Otevřete dokument, abyste viděli náhled jeho stránek Output › Mode Výstup › Režim Overprint and Transparency Flattener Options Možnosti přetisku a sloučení průhlednosti + Custom… Vlastní nastavení… + Custom Transparency Flattener Options Vlastní možnosti sloučení průhlednosti + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS nemá průhlednost alfa a Přetisky určují, zda se přetisky zachovají. Place the pages with the placement again Znovu rozmístit stránky podle umístění Placement: Umístění: Preserve CMYK Numbers Zachovat hodnoty CMYK diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 7bc0ed6c94..02d9e66a5e 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -5390,6 +5390,9 @@ digits Malayalam Malayalam Open a document to preview its pages Åbn et dokument for at forhåndsvise dets sider Output › Mode Output › Tilstand Overprint and Transparency Flattener Options Indstillinger for overtryk og udfladning af gennemsigtighed + Custom… Brugerdefineret… + Custom Transparency Flattener Options Brugerdefinerede indstillinger for udfladning af gennemsigtighed + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS har ingen alfa-gennemsigtighed, og Overtryk bestemmer, om overtryk bevares. Place the pages with the placement again Placér siderne igen med placeringen Placement: Placering: Preserve CMYK Numbers Bevar CMYK-tal diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 4b17261bfb..9ba155f2c0 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2509,6 +2509,9 @@ file-filter Templates Vorlagen Overprint Überdrucken Overprint and Transparency Flattener Überdrucken und Transparenzreduzierung Overprint and Transparency Flattener Options Optionen für Überdrucken und Transparenzreduzierung + Custom… Benutzerdefiniert… + Custom Transparency Flattener Options Benutzerdefinierte Optionen für Transparenzreduzierung + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS hat keine Alphatransparenz, und „Überdrucken“ legt fest, ob Überdrucken erhalten bleibt. Overprint Black… Schwarz überdrucken… Overprint Fill Fläche überdrucken Overprint Preview Überdruckenvorschau diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index bba8d392ad..e6daf4f6ea 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -3445,6 +3445,9 @@ theme Appearance Εμφάνιση Overprint Υπερεκτύπωση Overprint and Transparency Flattener Υπερεκτύπωση και ισοπέδωση διαφάνειας Overprint and Transparency Flattener Options Επιλογές υπερεκτύπωσης και ισοπέδωσης διαφάνειας + Custom… Προσαρμοσμένο… + Custom Transparency Flattener Options Προσαρμοσμένες επιλογές ισοπέδωσης διαφάνειας + EPS has no alpha transparency, and Overprints sets whether overprints are kept. Το EPS δεν έχει διαφάνεια άλφα και οι Υπερεκτυπώσεις ορίζουν αν διατηρούνται οι υπερεκτυπώσεις. Overprint Black… Υπερεκτύπωση μαύρου… Overprint Fill Υπερεκτύπωση γεμίσματος Overprint Preview Προεπισκόπηση υπερεκτύπωσης diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 57e7f44e87..d7d9eea30b 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2554,6 +2554,9 @@ font-technology Variable Variables Overprint Sobreimprimir Overprint and Transparency Flattener Sobreimpresión y acoplador de transparencia Overprint and Transparency Flattener Options Opciones de sobreimpresión y acoplador de transparencia + Custom… Personalizado… + Custom Transparency Flattener Options Opciones personalizadas de acoplador de transparencia + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS no tiene transparencia alfa, y Sobreimpresiones determina si se conservan las sobreimpresiones. Overprint Black… Sobreimprimir negro… Overprint Fill Sobreimprimir relleno Overprint Preview Vista previa de sobreimpresión diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 0276e5b6ed..f3d1716173 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -2886,6 +2886,9 @@ digits Malayalam Malajalam Open a document to preview its pages Avaa asiakirja, niin voit esikatsella sen sivuja Output › Mode Tuloste › Tila Overprint and Transparency Flattener Options Päällepainatuksen ja läpinäkyvyyden litistyksen asetukset + Custom… Mukautettu… + Custom Transparency Flattener Options Läpinäkyvyyden litistyksen mukautetut asetukset + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS:ssä ei ole alfa-läpinäkyvyyttä, ja Päällepainatukset määrää, säilytetäänkö päällepainatukset. Place the pages with the placement again Sijoita sivut uudelleen sijoittelun mukaan Placement: Sijoittelu: Preserve CMYK Numbers Säilytä CMYK-arvot diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 75f4f14c6f..1001c05651 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2542,6 +2542,9 @@ font-technology Variable Variables Overprint Surimpression Overprint and Transparency Flattener Surimpression et aplatissement des transparences Overprint and Transparency Flattener Options Options de surimpression et d’aplatissement des transparences + Custom… Personnalisé… + Custom Transparency Flattener Options Options personnalisées d’aplatissement des transparences + EPS has no alpha transparency, and Overprints sets whether overprints are kept. Le format EPS n’a pas de transparence alpha, et Surimpressions détermine si les surimpressions sont conservées. Overprint Black… Surimpression du noir… Overprint Fill Surimpression du fond Overprint Preview Aperçu de la surimpression diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 4eed343e3d..2aeecb0f00 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -2587,6 +2587,9 @@ Overprint Stroke ઓવરપ્રિન્ટ સ્ટ્રોક Overprint and Transparency Flattener ઓવરપ્રિન્ટ અને પારદર્શિતા ફ્લેટનર Overprint and Transparency Flattener Options ઓવરપ્રિન્ટ અને પારદર્શિતા ફ્લેટનર વિકલ્પો + Custom… કસ્ટમ… + Custom Transparency Flattener Options કસ્ટમ પારદર્શિતા ફ્લેટનર વિકલ્પો + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS માં આલ્ફા પારદર્શિતા નથી, અને ઓવરપ્રિન્ટ્સ નક્કી કરે છે કે ઓવરપ્રિન્ટ્સ જાળવવામાં આવે કે નહીં. Overprint: ઓવરપ્રિન્ટ: Overprints: ઓવરપ્રિન્ટ્સ: Override Character Color અક્ષરનો રંગ ઓવરરાઇડ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 094d49ce52..38f40fce55 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -3414,6 +3414,9 @@ antiAlias Sharp शार्प Overprint ओवरप्रिंट Overprint and Transparency Flattener ओवरप्रिंट और ट्रांसपेरेंसी फ़्लैटनर Overprint and Transparency Flattener Options ओवरप्रिंट और ट्रांसपेरेंसी फ़्लैटनर ऑप्शन्स + Custom… कस्टम… + Custom Transparency Flattener Options कस्टम ट्रांसपेरेंसी फ़्लैटनर ऑप्शन्स + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS में अल्फा पारदर्शिता नहीं होती, और ओवरप्रिंट तय करता है कि ओवरप्रिंट रखे जाएँ या नहीं। Overprint Black ओवरप्रिंट ब्लैक Overprint Black… ओवरप्रिंट ब्लैक… Overprint Fill फ़िल ओवरप्रिंट करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index d5f42ce788..af7cc37280 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3042,6 +3042,9 @@ file-filter Templates Sablonok Overprint Felülnyomás Overprint and Transparency Flattener Felülnyomás és átlátszóság-lapítás Overprint and Transparency Flattener Options Felülnyomás és átlátszóság-lapítás beállításai + Custom… Egyéni… + Custom Transparency Flattener Options Egyéni átlátszóság-lapítási beállítások + EPS has no alpha transparency, and Overprints sets whether overprints are kept. Az EPS-ben nincs alfa-átlátszóság, és a Felülnyomások beállítás dönti el, hogy megmaradnak-e a felülnyomások. Overprint Black… Fekete felülnyomása… Overprint Fill Kitöltés felülnyomása Overprint Preview Felülnyomás-előnézet diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index b349f589a5..161f879e2a 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -2667,6 +2667,9 @@ digits Malayalam Malayalam Open a document to preview its pages Buka dokumen untuk melihat pratinjau halamannya Output › Mode Keluaran › Mode Overprint and Transparency Flattener Options Opsi overprint dan perataan transparansi + Custom… Kustom… + Custom Transparency Flattener Options Opsi perataan transparansi kustom + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS tidak memiliki transparansi alfa, dan Overprint menentukan apakah overprint dipertahankan. Place the pages with the placement again Tempatkan halaman lagi dengan penempatan tersebut Placement: Penempatan: Preserve CMYK Numbers Pertahankan angka CMYK diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8bc9d44147..1947602b6f 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2590,6 +2590,9 @@ file-filter Templates Modelli Overprint Sovrastampa Overprint and Transparency Flattener Sovrastampa e appiattimento trasparenza Overprint and Transparency Flattener Options Opzioni sovrastampa e appiattimento trasparenza + Custom… Personalizzato… + Custom Transparency Flattener Options Opzioni di appiattimento trasparenza personalizzate + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS non ha trasparenza alfa, e Sovrastampe stabilisce se le sovrastampe vengono mantenute. Overprint Black… Sovrastampa nero… Overprint Fill Sovrastampa riempimento Overprint Preview Anteprima sovrastampa diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 57c9aee61e..25b4846c2d 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -2710,6 +2710,9 @@ antiAlias Sharp シャープ Overprint Stroke 線をオーバープリント Overprint and Transparency Flattener オーバープリントと透明の分割・統合 Overprint and Transparency Flattener Options オーバープリントと透明の分割・統合オプション + Custom… カスタム… + Custom Transparency Flattener Options カスタムの透明の分割・統合オプション + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS にはアルファ透明がなく、オーバープリントを保持するかどうかは「オーバープリント」で決まります。 Overprint: オーバープリント: Overprints: オーバープリント: Override Character Color 文字カラーを上書き diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index a661bc0cbb..6140346b14 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -4723,6 +4723,9 @@ digits Malayalam მალაიალამური Open a document to preview its pages გახსენით დოკუმენტი მისი გვერდების წინასწარ სანახავად Output › Mode გამოტანა › რეჟიმი Overprint and Transparency Flattener Options ზედდაბეჭდვისა და გამჭვირვალობის გაბრტყელების პარამეტრები + Custom… მორგებული… + Custom Transparency Flattener Options გამჭვირვალობის გაბრტყელების მორგებული პარამეტრები + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS-ს არ აქვს ალფა-გამჭვირვალობა, ხოლო ზედდაბეჭდვები განსაზღვრავს, შენარჩუნდება თუ არა ზედდაბეჭდვები. Place the pages with the placement again გვერდების ხელახლა განთავსება განთავსების მიხედვით Placement: განთავსება: Preserve CMYK Numbers CMYK მნიშვნელობების შენარჩუნება diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 632c2473f8..7f1738cae9 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -2700,6 +2700,9 @@ antiAlias Sharp 날카롭게 Overprint Stroke 선 오버프린트 Overprint and Transparency Flattener 오버프린트 및 투명도 병합 Overprint and Transparency Flattener Options 오버프린트 및 투명도 병합 옵션 + Custom… 사용자 지정… + Custom Transparency Flattener Options 사용자 지정 투명도 병합 옵션 + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS에는 알파 투명도가 없으며, 오버프린트 설정에 따라 오버프린트 유지 여부가 결정됩니다. Overprint: 오버프린트: Overprints: 오버프린트: Override Character Color 문자 색상 덮어쓰기 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 0137b7ac5b..cea935eeef 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -3284,6 +3284,9 @@ digits Malayalam Malayalam Open a document to preview its pages Open een document om een voorbeeld van de pagina's te bekijken Output › Mode Uitvoer › Modus Overprint and Transparency Flattener Options Opties voor overprint en transparantiepletter + Custom… Aangepast… + Custom Transparency Flattener Options Aangepaste opties voor transparantieafvlakking + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS heeft geen alfatransparantie, en Overdrukken bepaalt of overdrukken behouden blijven. Place the pages with the placement again Plaats de pagina's opnieuw met de plaatsing Placement: Plaatsing: Preserve CMYK Numbers CMYK-waarden behouden diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index a2909473c2..362c7083a8 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -2855,6 +2855,9 @@ digits Malayalam Malajalam Open a document to preview its pages Otwórz dokument, aby podejrzeć jego strony Output › Mode Wyjście › Tryb Overprint and Transparency Flattener Options Opcje nadruku i spłaszczania przezroczystości + Custom… Niestandardowe… + Custom Transparency Flattener Options Niestandardowe opcje spłaszczania przezroczystości + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS nie ma przezroczystości alfa, a Nadruki określają, czy nadruki są zachowywane. Place the pages with the placement again Ponownie rozmieść strony według położenia Placement: Położenie: Preserve CMYK Numbers Zachowaj wartości CMYK diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 9c7e0fddd5..96f419b023 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2100,6 +2100,9 @@ antiAlias Sharp Nítido Overprint Stroke Sobreimpressão de Traçado Overprint and Transparency Flattener Sobreimpressão e Achatamento de Transparência Overprint and Transparency Flattener Options Opções de Sobreimpressão e Achatamento de Transparência + Custom… Personalizado… + Custom Transparency Flattener Options Opções Personalizadas de Achatamento de Transparência + EPS has no alpha transparency, and Overprints sets whether overprints are kept. O EPS não tem transparência alfa, e Sobreimpressões define se as sobreimpressões são mantidas. Overprint: Sobreimpressão: Overprints: Sobreimpressões: Override Character Color Substituir Cor do Caractere diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 87424a1938..ccc29149ed 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2579,6 +2579,9 @@ file-filter Templates Шаблоны Overprint Наложение Overprint and Transparency Flattener Наложение и объединение прозрачностей Overprint and Transparency Flattener Options Параметры наложения и объединения прозрачностей + Custom… Пользовательские… + Custom Transparency Flattener Options Пользовательские параметры объединения прозрачностей + EPS has no alpha transparency, and Overprints sets whether overprints are kept. В EPS нет альфа-прозрачности, а параметр «Наложения» определяет, сохраняются ли наложения. Overprint Black… Наложение чёрного… Overprint Fill Наложение заливки Overprint Preview Просмотр наложения diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 62ac5b67a8..4d673c01bd 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -2487,6 +2487,9 @@ font-technology Variable Variabla Overprint Övertryck Overprint and Transparency Flattener Övertryck och transparensutplattning Overprint and Transparency Flattener Options Alternativ för övertryck och transparensutplattning + Custom… Anpassad… + Custom Transparency Flattener Options Anpassade alternativ för transparensutplattning + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS har ingen alfatransparens, och Övertryck avgör om övertryck behålls. Overprint Black… Övertryck svart… Overprint Fill Övertryck fyllning Overprint Preview Förhandsgranskning av övertryck diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 9076b8da7c..8b8f2c0872 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2326,6 +2326,9 @@ shape Open Açık Overprint Üst Baskı Overprint and Transparency Flattener Üst Baskı ve Asetat Düzleştirici Overprint and Transparency Flattener Options Üst Baskı ve Asetat Düzleştirici Seçenekleri + Custom… Özel… + Custom Transparency Flattener Options Özel Şeffaflık Düzleştirici Seçenekleri + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS'de alfa şeffaflığı yoktur ve Üst baskılar, üst baskıların korunup korunmayacağını belirler. Overprint Black… Üst Baskı Siyah… Overprint Fill Üst Baskı Dolgusu Overprint Preview Üst Baskı Önizleme diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index c701f1bd5d..02d40e923a 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -2582,6 +2582,9 @@ file-filter Templates Шаблони Overprint Накладення Overprint and Transparency Flattener Накладання та зведення прозорості Overprint and Transparency Flattener Options Параметри накладання та зведення прозорості + Custom… Користувацькі… + Custom Transparency Flattener Options Користувацькі параметри зведення прозорості + EPS has no alpha transparency, and Overprints sets whether overprints are kept. У EPS немає альфа-прозорості, а параметр «Накладення» визначає, чи зберігаються накладення. Overprint Black… Накладення чорного… Overprint Fill Накладання заливки Overprint Preview Перегляд накладання diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 7ce09032d1..4271afb609 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -2860,6 +2860,9 @@ digits Hindi Hindi Overprint In chồng Overprint and Transparency Flattener In chồng và làm phẳng trong suốt Overprint and Transparency Flattener Options Tùy chọn in chồng và làm phẳng trong suốt + Custom… Tùy chỉnh… + Custom Transparency Flattener Options Tùy chọn làm phẳng trong suốt tùy chỉnh + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS không có trong suốt kênh Alpha, và In chồng quyết định có giữ in chồng hay không. Overprint Black… In chồng đen… Overprint Fill Tô in chồng Overprint Preview Xem trước in chồng diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index 86f04f416e..1ee9db73d0 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2442,6 +2442,9 @@ file-filter Templates 模板 Overprint 叠印 Overprint and Transparency Flattener 叠印和透明度拼合器 Overprint and Transparency Flattener Options 叠印和透明度拼合器选项 + Custom… 自定义… + Custom Transparency Flattener Options 自定义透明度拼合器选项 + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS 没有 Alpha 透明度,“叠印”决定是否保留叠印。 Overprint Black… 黑色叠印… Overprint Fill 叠印填色 Overprint Preview 叠印预览 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 65e5274812..fb8c665f7a 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -3713,6 +3713,9 @@ liquify-list-end {0}, {1} {0}和{1} Overprint 疊印 Overprint and Transparency Flattener 疊印與透明度平面化 Overprint and Transparency Flattener Options 疊印與透明度平面化選項 + Custom… 自訂… + Custom Transparency Flattener Options 自訂透明度平面化選項 + EPS has no alpha transparency, and Overprints sets whether overprints are kept. EPS 沒有 Alpha 透明度,「疊印」決定是否保留疊印。 Overprint Black… 疊印黑色… Overprint Fill 疊印填色 Overprint Preview 疊印預視 diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index ced961e32c..efe874e007 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -1659,7 +1659,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "ui.epsOptionsDialog", "EPS Options Dialog", "", - "{path?, useArtboards?, range?, …document.exportEps options} open EPS Options (dialog `epsOptions`: fields = these options over the ones used last); OK checks them, remembers them and writes path (else asks). Export As… → EPS opens it too", + "{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", ), ( "file.saveForWeb", diff --git a/docs/control-protocol.md b/docs/control-protocol.md index df83c6eb04..d72d306e84 100644 --- a/docs/control-protocol.md +++ b/docs/control-protocol.md @@ -812,13 +812,21 @@ selected slices. Hidden or locked slices (`view.slices.hide`, `view.slices.lock` EPS Options: Export As… with the EPS format (`file.exportAs {format: "eps"}`, then the save dialog), or `ui.epsOptionsDialog {path?, …document.exportEps options}` for agents, opens the `epsOptions` dialog. Its fields are `document.export` params: `previewFormat` (`none`, `tiffBw`, `tiffColor`), `transparentPreview`, `overprints` -(`preserve`, `discard`), `flattenerPreset` (a built-in or saved preset's name), `includeLinkedFiles`, `thumbnails`, +(`preserve`, `discard`), `flattenerPreset` (a built-in or saved preset's name), `flattener` (custom flattener options +over the preset, as `object.flattenTransparency` takes them), `includeLinkedFiles`, `thumbnails`, `cmykPostScript`, `compatibleGradients`, `level` (`2`, `3`), plus `path` and the artboard choice (`useArtboards`, `range`). `ui.dialog.confirm` checks them (a bad value or an unknown preset keeps the dialog open), remembers them for the next EPS Options and writes the file(s), asking for a path when there is none. With Use Artboards and two or more artboards, it writes a central file of the whole document under the chosen name and one `{stem}_{artboard}.eps` per artboard. When no art shows, it writes only the artboard files. +The Custom… button beside the preset opens the `epsFlattenerOptions` dialog over EPS Options, on the options the +export would use. Its fields are the flattener options; `preserveAlpha` is always off, and overprints are kept only +with `overprints: "preserve"`. Its `ui.dialog.confirm` sets every option as `flattener` (the preset then shows +[Custom]) and goes back to EPS Options; `ui.dialog.cancel` goes back with the options unchanged. Choosing a preset, +in the dropdown or with `ui.dialog.set {flattenerPreset}`, drops `flattener`, and so does `ui.epsOptionsDialog` with +a `flattenerPreset` and no `flattener`. + Data Recovery: at launch, copies left behind by a crash open the `recovery` dialog (never copies another running instance keeps, so instances started side by side for screenshots don't get it). Fields: `copies` (`[{file, title, saved}]`, from `file.recovery.list`) and `discard`. `ui.dialog.confirm` restores them all (`file.recovery.restore` diff --git a/docs/mcp.md b/docs/mcp.md index c7aa202d3f..d432c154ec 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8492,8 +8492,9 @@ Colorized grayscale and 1-bit images use their process or spot ink; the flattene PostScript has no transparency: it is flattened first with `flattenerPreset` (`high`, `medium` (default), `low` or a saved preset, see `flattener.presets.list`) and `flattener: {…}` options over it (those of -`object.flattenTransparency`); a warning says so. `previewFormat` adds a TIFF preview behind a binary header (`tiffColor` -(default), transparent unless `transparentPreview: false`, or 1-bit `tiffBw`; `none` writes plain PostScript), +`object.flattenTransparency`); a warning says so. EPS Options' Custom… button sets every `flattener` option. +`previewFormat` adds a TIFF preview behind a binary header (`tiffColor` (default), transparent unless +`transparentPreview: false`, or 1-bit `tiffBw`; `none` writes plain PostScript), `thumbnails` a PNG thumbnail in comments, and the native document always rides along in the trailer's comments (with linked images whole when `includeLinkedFiles`), so a later EPS import can reopen the file as it was. Export for Screens doesn't write EPS. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index af7974b880..fe2c0fe7b2 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -706,6 +706,7 @@ since 2026-10-01. - **Effects in the art's bounds:** Export with Use Artboards off, Fit to Artwork Bounds, and the other exports of the whole art (EPS without artboards, Export for Screens' Full Document, Save for Web (Legacy) with Clip to Artboard off) measure each visible object as the export crops above do. The drop shadows and other effects of groups, layers, type and images are inside the image or the artboard. A Shaper group without effects of its own is measured by the art it shows, and the hidden members of a group with a drop shadow, a glow or another raster effect do not count unless it is a Shaper group or also has a geometry, Pathfinder, Crop Marks or 3D effect or a visible effect on its own fill or stroke. The SVG of an artboard keeps an object whose effects alone reach the artboard. Tests measure a group, type and an image with a drop shadow, export a group and type with Use Artboards off and fit an artboard to them. - **EPS Save with Use Artboards:** Save As › EPS Options show Use Artboards with All or Range, for a separate file per artboard ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)), unchecked by default (the scripting reference's EPS save options list `saveMultipleArtboards` with a default of false, [scripting reference](https://web.archive.org/web/20160803105056/https://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2015_3/Illustrator%20JavaScript%20Scripting%20Reference.pdf)). Unchecked, Save writes one file whose bounding box fits all the visible art, as Export does, without the artboards' background colors; when no art shows, the page is the first artboard in its color. An opened EPS saved back this way loses its page margins. Checked with two or more chosen artboards, the file at the path is the central file of the visible art and each artboard is also written to `_.eps` beside it. Checked with one chosen artboard, VectorCraft writes that artboard as the page of the file at the path alone (the behavior Save had since #4293). Evidence: `cmd::fileio::tests_artboard_fill::eps_save_draws_the_color_on_an_artboard_page`, `tests::save::eps_save_without_use_artboards_fits_the_box_to_art_past_the_artboard`, `tests::save::opened_eps_saves_to_its_own_file_around_its_art_or_on_its_page`, `tests::save::eps_save_with_use_artboards_writes_the_central_file_and_one_per_artboard`, `dialogs::save_options::tests::eps_save_as_shows_use_artboards_off_and_writes_the_art_or_the_artboard`. +- **EPS Options custom flattener settings:** the help page describes flattening an EPS's transparency with a preset or with custom options, adjusted through Custom ([saving in EPS](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/save-artwork-in-eps-format.html)). EPS Options now has Custom… beside the flattener Preset. It opens Custom Transparency Flattener Options on the settings the export would use: the raster/vector balance, both resolutions, the text and stroke outline switches, Clip Complex Regions and Anti-alias Rasters. OK goes back to EPS Options with the preset shown as [Custom], the export flattens with those settings, and the next EPS Options start from them; choosing a preset drops them, and Cancel goes back to EPS Options unchanged. Preserve Alpha Transparency stays off, and overprints are kept only with Overprints set to Preserve. The [Custom] label, the remembering, the Cancel behavior, Anti-alias Rasters and the ranges (balance 0 to 100, resolutions 1 to 2400 ppi) are VectorCraft's own. Evidence: `dialogs::tests_eps::custom_flattener_options_start_from_the_preset_and_cancel_goes_back_unchanged`, `custom_flattener_options_are_exported_and_remembered_until_a_preset_is_chosen`, `bad_custom_flattener_options_keep_the_dialog_open`. - **Raster export backgrounds (#6125):** a raster export draws its background under the finished art, and blend modes read only the art below them, as on the canvas. An Outer Glow in Screen mode on the bare page shows in a PNG on white and in a JPEG. Flatten Transparency puts its white under the finished art the same way. Evidence: `tests::file::a_screen_outer_glow_is_in_raster_exports`, `tests::objectfx::a_screen_outer_glow_on_the_bare_page_shows_on_a_background`, `tests::knockout::page_knockout_and_isolated_blending`, `tests::knockout::no_blend_mode_reads_the_background`, `tests::cmykflatten::every_blend_mode_flattens_to_the_canvas_pixels_in_cmyk`. From cfd0a8b1e462df3624d5ecfecb7b4c2b8478f9c4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 08:16:36 -0800 Subject: [PATCH 2/3] =?UTF-8?q?EPS=20Options:=20Enter=20on=20Custom?= =?UTF-8?q?=E2=80=A6=20opens=20the=20options=20without=20confirming=20them?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - A dialog's Enter no longer confirms a dialog that its body opened in the same frame, so Enter on the focused Custom… button opens Custom Transparency Flattener Options instead of confirming them at once. - With an option out of range or of the wrong type, changing another option in Custom Transparency Flattener Options or Flatten Transparency writes only that option, so the values entered stay and OK still refuses them. --- crates/ui-egui/src/dialogs.rs | 5 +- crates/ui-egui/src/dialogs/eps_options.rs | 7 +- crates/ui-egui/src/dialogs/flatten.rs | 55 +++++++++++++- crates/ui-egui/src/dialogs/tests_eps.rs | 87 +++++++++++++++++++++++ 4 files changed, 149 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 685642f323..dfbaf65a10 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -828,6 +828,9 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if after_panel && !ctx.input(|i| i.key_down(egui::Key::Enter) || i.key_pressed(egui::Key::Enter)) { d.fields.remove(AFTER_PANEL); } + // A body can open another dialog in its place (EPS Options' Custom…): this frame's Enter + // doesn't confirm that one. + let opened = d.kind.clone(); let heading = (spec.heading)(&d); let revolves = revolve_gizmo::active(&d); if revolves { @@ -927,7 +930,7 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) { if ok_clicked && !rejected && !refused_during_click { ok = true; } - if spec.ok.is_some() && ok_enabled && !after_panel && !rejected && crate::shortcuts::pressed_anew(ctx, egui::Key::Enter) { + if spec.ok.is_some() && ok_enabled && !after_panel && !rejected && d.kind == opened && crate::shortcuts::pressed_anew(ctx, egui::Key::Enter) { ok = true; } if discard { diff --git a/crates/ui-egui/src/dialogs/eps_options.rs b/crates/ui-egui/src/dialogs/eps_options.rs index afe0553f87..0d14b3cac4 100644 --- a/crates/ui-egui/src/dialogs/eps_options.rs +++ b/crates/ui-egui/src/dialogs/eps_options.rs @@ -197,13 +197,16 @@ fn overprints_kept(d: &Dialog) -> bool { /// format (no alpha) and by EPS Options' Overprints. fn custom_body(_app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { let current = custom_options(d); - let mut o = current.clone().unwrap_or_default(); + // Values refused stay as entered, so that changing another option keeps them. + let mut o = current.clone().unwrap_or_else(|_| super::flatten::entered_options(&d.fields, &FlattenOptions::default())); let kept = o.preserve_overprints; o.preserve_alpha = false; o.preserve_overprints = kept && overprints_kept(d); + let mut shown = o.clone(); + shown.preserve_overprints = kept; if super::flatten::options_editor_fixed_preserve(ui, "eps-flattener", &mut o) { o.preserve_overprints = kept; - super::flatten::put_options(&mut d.fields, &o); + super::flatten::put_changed_options(&mut d.fields, &shown, &o); } if let Err(e) = ¤t { ui.label(egui::RichText::new(e).color(Tokens::get(ui.ctx()).text_dim).size(11.5)); diff --git a/crates/ui-egui/src/dialogs/flatten.rs b/crates/ui-egui/src/dialogs/flatten.rs index bb392557af..e9731efe4b 100644 --- a/crates/ui-egui/src/dialogs/flatten.rs +++ b/crates/ui-egui/src/dialogs/flatten.rs @@ -48,6 +48,32 @@ pub(crate) fn put_options(fields: &mut Map, o: &FlattenOptions) { } } +/// Write into the option fields only the options that differ between `shown` and `edited`, so +/// that a value the editor could not show stays in the fields as it was entered. +pub(crate) fn put_changed_options(fields: &mut Map, shown: &FlattenOptions, edited: &FlattenOptions) { + let (Ok(Value::Object(old)), Ok(Value::Object(new))) = (serde_json::to_value(shown), serde_json::to_value(edited)) else { return }; + for (k, v) in new { + if old.get(&k) != Some(&v) { + fields.insert(k, v); + } + } +} + +/// The options `fields` hold over `base` as they were entered, values out of range included, for +/// the editor to show while [`FlattenOptions::from_params_with`] refuses them. A value of the wrong +/// type shows as `base`'s. +pub(crate) fn entered_options(fields: &Map, base: &FlattenOptions) -> FlattenOptions { + let Ok(Value::Object(mut v)) = serde_json::to_value(base) else { return base.clone() }; + for (k, val) in fields { + let Some(slot) = v.get_mut(k) else { continue }; + let old = std::mem::replace(slot, val.clone()); + if serde_json::from_value::(Value::Object(v.clone())).is_err() { + v.insert(k.clone(), old); + } + } + serde_json::from_value(Value::Object(v)).unwrap_or_else(|_| base.clone()) +} + /// The options the fields hold (a `preset` not loaded yet: its own). fn options(d: &Dialog, saved: &[FlattenerPreset]) -> Result { if d.str("preset") != d.str(APPLIED) { @@ -101,9 +127,11 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { save_row(app, ui, d); } ui.add_space(10.0); - let mut o = current.clone().unwrap_or_default(); + // Values refused stay as entered, so that changing another option keeps them. + let mut o = current.clone().unwrap_or_else(|_| entered_options(&d.fields, &FlattenOptions::default())); + let shown = o.clone(); if options_editor(ui, "flatten-dialog", &mut o, true) { - put_options(&mut d.fields, &o); + put_changed_options(&mut d.fields, &shown, &o); } if let Err(e) = ¤t { ui.label(egui::RichText::new(e).color(Tokens::get(ui.ctx()).text_dim).size(11.5)); @@ -404,4 +432,27 @@ mod tests { assert!(super::super::confirm(&mut app).unwrap_err().contains("resolutions")); assert!(app.ui.dialog.is_some()); } + + /// Changing a switch beside a value out of range keeps the values entered. + #[test] + fn a_switch_changed_beside_a_bad_value_keeps_the_values_entered() { + let mut app = scene(); + app.run("ui.flattenTransparencyDialog", json!({})).unwrap(); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("balance".into(), json!(20)); + d.fields.insert("gradientPpi".into(), json!(9000)); + d.fields.insert("lineArtPpi".into(), json!("many")); + let mut f = super::super::tests_eps::Frames::new(); + let (_, at) = f.control(&mut app, "Convert All Text to Outlines", egui::accesskit::Role::CheckBox); + let before = app.ui.dialog.as_ref().unwrap().bool("textToOutlines"); + f.click(&mut app, at); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!(d.bool("textToOutlines"), !before, "the switch changes"); + assert_eq!((d.f64("balance", 0.0), d.f64("gradientPpi", 0.0)), (20.0, 9000.0), "the other values stay as entered"); + assert_eq!(d.fields["lineArtPpi"], json!("many"), "a value of the wrong type stays to be refused"); + assert!(super::super::confirm(&mut app).is_err()); + let d = app.ui.dialog.as_mut().unwrap(); + d.fields.insert("lineArtPpi".into(), json!(300)); + assert!(super::super::confirm(&mut app).unwrap_err().contains("resolutions")); + } } diff --git a/crates/ui-egui/src/dialogs/tests_eps.rs b/crates/ui-egui/src/dialogs/tests_eps.rs index f97207e215..eddde431b1 100644 --- a/crates/ui-egui/src/dialogs/tests_eps.rs +++ b/crates/ui-egui/src/dialogs/tests_eps.rs @@ -169,6 +169,93 @@ fn bad_custom_flattener_options_keep_the_dialog_open() { assert_eq!((d.fields["flattener"]["preserveOverprints"].as_bool(), d.fields["flattener"]["preserveAlpha"].as_bool()), (Some(true), Some(false))); } +/// Headless frames of the dialog layer with screen-reader output, input events and a clock. +pub(super) struct Frames { + ctx: egui::Context, + time: f64, +} + +impl Frames { + pub(super) fn new() -> Self { + let ctx = egui::Context::default(); + ctx.enable_accesskit(); + crate::theme::install_fonts(&ctx); + Self { ctx, time: 0.0 } + } + + fn run(&mut self, app: &mut VectorcraftApp, events: Vec) -> egui::FullOutput { + self.time += 0.1; + let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1280.0, 900.0)); + let input = egui::RawInput { events, time: Some(self.time), screen_rect: Some(screen), ..Default::default() }; + let mut out = self.ctx.run_ui(input, |ui| show(app, ui.ctx())); + out.textures_delta.clear(); + out + } + + /// The screen-reader node of the control of `role` named `label`, with its center. + pub(super) fn control(&mut self, app: &mut VectorcraftApp, label: &str, role: egui::accesskit::Role) -> (egui::accesskit::NodeId, egui::Pos2) { + self.run(app, vec![]); + let out = self.run(app, vec![]); + let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes; + let (id, n) = + nodes.iter().find(|(_, n)| n.label() == Some(label) && n.role() == role).unwrap_or_else(|| panic!("no {role:?} named {label:?}")); + let b = n.bounds().expect("bounds"); + (*id, egui::pos2((b.x0 + b.x1) as f32 * 0.5, (b.y0 + b.y1) as f32 * 0.5)) + } + + pub(super) fn click(&mut self, app: &mut VectorcraftApp, at: egui::Pos2) { + for pressed in [true, false] { + let button = egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE }; + self.run(app, vec![egui::Event::PointerMoved(at), button]); + } + } +} + +/// Enter on the focused Custom… button opens the custom options and does not also confirm them. +#[test] +fn enter_on_the_custom_button_opens_the_custom_options() { + use egui::accesskit::{Action, ActionRequest, Role, TreeId}; + let (mut app, _) = app(1); + app.run("flattener.presets.save", json!({"name": "Mine", "balance": 0})).unwrap(); + app.run("ui.epsOptionsDialog", json!({"path": "/out/a.eps", "flattenerPreset": "Mine"})).unwrap(); + let mut f = Frames::new(); + let (node, _) = f.control(&mut app, "Custom…", Role::Button); + f.run( + &mut app, + vec![egui::Event::AccessKitActionRequest(ActionRequest { action: Action::Focus, target_node: node, target_tree: TreeId::ROOT, data: None })], + ); + let enter = |pressed| egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed, repeat: false, modifiers: Default::default() }; + f.run(&mut app, vec![enter(true)]); + f.run(&mut app, vec![enter(false)]); + assert_eq!(kind(&app), Some(eps_options::CUSTOM_KIND), "the custom options stay open"); + let parent = super::parent(app.ui.dialog.as_ref().unwrap()).unwrap(); + assert_eq!(parent.str("flattenerPreset"), "Mine", "EPS Options keep their preset"); +} + +/// With a value out of range, the editor shows the values entered, and changing a switch keeps +/// them, so OK still refuses the bad value. +#[test] +fn a_switch_changed_beside_a_bad_value_keeps_the_values_entered() { + let (mut app, _) = app(1); + app.run("ui.epsOptionsDialog", json!({"path": "/out/a.eps"})).unwrap(); + frame(&mut app); + open_custom(&mut app); + set(&mut app, "balance", json!(20)); + set(&mut app, "gradientPpi", json!(9000)); + set(&mut app, "lineArtPpi", json!("many")); + let mut f = Frames::new(); + let (_, at) = f.control(&mut app, "Convert All Text to Outlines", egui::accesskit::Role::CheckBox); + let before = app.ui.dialog.as_ref().unwrap().bool("textToOutlines"); + f.click(&mut app, at); + let d = app.ui.dialog.as_ref().unwrap(); + assert_eq!(d.bool("textToOutlines"), !before, "the switch changes"); + assert_eq!((d.f64("balance", 0.0), d.f64("gradientPpi", 0.0)), (20.0, 9000.0), "the other values stay as entered"); + assert_eq!(d.fields["lineArtPpi"], json!("many"), "a value of the wrong type stays to be refused"); + assert!(confirm(&mut app).is_err()); + set(&mut app, "lineArtPpi", json!(300)); + assert!(confirm(&mut app).unwrap_err().contains("resolutions")); +} + #[test] fn the_eps_options_dialog_needs_a_document() { let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); From 98c76c8367f4376bb38c162e6735a4aa28d5a20a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 08:56:25 -0800 Subject: [PATCH 3/3] Flatten Transparency: a value of the wrong type shows blank and can be typed over A flattener option field holding a value of the wrong type showed the default preset's value, and typing that same value committed nothing, so OK kept failing. Such a field now shows blank, and every control the user sets writes its option into the dialog's fields, also when the value equals the one shown. This applies to Flatten Transparency and to EPS Options' Custom Transparency Flattener Options. --- crates/ui-egui/src/dialogs/eps_options.rs | 15 +-- crates/ui-egui/src/dialogs/flatten.rs | 129 ++++++++++++++-------- crates/ui-egui/src/dialogs/tests_eps.rs | 29 +++++ 3 files changed, 119 insertions(+), 54 deletions(-) diff --git a/crates/ui-egui/src/dialogs/eps_options.rs b/crates/ui-egui/src/dialogs/eps_options.rs index 0d14b3cac4..0eb1853065 100644 --- a/crates/ui-egui/src/dialogs/eps_options.rs +++ b/crates/ui-egui/src/dialogs/eps_options.rs @@ -197,17 +197,12 @@ fn overprints_kept(d: &Dialog) -> bool { /// format (no alpha) and by EPS Options' Overprints. fn custom_body(_app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { let current = custom_options(d); - // Values refused stay as entered, so that changing another option keeps them. - let mut o = current.clone().unwrap_or_else(|_| super::flatten::entered_options(&d.fields, &FlattenOptions::default())); - let kept = o.preserve_overprints; + // Values refused stay as entered, so that changing another option keeps them. The Preserve + // switches can't be set here, so the fields keep their own values of them. + let (mut o, unread) = super::flatten::shown_options(&d.fields, ¤t); o.preserve_alpha = false; - o.preserve_overprints = kept && overprints_kept(d); - let mut shown = o.clone(); - shown.preserve_overprints = kept; - if super::flatten::options_editor_fixed_preserve(ui, "eps-flattener", &mut o) { - o.preserve_overprints = kept; - super::flatten::put_changed_options(&mut d.fields, &shown, &o); - } + o.preserve_overprints &= overprints_kept(d); + super::flatten::fields_editor(ui, "eps-flattener", &mut d.fields, &mut o, &unread, true); if let Err(e) = ¤t { ui.label(egui::RichText::new(e).color(Tokens::get(ui.ctx()).text_dim).size(11.5)); } diff --git a/crates/ui-egui/src/dialogs/flatten.rs b/crates/ui-egui/src/dialogs/flatten.rs index e9731efe4b..3ae84e0f53 100644 --- a/crates/ui-egui/src/dialogs/flatten.rs +++ b/crates/ui-egui/src/dialogs/flatten.rs @@ -48,30 +48,51 @@ pub(crate) fn put_options(fields: &mut Map, o: &FlattenOptions) { } } -/// Write into the option fields only the options that differ between `shown` and `edited`, so -/// that a value the editor could not show stays in the fields as it was entered. -pub(crate) fn put_changed_options(fields: &mut Map, shown: &FlattenOptions, edited: &FlattenOptions) { - let (Ok(Value::Object(old)), Ok(Value::Object(new))) = (serde_json::to_value(shown), serde_json::to_value(edited)) else { return }; - for (k, v) in new { - if old.get(&k) != Some(&v) { - fields.insert(k, v); - } - } -} - /// The options `fields` hold over `base` as they were entered, values out of range included, for -/// the editor to show while [`FlattenOptions::from_params_with`] refuses them. A value of the wrong -/// type shows as `base`'s. -pub(crate) fn entered_options(fields: &Map, base: &FlattenOptions) -> FlattenOptions { - let Ok(Value::Object(mut v)) = serde_json::to_value(base) else { return base.clone() }; +/// the editor to show while [`FlattenOptions::from_params_with`] refuses them, and the keys of the +/// values of the wrong type, which take `base`'s value here and show blank in the editor. +pub(crate) fn entered_options(fields: &Map, base: &FlattenOptions) -> (FlattenOptions, Vec) { + let Ok(Value::Object(mut v)) = serde_json::to_value(base) else { return (base.clone(), Vec::new()) }; + let mut unread = Vec::new(); for (k, val) in fields { let Some(slot) = v.get_mut(k) else { continue }; let old = std::mem::replace(slot, val.clone()); if serde_json::from_value::(Value::Object(v.clone())).is_err() { v.insert(k.clone(), old); + unread.push(k.clone()); + } + } + (serde_json::from_value(Value::Object(v)).unwrap_or_else(|_| base.clone()), unread) +} + +/// The options a dialog's `fields` hold, for [`fields_editor`]: `current` when they are valid, else +/// the values entered over the default preset's, with the keys of the values of the wrong type. +pub(crate) fn shown_options(fields: &Map, current: &Result) -> (FlattenOptions, Vec) { + match current { + Ok(o) => (o.clone(), Vec::new()), + Err(_) => entered_options(fields, &FlattenOptions::default()), + } +} + +/// [`options_editor`] on the option fields of a dialog: `o` and `unread` from [`shown_options`]. +/// Each option whose control was set is written into `fields`, also when it equals the value shown, +/// so that it replaces a value of the wrong type; the other fields stay as they were entered. With +/// `fixed_preserve`, the two Preserve switches show but can't be changed. +pub(crate) fn fields_editor( + ui: &mut egui::Ui, + id: &str, + fields: &mut Map, + o: &mut FlattenOptions, + unread: &[String], + fixed_preserve: bool, +) { + let set = editor(ui, id, o, true, fixed_preserve, unread); + let Ok(Value::Object(m)) = serde_json::to_value(&*o) else { return }; + for k in set { + if let Some(v) = m.get(k) { + fields.insert(k.into(), v.clone()); } } - serde_json::from_value(Value::Object(v)).unwrap_or_else(|_| base.clone()) } /// The options the fields hold (a `preset` not loaded yet: its own). @@ -128,11 +149,8 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { } ui.add_space(10.0); // Values refused stay as entered, so that changing another option keeps them. - let mut o = current.clone().unwrap_or_else(|_| entered_options(&d.fields, &FlattenOptions::default())); - let shown = o.clone(); - if options_editor(ui, "flatten-dialog", &mut o, true) { - put_changed_options(&mut d.fields, &shown, &o); - } + let (mut o, unread) = shown_options(&d.fields, ¤t); + fields_editor(ui, "flatten-dialog", &mut d.fields, &mut o, &unread, false); if let Err(e) = ¤t { ui.label(egui::RichText::new(e).color(Tokens::get(ui.ctx()).text_dim).size(11.5)); } @@ -208,18 +226,19 @@ const FIELD: f32 = 56.0; /// panel edit them: the raster/vector balance, both resolutions and the six switches. Returns true /// when one changed. pub(crate) fn options_editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions, enabled: bool) -> bool { - editor(ui, id, o, enabled, false) -} - -/// [`options_editor`] with Preserve Alpha Transparency and Preserve Overprints and Spot Colors -/// shown but not editable (the file format or another control sets them). -pub(crate) fn options_editor_fixed_preserve(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions) -> bool { - editor(ui, id, o, true, true) -} - -fn editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions, enabled: bool, fixed_preserve: bool) -> bool { - let t = Tokens::get(ui.ctx()); let before = o.clone(); + editor(ui, id, o, enabled, false, &[]); + *o != before +} + +/// The option controls, with the value fields of the options named in `unread` blank. With +/// `fixed_preserve`, Preserve Alpha Transparency and Preserve Overprints and Spot Colors show but +/// can't be changed (the file format or another control sets them). Returns the keys of the +/// options whose controls were set, also to the value they showed. +fn editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions, enabled: bool, fixed_preserve: bool, unread: &[String]) -> Vec<&'static str> { + let t = Tokens::get(ui.ctx()); + let mut set = Vec::new(); + let field_value = |key: &str, v: f64| (!unread.iter().any(|k| k == key)).then_some(v); let dim = |ui: &mut egui::Ui, s: &str| { ui.label(egui::RichText::new(tl!(s)).color(t.text_dim).size(11.5)); }; @@ -241,22 +260,28 @@ fn editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions, enabled: bool, fi ); if let Some(b) = x.map(|x| (x as f64 * 100.0).round()).or(keyed) { o.balance = b; + set.push("balance"); } dim(ui, tl!("Vectors")); + let value = field_value("balance", o.balance); if let Some(v) = - widgets::range_field_named(ui, (id, "balance"), Some(tl!("Raster/Vector Balance:")), o.balance, 0.0..=100.0, "", 0, FIELD - 12.0) + widgets::range_field_named(ui, (id, "balance"), Some(tl!("Raster/Vector Balance:")), value, 0.0..=100.0, "", 0, FIELD - 12.0) { o.balance = v; + set.push("balance"); } }); ui.add_space(4.0); egui::Grid::new((id, "resolutions")).num_columns(2).spacing([8.0, 4.0]).show(ui, |ui| { - for (label, key) in [(tl!("Line Art and Text Resolution:"), 0), (tl!("Gradient and Mesh Resolution:"), 1)] { + for (label, key, name) in + [(tl!("Line Art and Text Resolution:"), 0, "lineArtPpi"), (tl!("Gradient and Mesh Resolution:"), 1, "gradientPpi")] + { widgets::dim_label(ui, label); ui.horizontal(|ui| { let v = if key == 0 { &mut o.line_art_ppi } else { &mut o.gradient_ppi }; - if let Some(n) = widgets::range_field_named(ui, (id, key), Some(label), *v, 1.0..=2400.0, "", 0, FIELD) { + if let Some(n) = widgets::range_field_named(ui, (id, key), Some(label), field_value(name, *v), 1.0..=2400.0, "", 0, FIELD) { *v = n; + set.push(name); } dim(ui, "ppi"); }); @@ -264,21 +289,22 @@ fn editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions, enabled: bool, fi } }); ui.add_space(4.0); - let switches: [(&str, &mut bool, bool); 6] = [ - (tl!("Convert All Text to Outlines"), &mut o.text_to_outlines, false), - (tl!("Convert All Strokes to Outlines"), &mut o.strokes_to_outlines, false), - (tl!("Clip Complex Regions"), &mut o.clip_complex_regions, false), - (tl!("Anti-alias Rasters"), &mut o.anti_alias, false), - (tl!("Preserve Alpha Transparency"), &mut o.preserve_alpha, fixed_preserve), - (tl!("Preserve Overprints and Spot Colors"), &mut o.preserve_overprints, fixed_preserve), + let switches: [(&str, &mut bool, bool, &'static str); 6] = [ + (tl!("Convert All Text to Outlines"), &mut o.text_to_outlines, false, "textToOutlines"), + (tl!("Convert All Strokes to Outlines"), &mut o.strokes_to_outlines, false, "strokesToOutlines"), + (tl!("Clip Complex Regions"), &mut o.clip_complex_regions, false, "clipComplexRegions"), + (tl!("Anti-alias Rasters"), &mut o.anti_alias, false, "antiAlias"), + (tl!("Preserve Alpha Transparency"), &mut o.preserve_alpha, fixed_preserve, "preserveAlpha"), + (tl!("Preserve Overprints and Spot Colors"), &mut o.preserve_overprints, fixed_preserve, "preserveOverprints"), ]; - for (label, v, fixed) in switches { + for (label, v, fixed, key) in switches { if widgets::check(ui, label, *v, enabled && !fixed) { *v = !*v; + set.push(key); } } }); - *o != before + set } #[cfg(test)] @@ -455,4 +481,19 @@ mod tests { d.fields.insert("lineArtPpi".into(), json!(300)); assert!(super::super::confirm(&mut app).unwrap_err().contains("resolutions")); } + + /// A value of the wrong type shows blank, and typing the default preset's value into its + /// field replaces it, so OK flattens. + #[test] + fn the_default_value_typed_over_a_value_of_the_wrong_type_replaces_it() { + let mut app = scene(); + app.run("ui.flattenTransparencyDialog", json!({})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("lineArtPpi".into(), json!("many")); + let default = FlattenOptions::default().line_art_ppi; + let mut f = super::super::tests_eps::Frames::new(); + f.type_into(&mut app, "Line Art and Text Resolution:", &default.to_string()); + assert_eq!(app.ui.dialog.as_ref().unwrap().fields["lineArtPpi"], json!(default)); + super::super::confirm(&mut app).unwrap(); + assert!(app.ui.dialog.is_none() && !transparent_left(&app)); + } } diff --git a/crates/ui-egui/src/dialogs/tests_eps.rs b/crates/ui-egui/src/dialogs/tests_eps.rs index eddde431b1..5cd2efe24c 100644 --- a/crates/ui-egui/src/dialogs/tests_eps.rs +++ b/crates/ui-egui/src/dialogs/tests_eps.rs @@ -209,6 +209,17 @@ impl Frames { self.run(app, vec![egui::Event::PointerMoved(at), button]); } } + + /// Click the text field named `label`, type `text` over its text and press Tab. + pub(super) fn type_into(&mut self, app: &mut VectorcraftApp, label: &str, text: &str) { + let (_, at) = self.control(app, label, egui::accesskit::Role::TextInput); + self.click(app, at); + self.run(app, vec![egui::Event::Text(text.into())]); + let tab = |pressed| egui::Event::Key { key: egui::Key::Tab, physical_key: None, pressed, repeat: false, modifiers: Default::default() }; + self.run(app, vec![tab(true)]); + self.run(app, vec![tab(false)]); + self.run(app, vec![]); + } } /// Enter on the focused Custom… button opens the custom options and does not also confirm them. @@ -256,6 +267,24 @@ fn a_switch_changed_beside_a_bad_value_keeps_the_values_entered() { assert!(confirm(&mut app).unwrap_err().contains("resolutions")); } +/// A value of the wrong type shows blank, and typing the default preset's value into its field +/// replaces it, so OK takes the options. +#[test] +fn the_default_value_typed_over_a_value_of_the_wrong_type_replaces_it() { + let (mut app, _) = app(1); + app.run("ui.epsOptionsDialog", json!({"path": "/out/a.eps"})).unwrap(); + frame(&mut app); + open_custom(&mut app); + set(&mut app, "lineArtPpi", json!("many")); + let default = vectorcraft_engine::cmd::FlattenOptions::default().line_art_ppi; + let mut f = Frames::new(); + f.type_into(&mut app, "Line Art and Text Resolution:", &default.to_string()); + assert_eq!(app.ui.dialog.as_ref().unwrap().fields["lineArtPpi"], json!(default)); + confirm(&mut app).unwrap(); + assert_eq!(kind(&app), Some("epsOptions")); + assert_eq!(app.ui.dialog.as_ref().unwrap().fields["flattener"]["lineArtPpi"].as_f64(), Some(default)); +} + #[test] fn the_eps_options_dialog_needs_a_document() { let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());