Merge pull request #8153 from dotCooCoo/feat/eps-options-custom-flattener

EPS Options: Custom… sets the flattener options the export uses
This commit is contained in:
BFlat
2026-11-18 10:16:50 +07:00
committed by GitHub
37 changed files with 560 additions and 33 deletions
+1 -1
View File
@@ -1681,7 +1681,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",
+11 -2
View File
@@ -419,6 +419,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,
@@ -656,7 +657,8 @@ pub(crate) fn parent(d: &Dialog) -> Option<Dialog> {
}
/// `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, Transform Each's Relative / Absolute keeps the Scale fields' size, and Recolor
/// Artwork's `group` selects that color group and its `groupAction` runs the button at once. A value
@@ -672,6 +674,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),
@@ -836,6 +842,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 {
@@ -935,7 +944,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 {
+112 -8
View File
@@ -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,81 @@ 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<String, Value>) {
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, String> {
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, String> {
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);
// 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, &current);
o.preserve_alpha = false;
o.preserve_overprints &= overprints_kept(d);
super::flatten::fields_editor(ui, "eps-flattener", &mut d.fields, &mut o, &unread, true);
if let Err(e) = &current {
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<Value, String> {
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<Value, String> {
let params = fileio::eps::resolve(&super::form::params(d), &app.session.prefs.flattener_presets)?;
+120 -18
View File
@@ -48,6 +48,53 @@ pub(crate) fn put_options(fields: &mut Map<String, Value>, o: &FlattenOptions) {
}
}
/// 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, 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<String, Value>, base: &FlattenOptions) -> (FlattenOptions, Vec<String>) {
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::<FlattenOptions>(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<String, Value>, current: &Result<FlattenOptions, String>) -> (FlattenOptions, Vec<String>) {
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<String, Value>,
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());
}
}
}
/// The options the fields hold (a `preset` not loaded yet: its own).
fn options(d: &Dialog, saved: &[FlattenerPreset]) -> Result<FlattenOptions, String> {
if d.str("preset") != d.str(APPLIED) {
@@ -101,10 +148,9 @@ 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();
if options_editor(ui, "flatten-dialog", &mut o, true) {
put_options(&mut d.fields, &o);
}
// Values refused stay as entered, so that changing another option keeps them.
let (mut o, unread) = shown_options(&d.fields, &current);
fields_editor(ui, "flatten-dialog", &mut d.fields, &mut o, &unread, false);
if let Err(e) = &current {
ui.label(egui::RichText::new(e).color(Tokens::get(ui.ctx()).text_dim).size(11.5));
}
@@ -180,8 +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 {
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));
};
@@ -203,22 +260,28 @@ pub(crate) fn options_editor(ui: &mut egui::Ui, id: &str, o: &mut FlattenOptions
);
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, super::ppi_suffix().trim());
});
@@ -226,21 +289,22 @@ 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, &'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) in switches {
if widgets::check(ui, label, *v, enabled) {
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)]
@@ -394,4 +458,42 @@ 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"));
}
/// 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));
}
}
+218
View File
@@ -67,6 +67,224 @@ 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)));
}
/// 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::Event>) -> 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]);
}
}
/// 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.
#[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"));
}
/// 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());
+3
View File
@@ -2486,6 +2486,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 Преглед на напечатването върху друго
Can't render this file because it is too large.
+3
View File
@@ -2889,6 +2889,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
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -3157,6 +3157,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ó
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -2970,6 +2970,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
Can't render this file because it is too large.
+3
View File
@@ -5448,6 +5448,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
Can't render this file because it is too large.
+3
View File
@@ -2530,6 +2530,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
Can't render this file because it is too large.
+3
View File
@@ -3471,6 +3471,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 Προεπισκόπηση υπερεκτύπωσης
Can't render this file because it is too large.
+3
View File
@@ -2573,6 +2573,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
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -2914,6 +2914,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
Can't render this file because it contains an unexpected character in line 2 and column 73.
+3
View File
@@ -2561,6 +2561,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
Can't render this file because it is too large.
+3
View File
@@ -2620,6 +2620,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 અક્ષરનો રંગ ઓવરરાઇડ કરો
Can't render this file because it contains an unexpected character in line 72 and column 5.
+3
View File
@@ -3440,6 +3440,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 फ़िल ओवरप्रिंट करें
Can't render this file because it is too large.
+3
View File
@@ -3061,6 +3061,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
Can't render this file because it is too large.
+3
View File
@@ -2697,6 +2697,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
Can't render this file because it contains an unexpected character in line 2516 and column 5.
+3
View File
@@ -2611,6 +2611,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
Can't render this file because it is too large.
+3
View File
@@ -2734,6 +2734,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 文字カラーを上書き
Can't render this file because it is too large.
+3
View File
@@ -4867,6 +4867,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 მნიშვნელობების შენარჩუნება
Can't render this file because it is too large.
+3
View File
@@ -2724,6 +2724,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 문자 색상 덮어쓰기
Can't render this file because it is too large.
+3
View File
@@ -3319,6 +3319,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
Can't render this file because it is too large.
+3
View File
@@ -2883,6 +2883,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
Can't render this file because it is too large.
+3
View File
@@ -2120,6 +2120,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
Can't render this file because it is too large.
+3
View File
@@ -2598,6 +2598,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 Просмотр наложения
Can't render this file because it is too large.
+3
View File
@@ -2504,6 +2504,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
Can't render this file because it is too large.
+3
View File
@@ -2345,6 +2345,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
Can't render this file because it is too large.
+3
View File
@@ -2603,6 +2603,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 Перегляд накладання
Can't render this file because it is too large.
+3
View File
@@ -2881,6 +2881,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
Can't render this file because it contains an unexpected character in line 206 and column 5.
+3
View File
@@ -2463,6 +2463,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 叠印预览
Can't render this file because it is too large.
+3
View File
@@ -3748,6 +3748,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 疊印預視
Can't render this file because it is too large.
+1 -1
View File
@@ -1682,7 +1682,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",
+9 -1
View File
@@ -825,13 +825,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`
+3 -2
View File
@@ -8786,8 +8786,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.
+1
View File
@@ -727,6 +727,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 `<name>_<artboard>.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`.