Color Settings: Ask When Opening and Ask When Pasting prompt about profile mismatches

edit.colorSettings takes askMismatchOpen, askMismatchPaste and
askMissingOpen (off by default), kept in Color Settings.json and shown in
the Separations panel's Color Settings section. With a box on, File > Open
asks before a document opens whose color mode's profile is not the working
space (use the embedded profile, convert the colors, discard the profile) or
that has none (leave it, assign the working space, assign a profile), and
Paste asks whether colors copied from a document with another profile keep
their numbers or convert. Each prompt starts on what the policy does; Cancel
opens or pastes nothing.

document.open takes the answer as profileChoice (with assignProfile) and
never asks. The paste commands take profileMismatch, and without it follow
the policy of each model, as a drag between documents does.
clipboard.profileMismatch lists the models a paste would ask about.
This commit is contained in:
dotCooCoo committed 2026-11-14 18:02:06 -08:00
1 parent 2793e3379a
commit f71437f2a1
53 files changed
+2028 -101

No files matched your search

+12
View File
@@ -185,6 +185,15 @@ pub struct ColorSettings {
/// The color management policy for CMYK profiles. Settings saved without one take the default.
#[serde(default)]
pub cmyk_policy: Policy,
/// Profile Mismatches: Ask When Opening. Off by default, as in settings saved without it.
#[serde(default)]
pub ask_mismatch_open: bool,
/// Profile Mismatches: Ask When Pasting.
#[serde(default)]
pub ask_mismatch_paste: bool,
/// Missing Profiles: Ask When Opening.
#[serde(default)]
pub ask_missing_open: bool,
}
impl Default for ColorSettings {
@@ -196,6 +205,9 @@ impl Default for ColorSettings {
bpc: true,
rgb_policy: Policy::default(),
cmyk_policy: Policy::default(),
ask_mismatch_open: false,
ask_mismatch_paste: false,
ask_missing_open: false,
}
}
}
+17
View File
@@ -459,6 +459,23 @@ fn policies_parse_and_default_in_saved_settings() {
assert_eq!((saved["rgbPolicy"].as_str(), saved["cmykPolicy"].as_str()), (Some("preserveEmbedded"), Some("preserveNumbers")));
}
/// The three Ask boxes are off by default and in settings saved before they existed, and save
/// under their own keys.
#[test]
fn ask_boxes_default_off_and_save() {
let old: ColorSettings =
serde_json::from_str(r#"{"rgb": "sRGB IEC61966-2.1", "cmyk": "Device CMYK (uncalibrated)", "intent": "perceptual", "bpc": false}"#).unwrap();
assert!(!old.ask_mismatch_open && !old.ask_mismatch_paste && !old.ask_missing_open);
let st = ColorSettings::default();
assert!(!st.ask_mismatch_open && !st.ask_mismatch_paste && !st.ask_missing_open);
let saved = serde_json::to_value(ColorSettings { ask_mismatch_paste: true, ..Default::default() }).unwrap();
assert_eq!(saved["askMismatchOpen"], false);
assert_eq!(saved["askMismatchPaste"], true);
assert_eq!(saved["askMissingOpen"], false);
let back: ColorSettings = serde_json::from_value(saved).unwrap();
assert!(back.ask_mismatch_paste);
}
/// Convert to Working Space keeps a color's appearance: an RGB color of a wide space converts into
/// sRGB, and a CMYK color of one CMYK space into another, with numbers that look the same. Grey and
/// Lab colors stay as they are.
+86 -6
View File
@@ -47,10 +47,19 @@ pub fn specs() -> Vec<CommandSpec> {
"Swatch Conflicts",
[],
None,
"{} → {swatches: [{name, document, clipboard, spot}]} the global or spot swatches the copied objects use whose name the active document gives another colour (`document`/`clipboard`: #rrggbb): Paste asks Merge or Add for each (pass the answer as edit.paste* {swatchConflict}). Pasting back into the document the objects came from raises none",
"{profileMismatch?: as edit.paste} → {swatches: [{name, document, clipboard, spot}]} the global or spot swatches the copied objects use whose name the active document gives another colour (`document`/`clipboard`: #rrggbb, the pasted colour as the paste brings it, converted when profileMismatch or the policy converts it): Paste asks Merge or Add for each (pass the answer as edit.paste* {swatchConflict}). Pasting back into the document the objects came from raises none, unless the paste converts its colours",
has_doc,
conflicts
),
cmd!(
query "clipboard.profileMismatch",
"Paste Profile Mismatch",
[],
None,
"{} → {mismatches: [{model: \"rgb\"|\"cmyk\", clipboard, document, default: \"preserveNumbers\"|\"convert\"}]} the color models whose colors the copied objects use and whose profile in the document they were copied from (its assigned profile, else the working space then) is not the active document's: Paste keeps their numbers or converts them into the document's profile as edit.paste* {profileMismatch} says, else as the model's policy of edit.colorSettings does (convert: converts; the others: keeps the numbers). With askMismatchPaste on, the desktop app asks first. Objects from outside an open document have none",
has_doc,
profile_mismatch
),
];
v.extend(flavours::specs());
v
@@ -100,6 +109,15 @@ pub struct Clipboard {
/// The selected ruler guides copied with (or without) the objects (#3226), as canvas guides on
/// no layer: pasting puts them on the layer new art goes to, moved as the objects are.
pub guides: Vec<vectorcraft_doc::Guide>,
/// The RGB and CMYK profiles the objects' colors showed through in the document they were
/// copied from (its assigned profiles, else the working spaces then), by name; none for objects
/// from outside an open document. Paste compares them with the destination's
/// ([`super::colormgmt::paste_mismatches`]).
pub source_profiles: Option<[String; 2]>,
/// The colors were converted for this paste ([`super::colormgmt::paste_profiles`]): back in the
/// source document its resources of the same names are compared with them, as another
/// document's are, while its layers are still found by id.
pub colors_converted: bool,
}
/// The layer an object was copied from, as Paste Remembers Layers finds it again: the top-level
@@ -264,6 +282,7 @@ impl Clipboard {
pub fn from_node(st: &DocState, node: Node) -> Self {
let mut clip = Self::gather(&st.doc, vec![node]);
clip.source_doc = Some(st.uid);
clip.source_profiles = Some(super::colormgmt::effective_profiles(&st.doc));
clip
}
@@ -335,6 +354,7 @@ impl Clipboard {
source_artboard: board.and_then(|i| d.artboards.get(i)).map(|a| a.rect),
source_layers,
source_doc: Some(st.uid),
source_profiles: Some(super::colormgmt::effective_profiles(d)),
..Self::gather(d, nodes)
}
}
@@ -369,7 +389,7 @@ impl Clipboard {
/// The swatch name conflicts pasting into `st` raises, as (pasted, document) swatches: none
/// back in the document the objects came from.
pub fn swatch_conflicts<'a>(&'a self, st: &'a DocState) -> Vec<(&'a Swatch, &'a Swatch)> {
if self.source_doc == Some(st.uid) {
if self.source_doc == Some(st.uid) && !self.colors_converted {
return vec![];
}
self.conflicts(&st.doc, &self.used())
@@ -419,6 +439,56 @@ impl Clipboard {
d
}
/// The clipboard with every color of its objects and of the resources it carries (swatches,
/// symbols, patterns, graphic styles, brushes, character and paragraph styles, the background
/// colors of copied artboards) mapped by `conv`,
/// as Document Color Mode maps a document's ([`super::colormgmt::convert_art_and_style_colors`]).
/// Images keep their pixels.
pub(crate) fn with_colors(&self, conv: &dyn Fn(&vectorcraft_color::Color) -> vectorcraft_color::Color) -> Self {
let mut d = self.to_document();
// Only what the clipboard carries: not the swatches, graphic styles and brushes every new
// document starts with.
d.swatches = self.swatches.clone().into();
d.swatch_groups = Default::default();
d.graphic_styles = self.graphic_styles.clone().into();
vectorcraft_brush::store(&mut d, &self.brushes);
// Not the stand-in document's own artboard and Document Setup colors: only what the
// clipboard carries is mapped.
super::colormgmt::convert_art_and_style_colors(&mut d, conv);
// `to_document` puts the objects in its one layer.
let nodes = d.layers.first().and_then(|l| l.children()).map(|ch| ch.iter().map(|n| (**n).clone()).collect()).unwrap_or_default();
Self {
nodes,
symbols: d.symbols.clone(),
patterns: d.patterns.clone(),
swatches: d.swatches.to_vec(),
graphic_styles: d.graphic_styles.to_vec(),
char_styles: d.char_styles.to_vec(),
para_styles: d.para_styles.to_vec(),
brushes: vectorcraft_brush::library(&d),
images: self.images.clone(),
symbol_options: self.symbol_options.clone(),
source_artboard: self.source_artboard,
source_layers: self.source_layers.clone(),
source_doc: self.source_doc,
// The background colors of copied artboards map too.
artboards: self
.artboards
.iter()
.map(|a| {
let mut a = a.clone();
if let Some(c) = a.color.as_mut() {
*c = conv(c);
}
a
})
.collect(),
guides: self.guides.clone(),
source_profiles: self.source_profiles.clone(),
colors_converted: self.colors_converted,
}
}
/// The objects as standalone SVG (`None` when there are none).
pub fn svg(&self) -> Option<String> {
if !self.has_art() {
@@ -463,17 +533,27 @@ fn import_svg(s: &mut Session, p: &Value) -> Result<Value> {
Ok(json!({ "count": s.load_clipboard(clip, p)? }))
}
fn conflicts(s: &mut Session, _: &Value) -> Result<Value> {
fn conflicts(s: &mut Session, p: &Value) -> Result<Value> {
let hex = |w: &Swatch| w.paint.color().map(|c| c.to_hex());
let list: Vec<Value> = s
.clipboard
.swatch_conflicts(s.doc()?)
// The swatches as the paste brings them: converted from another profile when it converts.
let profile = super::colormgmt::PasteProfile::param(p, "clipboard.conflicts")?;
let st = s.doc()?;
let (converted, _) = super::colormgmt::paste_profiles(&s.clipboard, &st.doc, profile);
let list: Vec<Value> = converted
.as_ref()
.unwrap_or(&s.clipboard)
.swatch_conflicts(st)
.into_iter()
.map(|(c, t)| json!({"name": c.name, "document": hex(t), "clipboard": hex(c), "spot": c.spot}))
.collect();
Ok(json!({ "swatches": list }))
}
fn profile_mismatch(s: &mut Session, _: &Value) -> Result<Value> {
let list: Vec<Value> = super::colormgmt::paste_mismatches(&s.clipboard, &s.doc()?.doc).iter().map(|m| m.to_json()).collect();
Ok(json!({ "mismatches": list }))
}
#[cfg(test)]
mod tests {
use super::*;
+413 -28
View File
@@ -37,7 +37,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Color Settings…",
["Edit"],
Some("Cmd+Shift+K"),
"{rgb?: profile, cmyk?: profile, intent?: \"perceptual\"|\"relative\"|\"saturation\"|\"absolute\", bpc?: bool, rgbPolicy?: \"off\"|\"preserveEmbedded\"|\"convert\", cmykPolicy?: \"off\"|\"preserveEmbedded\"|\"convert\"|\"preserveNumbers\"} set the working spaces and the color management policies → {rgb, cmyk, intent, bpc, rgbPolicy, cmykPolicy, profiles: [{name, kind, builtin}]}. A policy decides what opening a document (document.open, File › Revert) does with an RGB or CMYK profile it is tagged with that is not the working space: preserveEmbedded (default) keeps it; off and preserveNumbers take it off and keep the color numbers; convert converts the colors of that model into the working space with the intent and takes it off. The open reply's warnings name each profile taken off or converted, and a document a policy changed opens with unsaved changes. The desktop app and vectorcraft-cli keep them in `Color Settings.json` next to the preferences and use them again at the next start (not with VECTORCRAFT_NO_PREFS); saved settings naming a profile that is gone leave the defaults",
"{rgb?: profile, cmyk?: profile, intent?: \"perceptual\"|\"relative\"|\"saturation\"|\"absolute\", bpc?: bool, rgbPolicy?: \"off\"|\"preserveEmbedded\"|\"convert\", cmykPolicy?: \"off\"|\"preserveEmbedded\"|\"convert\"|\"preserveNumbers\", askMismatchOpen?: bool, askMismatchPaste?: bool, askMissingOpen?: bool (all false by default)} set the working spaces, the color management policies and the Ask boxes → {rgb, cmyk, intent, bpc, rgbPolicy, cmykPolicy, askMismatchOpen, askMismatchPaste, askMissingOpen, profiles: [{name, kind, builtin}]}. With askMismatchOpen or askMissingOpen on, the desktop app's File › Open asks what to do when the profile of a document's color mode is not the working space, or it has none (document.open takes the answer as profileChoice; it never asks); with askMismatchPaste on, Paste asks whether colors copied from a document with another profile keep their numbers or convert (edit.paste takes it as profileMismatch; see clipboard.profileMismatch). A policy decides what opening a document (document.open, File › Revert) does with an RGB or CMYK profile it is tagged with that is not the working space: preserveEmbedded (default) keeps it; off and preserveNumbers take it off and keep the color numbers; convert converts the colors of that model into the working space with the intent and takes it off. The open reply's warnings name each profile taken off or converted, and a document a policy changed opens with unsaved changes. The desktop app and vectorcraft-cli keep them in `Color Settings.json` next to the preferences and use them again at the next start (not with VECTORCRAFT_NO_PREFS); saved settings naming a profile that is gone leave the defaults",
always,
color_settings
),
@@ -183,6 +183,9 @@ fn settings_json(st: &ColorSettings) -> Value {
"bpc": st.bpc,
"rgbPolicy": st.rgb_policy.id(),
"cmykPolicy": st.cmyk_policy.id(),
"askMismatchOpen": st.ask_mismatch_open,
"askMismatchPaste": st.ask_mismatch_paste,
"askMissingOpen": st.ask_missing_open,
"profiles": cms::profiles().iter().map(|p| json!({"name": p.name, "kind": p.kind, "builtin": p.builtin})).collect::<Vec<_>>(),
})
}
@@ -225,6 +228,9 @@ fn color_settings(s: &mut Session, p: &Value) -> Result<Value> {
if let Some(v) = policy_param(p, "cmykPolicy", &Policy::CMYK, C)? {
st.cmyk_policy = v;
}
st.ask_mismatch_open = switch_or(p, "askMismatchOpen", st.ask_mismatch_open, C)?;
st.ask_mismatch_paste = switch_or(p, "askMismatchPaste", st.ask_mismatch_paste, C)?;
st.ask_missing_open = switch_or(p, "askMissingOpen", st.ask_missing_open, C)?;
if st != before {
cms::set_active(&st).map_err(|e| bad(C, e.to_string()))?;
// Saved for the next start when the app attached a settings file (#6335).
@@ -659,39 +665,258 @@ fn convert_colors(d: &mut vectorcraft_doc::Document, conv: &dyn Fn(&Color) -> Co
/// by Off and Preserve Numbers and kept by Convert to Working Space, which has nothing to convert
/// from. → a note for each profile, and whether `d` changed.
pub(crate) fn apply_open_policies(d: &mut vectorcraft_doc::Document) -> (Vec<String>, bool) {
// Without a choice nothing can fail.
apply_open_policies_choosing(d, None).unwrap_or_default()
}
/// What opening a document can ask about its profile (Edit › Color Settings' Ask When Opening
/// boxes): the profile of its color mode differs from the working space, or it has none.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ProfileIssue {
/// Profile Mismatches: tagged with a profile other than the working space.
Mismatch,
/// Missing Profiles: not tagged with a profile.
Missing,
}
impl ProfileIssue {
pub fn id(self) -> &'static str {
match self {
ProfileIssue::Mismatch => "mismatch",
ProfileIssue::Missing => "missing",
}
}
}
/// The answer to a [`ProfileQuestion`] (`document.open`'s `profileChoice`).
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ProfileChoice {
/// Mismatch: keep the profile (as Preserve Embedded Profiles).
UseEmbedded,
/// Mismatch: convert the colors of that model into the working space and take the profile off
/// (as Convert to Working Space).
Convert,
/// Mismatch: take the profile off and keep the color numbers (as Off).
Discard,
/// Missing: leave the document untagged (it follows the working space).
Leave,
/// Missing: tag the document with the working space of its color mode.
AssignWorking,
/// Missing: tag the document with this profile.
Assign(String),
}
impl ProfileChoice {
/// The ids `profileChoice` takes.
pub const IDS: [&'static str; 6] = ["useEmbedded", "convert", "discard", "leave", "assignWorking", "assign"];
pub fn id(&self) -> &'static str {
match self {
ProfileChoice::UseEmbedded => "useEmbedded",
ProfileChoice::Convert => "convert",
ProfileChoice::Discard => "discard",
ProfileChoice::Leave => "leave",
ProfileChoice::AssignWorking => "assignWorking",
ProfileChoice::Assign(_) => "assign",
}
}
/// The question kind this choice answers.
pub fn issue(&self) -> ProfileIssue {
match self {
ProfileChoice::UseEmbedded | ProfileChoice::Convert | ProfileChoice::Discard => ProfileIssue::Mismatch,
_ => ProfileIssue::Missing,
}
}
/// The choice `id` (`profile`, which only `assign` takes, for `assign`), or an error naming
/// `cmd`.
pub fn parse(id: &str, profile: Option<&str>, cmd: &str) -> Result<Self> {
let key = "profileChoice";
let choice = match id {
"useEmbedded" => ProfileChoice::UseEmbedded,
"convert" => ProfileChoice::Convert,
"discard" => ProfileChoice::Discard,
"leave" => ProfileChoice::Leave,
"assignWorking" => ProfileChoice::AssignWorking,
"assign" => match profile.filter(|p| !p.is_empty()) {
Some(p) => ProfileChoice::Assign(cms::canonical_name(p).to_string()),
None => {
let path = "assignProfile";
return Err(bad(cmd, format!("missing `{path}`")));
}
},
_ => return Err(bad(cmd, format!("`{key}` must be one of {}", Self::IDS.join(", ")))),
};
// `assignProfile` goes with `assign` only.
if profile.is_some() && !matches!(choice, ProfileChoice::Assign(_)) {
return Err(bad(cmd, format!("`{key}` must be one of {}", "assign")));
}
Ok(choice)
}
/// `document.open`'s `profileChoice` and `assignProfile` in `p` (`None` when left out).
pub(crate) fn param(p: &Value, cmd: &str) -> Result<Option<Self>> {
let profile = text_param(p, "assignProfile", cmd)?;
match text_param(p, "profileChoice", cmd)? {
Some(id) => Self::parse(id, profile, cmd).map(Some),
None if profile.is_some() => {
let path = "profileChoice";
Err(bad(cmd, format!("missing `{path}`")))
}
None => Ok(None),
}
}
}
/// What opening document `d` could ask about the profile of its color mode, with the working
/// settings `st`: none when it is tagged with the working space.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ProfileQuestion {
pub issue: ProfileIssue,
/// The model of the document's color mode.
pub model: ColorMode,
/// The profile the document is tagged with (none when it is missing).
pub profile: Option<String>,
/// The working space of that model.
pub working: String,
/// What the policy of that model does, the choice the prompt starts on.
pub default: ProfileChoice,
}
impl ProfileQuestion {
/// The question for document `d` under the working settings `st` (whether or not they ask it).
pub fn of(d: &vectorcraft_doc::Document, st: &ColorSettings) -> Option<Self> {
let (rgb, cmyk) = doc_profiles(d);
let (tag, working, policy) = match d.color_mode {
ColorMode::Rgb => (rgb, cms::canonical_name(&st.rgb).to_string(), st.rgb_policy),
ColorMode::Cmyk => (cmyk, cms::canonical_name(&st.cmyk).to_string(), st.cmyk_policy),
};
let (issue, default) = match &tag {
Some(t) if *t == working => return None,
Some(_) => (
ProfileIssue::Mismatch,
match policy {
Policy::PreserveEmbedded => ProfileChoice::UseEmbedded,
Policy::Convert => ProfileChoice::Convert,
Policy::Off | Policy::PreserveNumbers => ProfileChoice::Discard,
},
),
// VectorCraft's own rule: Convert to Working Space starts on assigning the working
// space, the other policies on leaving the document as it is.
None => (ProfileIssue::Missing, if policy == Policy::Convert { ProfileChoice::AssignWorking } else { ProfileChoice::Leave }),
};
Some(Self { issue, model: d.color_mode, profile: tag, working, default })
}
/// Do the settings `st` ask it (the Ask When Opening box of its kind is on)?
pub fn asked(&self, st: &ColorSettings) -> bool {
match self.issue {
ProfileIssue::Mismatch => st.ask_mismatch_open,
ProfileIssue::Missing => st.ask_missing_open,
}
}
/// The model's name as the UI shows it ("RGB", "CMYK").
pub fn model_label(&self) -> &'static str {
match self.model {
ColorMode::Rgb => "RGB",
ColorMode::Cmyk => "CMYK",
}
}
pub fn to_json(&self) -> Value {
json!({
"issue": self.issue.id(),
"model": self.model_label().to_ascii_lowercase(),
"profile": self.profile,
"working": self.working,
"default": self.default.id(),
})
}
}
/// [`apply_open_policies`] with the answer `choice` to the document's [`ProfileQuestion`]: a
/// mismatch choice takes the place of the policy of the document's color mode, and a missing
/// choice tags the document after the policies ran. A choice for the other kind of question, or
/// for a document with none, is not used. → as [`apply_open_policies`]; an error when the profile
/// to assign is not a profile of that model.
pub(crate) fn apply_open_policies_choosing(d: &mut vectorcraft_doc::Document, choice: Option<&ProfileChoice>) -> Result<(Vec<String>, bool)> {
let working = cms::working_settings();
let question = ProfileQuestion::of(d, &working);
let choice = choice.filter(|c| question.as_ref().is_some_and(|q| q.issue == c.issue()));
// A mismatch answer stands in for the policy of the document's color mode.
let chosen = |model: ColorMode, policy: Policy| -> (Policy, bool) {
match choice {
Some(c) if d.color_mode == model => match c {
ProfileChoice::UseEmbedded => (Policy::PreserveEmbedded, true),
ProfileChoice::Convert => (Policy::Convert, true),
ProfileChoice::Discard => (Policy::Off, true),
_ => (policy, false),
},
_ => (policy, false),
}
};
let (rgb_policy, rgb_chosen) = chosen(ColorMode::Rgb, working.rgb_policy);
let (cmyk_policy, cmyk_chosen) = chosen(ColorMode::Cmyk, working.cmyk_policy);
// The profile a missing answer assigns, checked before anything changes.
let assign = match (choice, &question) {
(Some(ProfileChoice::AssignWorking), Some(q)) => Some(q.working.clone()),
(Some(ProfileChoice::Assign(name)), Some(q)) => {
let kind = if q.model == ColorMode::Rgb { cms::ProfileKind::Rgb } else { cms::ProfileKind::Cmyk };
let (key, n) = (q.model_label().to_ascii_lowercase(), name);
let info = cms::profile(name).filter(|p| p.kind == kind).ok_or_else(|| bad("document.open", format!("unknown {key} profile `{n}`")))?;
Some(info.name)
}
_ => None,
};
let (rgb, cmyk) = doc_profiles(d);
let mut notes = Vec::new();
// What each model's policy does with its profile: `None` keeps it; `Some` takes it off, after
// converting the colors from the profile it holds.
let mut decide = |label: &str, tag: Option<String>, working: &str, policy: Policy, kind: cms::ProfileKind| -> Option<Option<String>> {
let tag = tag.filter(|t| t != working)?;
let available = cms::profile(&tag).is_some_and(|p| p.kind == kind);
match policy {
Policy::PreserveEmbedded => None,
Policy::Off | Policy::PreserveNumbers => {
notes.push(format!(
"the {label} profile “{tag}” the file is tagged with was not used: Color Settings' {label} policy is {}",
policy.label()
));
Some(None)
}
Policy::Convert if available => {
notes.push(format!(
"the {label} colors were converted from the profile “{tag}” the file is tagged with into the working space “{working}”"
));
Some(Some(tag))
}
Policy::Convert => {
notes.push(format!("the {label} profile “{tag}” the file is tagged with is not available, so its colors were not converted"));
None
// converting the colors from the profile it holds. `by_choice`: the prompt's answer decided.
let mut decide =
|label: &str, tag: Option<String>, working: &str, policy: Policy, by_choice: bool, kind: cms::ProfileKind| -> Option<Option<String>> {
let tag = tag.filter(|t| t != working)?;
let available = cms::profile(&tag).is_some_and(|p| p.kind == kind);
match policy {
Policy::PreserveEmbedded => None,
Policy::Off | Policy::PreserveNumbers if by_choice => {
notes.push(format!("the {label} profile “{tag}” the file is tagged with was discarded, as chosen when it was opened"));
Some(None)
}
Policy::Off | Policy::PreserveNumbers => {
notes.push(format!(
"the {label} profile “{tag}” the file is tagged with was not used: Color Settings' {label} policy is {}",
policy.label()
));
Some(None)
}
Policy::Convert if available => {
notes.push(format!(
"the {label} colors were converted from the profile “{tag}” the file is tagged with into the working space “{working}”"
));
Some(Some(tag))
}
Policy::Convert => {
notes.push(format!("the {label} profile “{tag}” the file is tagged with is not available, so its colors were not converted"));
None
}
}
};
let rgb_do = decide("RGB", rgb, &working.rgb, rgb_policy, rgb_chosen, cms::ProfileKind::Rgb);
let cmyk_do = decide("CMYK", cmyk, &working.cmyk, cmyk_policy, cmyk_chosen, cms::ProfileKind::Cmyk);
let mut changed = false;
if let (Some(name), Some(q)) = (assign, &question) {
let label = q.model_label();
notes.push(format!("the document was assigned the {label} profile “{name}”, as chosen when it was opened"));
match q.model {
ColorMode::Rgb => d.color_profiles.rgb = Some(name),
ColorMode::Cmyk => d.color_profiles.cmyk = Some(name),
}
};
let rgb_do = decide("RGB", rgb, &working.rgb, working.rgb_policy, cms::ProfileKind::Rgb);
let cmyk_do = decide("CMYK", cmyk, &working.cmyk, working.cmyk_policy, cms::ProfileKind::Cmyk);
changed = true;
}
if rgb_do.is_none() && cmyk_do.is_none() {
return (notes, false);
return Ok((notes, changed));
}
let (from_rgb, from_cmyk) = (rgb_do.clone().flatten(), cmyk_do.clone().flatten());
if from_rgb.is_some() || from_cmyk.is_some() {
@@ -713,7 +938,162 @@ pub(crate) fn apply_open_policies(d: &mut vectorcraft_doc::Document) -> (Vec<Str
if cmyk_do.is_some() {
d.color_profiles.cmyk = None;
}
(notes, true)
Ok((notes, true))
}
/// The colors of `d`'s art and resources ([`convert_colors`]) and of its character and paragraph
/// styles, converted with `conv`; not its artboards' backgrounds or Document Setup's colors.
pub(crate) fn convert_art_and_style_colors(d: &mut vectorcraft_doc::Document, conv: &dyn Fn(&Color) -> Color) {
convert_colors(d, conv);
convert_style_colors(d, conv);
}
/// The RGB and CMYK profiles the colors of `d` show through, by name: those it is assigned, else
/// the working spaces.
pub(crate) fn effective_profiles(d: &vectorcraft_doc::Document) -> [String; 2] {
let working = cms::working_settings();
let (rgb, cmyk) = doc_profiles(d);
[rgb.unwrap_or_else(|| cms::canonical_name(&working.rgb).to_string()), cmyk.unwrap_or_else(|| cms::canonical_name(&working.cmyk).to_string())]
}
/// What Paste does with the colors of a model when the document they were copied from showed them
/// through another profile than the document they go into (`profileMismatch`).
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PasteProfile {
/// The colors keep their numbers.
PreserveNumbers,
/// The colors convert from the source profile into the destination's, which keeps their
/// appearance.
Convert,
}
impl PasteProfile {
pub fn id(self) -> &'static str {
match self {
PasteProfile::PreserveNumbers => "preserveNumbers",
PasteProfile::Convert => "convert",
}
}
/// What a model's policy does to pasted colors (VectorCraft's own mapping): Convert to Working
/// Space converts them, the other policies keep their numbers.
pub fn of(policy: Policy) -> Self {
if policy == Policy::Convert { PasteProfile::Convert } else { PasteProfile::PreserveNumbers }
}
/// The `profileMismatch` param of paste command `cmd` (`None` when left out).
pub(crate) fn param(p: &Value, cmd: &str) -> Result<Option<Self>> {
match text_param(p, "profileMismatch", cmd)? {
None => Ok(None),
Some("preserveNumbers") => Ok(Some(PasteProfile::PreserveNumbers)),
Some("convert") => Ok(Some(PasteProfile::Convert)),
Some(_) => {
let key = "profileMismatch";
Err(bad(cmd, format!("`{key}` must be one of {}", "preserveNumbers, convert")))
}
}
}
}
/// A model whose colors a paste brings from another profile than the destination's.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PasteMismatch {
pub model: ColorMode,
/// The profile the colors showed through where they were copied.
pub from: String,
/// The profile they show through in the document they go into.
pub to: String,
/// What the model's policy does with them.
pub default: PasteProfile,
}
impl PasteMismatch {
pub fn to_json(&self) -> Value {
let model = if self.model == ColorMode::Rgb { "rgb" } else { "cmyk" };
json!({ "model": model, "clipboard": self.from, "document": self.to, "default": self.default.id() })
}
}
/// The models whose colors pasting `clip` into `d` brings from another profile: RGB, CMYK or both,
/// each only when the copied objects or the resources they carry hold a color of that model.
pub(crate) fn paste_mismatches(clip: &super::clipboard::Clipboard, d: &vectorcraft_doc::Document) -> Vec<PasteMismatch> {
let Some([from_rgb, from_cmyk]) = &clip.source_profiles else { return vec![] };
let [to_rgb, to_cmyk] = effective_profiles(d);
let working = cms::working_settings();
let mut out: Vec<PasteMismatch> =
[(ColorMode::Rgb, from_rgb, to_rgb, working.rgb_policy), (ColorMode::Cmyk, from_cmyk, to_cmyk, working.cmyk_policy)]
.into_iter()
.filter(|(_, from, to, _)| cms::canonical_name(from) != cms::canonical_name(to))
.map(|(model, from, to, policy)| PasteMismatch { model, from: from.clone(), to, default: PasteProfile::of(policy) })
.collect();
if out.is_empty() {
return out;
}
// Which models the pasted colors use.
let seen = std::cell::Cell::new((false, false));
let _ = clip.with_colors(&|c: &Color| {
let (rgb, cmyk) = seen.get();
seen.set((rgb || matches!(c, Color::Rgb { .. }), cmyk || matches!(c, Color::Cmyk { .. })));
*c
});
let (rgb, cmyk) = seen.get();
out.retain(|m| if m.model == ColorMode::Rgb { rgb } else { cmyk });
out
}
/// The clipboard `clip` as pasting it into `d` brings it: for each mismatched model
/// ([`paste_mismatches`]), its colors keep their numbers or convert from the source profile into
/// the destination's with the working intent, as `choice` says (default: each model's policy,
/// [`PasteProfile::of`]). A source or destination profile that is not available keeps the numbers.
/// → the
/// converted clipboard (`None` when nothing converts; its resources paste as another document's)
/// and a
/// line for each mismatched model
/// (`{model, clipboard, document, choice}`).
pub(crate) fn paste_profiles(
clip: &super::clipboard::Clipboard,
d: &vectorcraft_doc::Document,
choice: Option<PasteProfile>,
) -> (Option<super::clipboard::Clipboard>, Vec<Value>) {
let mismatches = paste_mismatches(clip, d);
let mut report = Vec::new();
let (mut rgb_on, mut cmyk_on) = (false, false);
for m in &mismatches {
let kind = if m.model == ColorMode::Rgb { cms::ProfileKind::Rgb } else { cms::ProfileKind::Cmyk };
// Both profiles must be here to convert between them.
let here = |name: &str| cms::profile(name).is_some_and(|p| p.kind == kind);
let available = here(&m.from) && here(&m.to);
let picked = if available { choice.unwrap_or(m.default) } else { PasteProfile::PreserveNumbers };
if picked == PasteProfile::Convert {
match m.model {
ColorMode::Rgb => rgb_on = true,
ColorMode::Cmyk => cmyk_on = true,
}
}
let mut line = m.to_json();
if let Some(o) = line.as_object_mut() {
o.remove("default");
o.insert("choice".into(), json!(picked.id()));
}
report.push(line);
}
if !rgb_on && !cmyk_on {
return (None, report);
}
let Some([from_rgb, from_cmyk]) = &clip.source_profiles else { return (None, report) };
let source = cms::for_document(Some(from_rgb), Some(from_cmyk));
let dest = doc_cms(d);
let intent = cms::working_settings().intent;
let conv = |c: &Color| match c {
Color::Rgb { .. } if rgb_on => source.convert_into(&dest, c, intent),
Color::Cmyk { .. } if cmyk_on => source.convert_into(&dest, c, intent),
_ => *c,
};
let mut converted = clip.with_colors(&conv);
// Converted colors are not the source document's own: its resources of the same names are
// compared with them, as another document's are.
converted.colors_converted = true;
(Some(converted), report)
}
/// The colors of `d` outside its art that [`convert_colors`] leaves, converted with `conv`: each
@@ -726,6 +1106,11 @@ fn convert_setting_colors(d: &mut vectorcraft_doc::Document, conv: &dyn Fn(&Colo
for c in &mut d.setup.grid_colors {
*c = conv(c);
}
convert_style_colors(d, conv);
}
/// The fill and stroke colors of `d`'s character and paragraph styles, converted with `conv`.
fn convert_style_colors(d: &mut vectorcraft_doc::Document, conv: &dyn Fn(&Color) -> Color) {
// A tint of a global swatch is the converted swatch's color at its tint, which
// [`convert_colors`] already gave it.
let bases = global_bases(d);
+24 -9
View File
@@ -114,7 +114,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Drop Artwork",
[],
None,
"{sourceDocument: uid, ids: [id…], grab: [x,y], at: [x,y]} copy 1–10000 editable source objects from an open document to the active document, preserving the grab point and clipboard, as one undo step",
"{sourceDocument: uid, ids: [id…], grab: [x,y], at: [x,y]} copy 1–10000 editable source objects from an open document to the active document, preserving the grab point and clipboard, as one undo step; colors from a document with another RGB or CMYK profile keep their numbers or convert as edit.colorSettings' policy of their model says (as edit.paste without profileMismatch)",
has_doc,
drop_selection
),
@@ -179,7 +179,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Paste",
["Edit"],
Some("Cmd+V"),
"{center?: [x, y], artboardsAt?: [x, y], dx?, dy?, swatchConflict?} paste centred on `center` (the app passes the view centre), else offset by dx/dy (default: the Paste Offset preference). Pasting brings the image blobs, symbols, patterns, global and spot swatches (with the tint swatches of the tints used), gradient swatches, graphic styles, character and paragraph styles and brushes the objects use; one of the same name that differs comes in renamed. swatchConflict, for a swatch whose name the document gives another colour (clipboard.conflicts): \"merge\" (default: the objects take the document's swatch) | \"add\" (the pasted swatch comes in renamed) | {name: \"merge\"|\"add\"}. With Paste Remembers Layers on (layer.pasteRemembersLayers), objects go back into the layers and sublayers they came from (by the names of the layer and the layers around it in another document; a missing sublayer is made inside its layer; a hidden or locked one is an error and nothing is pasted). Artboards copied with artboard.copy come with their art, together right of the last artboard as they lay, or centered on `artboardsAt` (the Artboard tool's canvas menu passes the right-click point; a value that is not [x, y] is an error) (the other paste commands but Paste on All Artboards: where they were), their art back in the layers it came from, and the Artboard tool, when chosen, selects them. In Draw Inside (view.drawMode) the objects go inside the object drawn into, as new art does, and Paste Remembers Layers doesn't apply; edit.pasteInPlace and edit.pasteOnAllArtboards do the same, and in Draw Behind they go behind the selection as edit.pasteInBack puts them; edit.pasteInFront and edit.pasteInBack ignore the drawing mode → {ids, artboard: the first new artboard's index or null, artboards: the new artboards' indices, added: resources added, merged: conflicts merged, renamed: [{kind, from, to}]}",
"{center?: [x, y], artboardsAt?: [x, y], dx?, dy?, swatchConflict?, profileMismatch?: \"preserveNumbers\"|\"convert\"} paste centred on `center` (the app passes the view centre), else offset by dx/dy (default: the Paste Offset preference). Pasting brings the image blobs, symbols, patterns, global and spot swatches (with the tint swatches of the tints used), gradient swatches, graphic styles, character and paragraph styles and brushes the objects use; one of the same name that differs comes in renamed. swatchConflict, for a swatch whose name the document gives another colour (clipboard.conflicts): \"merge\" (default: the objects take the document's swatch) | \"add\" (the pasted swatch comes in renamed) | {name: \"merge\"|\"add\"}. profileMismatch, for colors copied from a document whose RGB or CMYK profile is not this document's (clipboard.profileMismatch): \"preserveNumbers\" keeps their numbers, \"convert\" converts them into this document's profile with the working intent (default: as the model's policy of edit.colorSettings says; every paste command takes it, and the reply's profileMismatch lists [{model, clipboard, document, choice}]). With Paste Remembers Layers on (layer.pasteRemembersLayers), objects go back into the layers and sublayers they came from (by the names of the layer and the layers around it in another document; a missing sublayer is made inside its layer; a hidden or locked one is an error and nothing is pasted). Artboards copied with artboard.copy come with their art, together right of the last artboard as they lay, or centered on `artboardsAt` (the Artboard tool's canvas menu passes the right-click point; a value that is not [x, y] is an error) (the other paste commands but Paste on All Artboards: where they were), their art back in the layers it came from, and the Artboard tool, when chosen, selects them. In Draw Inside (view.drawMode) the objects go inside the object drawn into, as new art does, and Paste Remembers Layers doesn't apply; edit.pasteInPlace and edit.pasteOnAllArtboards do the same, and in Draw Behind they go behind the selection as edit.pasteInBack puts them; edit.pasteInFront and edit.pasteInBack ignore the drawing mode → {ids, artboard: the first new artboard's index or null, artboards: the new artboards' indices, added: resources added, merged: conflicts merged, renamed: [{kind, from, to}]}",
has_clipboard,
|s, p| paste(s, p, PasteMode::Offset)
),
@@ -188,7 +188,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Paste in Front",
["Edit"],
Some("Cmd+F"),
"{swatchConflict?, artboard?: index (the active artboard: the objects go where they were on the artboard they were copied from, on this one), artboards?: [index…] (a copy on each of these artboards, placed as on `artboard`, the copies in artboard order; `artboard` wins when both are given; default while the Artboard tool is chosen with several artboards selected: those; art copied from no artboard keeps its place on the first and its offset to it on the others; an index the document lacks, a repeated one or an empty list is an error)} paste in place just above the top selected object, or on top of the current layer when nothing is selected (resources and layers as edit.paste) → {ids, added, merged, renamed}",
"{swatchConflict?, profileMismatch? (as edit.paste), artboard?: index (the active artboard: the objects go where they were on the artboard they were copied from, on this one), artboards?: [index…] (a copy on each of these artboards, placed as on `artboard`, the copies in artboard order; `artboard` wins when both are given; default while the Artboard tool is chosen with several artboards selected: those; art copied from no artboard keeps its place on the first and its offset to it on the others; an index the document lacks, a repeated one or an empty list is an error)} paste in place just above the top selected object, or on top of the current layer when nothing is selected (resources and layers as edit.paste) → {ids, added, merged, renamed}",
has_clipboard,
|s, p| paste(s, p, PasteMode::Front)
),
@@ -197,7 +197,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Paste in Back",
["Edit"],
Some("Cmd+B"),
"{swatchConflict?, artboard?: index, artboards?: [index…] (both as edit.pasteInFront)} paste in place just below the bottom selected object, or at the bottom of the current layer when nothing is selected (resources and layers as edit.paste) → {ids, added, merged, renamed}",
"{swatchConflict?, profileMismatch?, artboard?: index, artboards?: [index…] (as edit.pasteInFront)} paste in place just below the bottom selected object, or at the bottom of the current layer when nothing is selected (resources and layers as edit.paste) → {ids, added, merged, renamed}",
has_clipboard,
|s, p| paste(s, p, PasteMode::Back)
),
@@ -206,7 +206,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Paste in Place",
["Edit"],
Some("Cmd+Shift+V"),
"{swatchConflict?, artboard?: index, artboards?: [index…] (both as edit.pasteInFront)} paste where the objects were copied (resources, layers and drawing modes as edit.paste) → {ids, added, merged, renamed}",
"{swatchConflict?, profileMismatch?, artboard?: index, artboards?: [index…] (as edit.pasteInFront)} paste where the objects were copied (resources, layers and drawing modes as edit.paste) → {ids, added, merged, renamed}",
has_clipboard,
|s, p| paste(s, p, PasteMode::InPlace)
),
@@ -215,7 +215,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Paste on All Artboards",
["Edit"],
Some("Cmd+Alt+Shift+V"),
"{swatchConflict?} paste a copy on every artboard at the offset the objects had to the artboard they were copied from (resources, layers and drawing modes as edit.paste) → {ids, added, merged, renamed}",
"{swatchConflict?, profileMismatch? (as edit.paste)} paste a copy on every artboard at the offset the objects had to the artboard they were copied from (resources, layers and drawing modes as edit.paste) → {ids, added, merged, renamed}",
has_clipboard,
|s, p| paste(s, p, PasteMode::AllArtboards)
),
@@ -1223,7 +1223,9 @@ fn drop_selection(s: &mut Session, p: &Value) -> Result<Value> {
}
// A drop preserves the source colours even when the flyer has same-named swatches.
let choices = SwatchChoices::parse(PasteMode::Drag.label(), &json!({"swatchConflict": "add"}))?;
paste_clip(s, &json!({"center": [center.x, center.y]}), PasteMode::Drag, &clip, &choices)
// Colors from another profile keep their numbers or convert as the policies say.
let (converted, _) = super::colormgmt::paste_profiles(&clip, &s.doc()?.doc, None);
paste_clip(s, &json!({"center": [center.x, center.y]}), PasteMode::Drag, converted.as_ref().unwrap_or(&clip), &choices)
}
#[derive(Clone, Copy, PartialEq, Eq)]
@@ -1258,10 +1260,22 @@ fn paste(s: &mut Session, p: &Value, mode: PasteMode) -> Result<Value> {
if mode == PasteMode::Offset {
check_numbers(p, &["dx", "dy"], "edit.paste")?;
}
let profile = super::colormgmt::PasteProfile::param(p, mode.label())?;
// Taken out of the session for the edit (and put back whatever happens).
let clip = std::mem::take(&mut s.clipboard);
let r = paste_clip(s, p, mode, &clip, &choices);
// Colors copied from a document with other profiles keep their numbers or convert
// (Edit › Color Settings' policies, or `profileMismatch`).
let (converted, report) = match s.doc() {
Ok(st) => super::colormgmt::paste_profiles(&clip, &st.doc, profile),
Err(_) => (None, vec![]),
};
let mut r = paste_clip(s, p, mode, converted.as_ref().unwrap_or(&clip), &choices);
s.clipboard = clip;
if let Ok(v) = &mut r
&& !report.is_empty()
{
v["profileMismatch"] = json!(report);
}
r
}
@@ -1438,7 +1452,8 @@ fn paste_clip(s: &mut Session, p: &Value, mode: PasteMode, clip: &Clipboard, cho
vec![Affine::IDENTITY]
};
let (ids, imported, artboards, into) = s.edit(mode.label(), |d, sel| {
let imported = clip.import_into(d, choices, same_doc)?;
// Converted colors are compared with the document's resources, as another document's are.
let imported = clip.import_into(d, choices, same_doc && !clip.colors_converted)?;
// Draw Inside: the clip group of the object drawn into, made on the first paste.
let into = inside.map(|t| super::create::draw_inside_group(d, t)).transpose()?;
let artboards: Vec<usize> = boards
+1 -1
View File
@@ -82,7 +82,7 @@ pub(crate) use load::page_or_editing_data;
pub(crate) use load::source;
pub use load::{
Loaded, RasterImage, ReadFile, detect, file_name, load, load_with, open_bytes, open_bytes_with, open_read, open_template, raster_image,
read_for_open, texture_image,
read_for_open, read_for_open_asking, texture_image,
};
pub(crate) use load::{check_files_not_lossy_overwrite, check_not_lossy_overwrite, lossy_source};
pub use load::{losses_summary, overwrite_losses};
+1 -1
View File
@@ -9,7 +9,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Open Document",
[],
None,
"{path | name | dataBase64 (a file's path, or its name with its bytes), pages?: \"2-3, 5\" (PDF/.ai: 1-based, default all; one artboard each) | page?: n, cropTo?: bounding|art|crop (default)|trim|bleed|media (the box each artboard gets; bounding: the art's bounds; trim: the bleed box round it becomes the document's bleed; a PDF-compatible .ai or a PDF saved with its editing data opens on its trim boxes for crop), password? (encrypted PDFs; see document.pdfInfo), textAs?: text (default: point type per line, lines wrapped in a frame as area type where they lay out the same, in the file's fonts by name; missing ones are listed in warnings) | outlines (glyph paths), layers?: true (default: optional content groups become layers with their visibility, print state and lock — art that is off comes in as a hidden layer; other art goes to a layer per page; a PSD file's layers become layers holding their pixels, with their names, visibility, opacity and blend modes, groups as layers of sublayers, layer masks as opacity masks, clipped layers and layers in blend modes VectorCraft doesn't have merged with the layers below) | false (one layer per page, without the art that is off; Save then asks for a name; a PSD file opens as its merged image), hiddenLayers?: false (a PSD file's hidden layers come in hidden instead of being left out), editingData?: true (default: an EPS, .ai or PDF that carries its editor's own copy of the art opens from it, with its layers, hidden objects, guides, artboards and the art outside them; a .ai or PDF whose type shows opens from its PDF part with textAs: outlines) | \"always\" (as true, and a .ai's editing copy is used even where it draws differently from its PDF part, which can be older; the warnings say so) | false (only what its page or PDF part prints, for print pipelines; a .ai saved without PDF compatibility then can't be opened), legacyNameEncoding?: windows-1252 (default) | macintosh | windows-949 (also euc-kr) | shift_jis | gbk | big5 (the code page names in the editing data of a .ai or an EPS are read in when they aren't UTF-8: layers, objects, artboards, colors, gradients, patterns, graphic styles, swatches, brushes, symbols, variables and data sets, and data sets' text values; warnings list the first three such names as read, and count the rest), colorMode?: rgb|cmyk (the mode the document opens in, its colours converted as file.documentColorMode does, grays? as there; default: the file's — a PDF keeps CMYK, Gray and spot inks (spot swatches at a tint) and opens in CMYK when painted mostly in CMYK), grays?: as file.documentColorMode, dxf?: {layout?: \"Model\" (default) | a paper layout's name (document.dxfInfo lists them), unit?, scale? (the ratio: 1 unit of the art = scale drawing units; default: the drawing at 1:1 in its own unit), fit?: false (scale to fit an artboard of fitTo?: [612, 792], turned to the art's orientation), scaleLineweights?: false (lineweights scale with the art), center?: true (false: the drawing's origin on the artboard's bottom-left corner; fitted art's bottom-left corner), mergeLayers?: false (all art on one layer)} (DXF), crop?: as cropTo (its older name), linkPages?: false (true: each page `pages` picks of a PDF or PDF-compatible .ai opens as a placed document linked to that page of the file, as file.place with link places one, on an artboard of its cropTo box (bounding: its art's bounds), in a row, and a layer named after the page; links.embed makes a page editable art; refused for any other file, without a path, with a password or with textAs: outlines; Save then asks for a name), importer?: \"plugin.<id>\" (an importer plug-in's format id, see document.formats: it opens the file, which must have an extension it lists, also one a built-in format reads), params?: {…} (the importer's own parameters, see plugin.info)} → {index, title, format, warnings, restored, missingLinks, modifiedLinks, updatedLinks: [{name, path, ids}]}; any readable format (see document.formats): .vectorcraft/.drawcraft, .svg/.svgz, .pdf/.ai, .ait, ASCII .dxf (each DXF layer with art a layer; blocks symbols; what can't come in is listed in warnings), PNG/JPEG/GIF/WebP/TIFF/BMP (an image opens as a document of its size at the resolution it declares, as file.place sizes it; 72 ppi, 1 px = 1 pt, when it declares none), .emf/.wmf (one artboard, the picture's frame; records VectorCraft doesn't read are skipped with one warning), PICT .pct/.pic/.pict (QuickDraw versions 1 and 2, with or without the file's 512-byte header: one artboard, the picture's frame; shapes, lines and regions as paths, text as point type, bitmaps, pixel maps and QuickTime JPEG images as images; what isn't read is listed in warnings), HP-GL plot files .plt/.hpgl/.hgl/.hpg (one artboard round the art; what isn't drawn is listed in warnings), .eps and PostScript .ai (one artboard, the bounding box: an EPS file VectorCraft wrote restores the document it carries, restored: true; other files are read Line truncated
"{path | name | dataBase64 (a file's path, or its name with its bytes), pages?: \"2-3, 5\" (PDF/.ai: 1-based, default all; one artboard each) | page?: n, cropTo?: bounding|art|crop (default)|trim|bleed|media (the box each artboard gets; bounding: the art's bounds; trim: the bleed box round it becomes the document's bleed; a PDF-compatible .ai or a PDF saved with its editing data opens on its trim boxes for crop), password? (encrypted PDFs; see document.pdfInfo), textAs?: text (default: point type per line, lines wrapped in a frame as area type where they lay out the same, in the file's fonts by name; missing ones are listed in warnings) | outlines (glyph paths), layers?: true (default: optional content groups become layers with their visibility, print state and lock — art that is off comes in as a hidden layer; other art goes to a layer per page; a PSD file's layers become layers holding their pixels, with their names, visibility, opacity and blend modes, groups as layers of sublayers, layer masks as opacity masks, clipped layers and layers in blend modes VectorCraft doesn't have merged with the layers below) | false (one layer per page, without the art that is off; Save then asks for a name; a PSD file opens as its merged image), hiddenLayers?: false (a PSD file's hidden layers come in hidden instead of being left out), editingData?: true (default: an EPS, .ai or PDF that carries its editor's own copy of the art opens from it, with its layers, hidden objects, guides, artboards and the art outside them; a .ai or PDF whose type shows opens from its PDF part with textAs: outlines) | \"always\" (as true, and a .ai's editing copy is used even where it draws differently from its PDF part, which can be older; the warnings say so) | false (only what its page or PDF part prints, for print pipelines; a .ai saved without PDF compatibility then can't be opened), legacyNameEncoding?: windows-1252 (default) | macintosh | windows-949 (also euc-kr) | shift_jis | gbk | big5 (the code page names in the editing data of a .ai or an EPS are read in when they aren't UTF-8: layers, objects, artboards, colors, gradients, patterns, graphic styles, swatches, brushes, symbols, variables and data sets, and data sets' text values; warnings list the first three such names as read, and count the rest), colorMode?: rgb|cmyk (the mode the document opens in, its colours converted as file.documentColorMode does, grays? as there; default: the file's — a PDF keeps CMYK, Gray and spot inks (spot swatches at a tint) and opens in CMYK when painted mostly in CMYK), grays?: as file.documentColorMode, dxf?: {layout?: \"Model\" (default) | a paper layout's name (document.dxfInfo lists them), unit?, scale? (the ratio: 1 unit of the art = scale drawing units; default: the drawing at 1:1 in its own unit), fit?: false (scale to fit an artboard of fitTo?: [612, 792], turned to the art's orientation), scaleLineweights?: false (lineweights scale with the art), center?: true (false: the drawing's origin on the artboard's bottom-left corner; fitted art's bottom-left corner), mergeLayers?: false (all art on one layer)} (DXF), crop?: as cropTo (its older name), linkPages?: false (true: each page `pages` picks of a PDF or PDF-compatible .ai opens as a placed document linked to that page of the file, as file.place with link places one, on an artboard of its cropTo box (bounding: its art's bounds), in a row, and a layer named after the page; links.embed makes a page editable art; refused for any other file, without a path, with a password or with textAs: outlines; Save then asks for a name), profileChoice?: \"useEmbedded\"|\"convert\"|\"discard\" (the profile of the document's color mode is not the working space: keep it, convert that model's colors into the working space and take it off, or take it off and keep the numbers) | \"leave\"|\"assignWorking\"|\"assign\" (the document has no profile of its color mode: leave it untagged, tag it with the working space, or with assignProfile?: a profile of that model) (default: what the model's policy of edit.colorSettings does; a choice for the other case, or for a document tagged with the working space, is not used; the reply's profileChoice gives {issue: mismatch|missing, model, choice} when one was used; the desktop app asks for it when edit.colorSettings' askMismatchOpen or askMissingOpen is on, document.open never asks), importer?: \"plugin.<id>\" (an importer plug-in's format id, see document.formats: it opens the file, which must have an extension it lists, also one a built-in format reads), params?: {…} (the importer's own parameters, see plugin.info)} → {index, title, format, warnings, restored, profileChoice?, missingLinks, modifiedLinks, updatedLinks: [{name, path, ids}]}; any readable format (see document.formats): .vectorcraft/.drawcraft, .svg/.svgz, .pdf/.ai, .ait, ASCII .dxf (each DXF layer with art a layer; blocks symbols; what can't come in is listed in warnings), PNG/JPEG/GIF/WebP/T Line truncated
always,
load::open
),
+124 -27
View File
@@ -660,6 +660,23 @@ pub struct ReadFile {
links: Resolved,
/// Whether the color management policies changed the document ([`apply_policies`]).
policy_changed: bool,
/// The answer to the document's profile question (`profileChoice`, or the app's prompt).
choice: Option<crate::cmd::colormgmt::ProfileChoice>,
/// What opening still has to do while the app asks about the profile ([`ReadFile::question`]):
/// the policies, the color mode, the linked files and the type are left for
/// [`ReadFile::answer`] or [`open_read`].
rest: Option<Rest>,
/// The answer that was used and the question it answered (`document.open`'s `profileChoice`
/// reply).
answered: Option<Value>,
}
/// The part of [`read_for_open`] a file waiting for a profile answer has left to do.
struct Rest {
update_links: bool,
low_res_proxy_eps: bool,
/// The color mode `colorMode` asks for, converted after the policies.
color_mode: Option<vectorcraft_doc::ColorMode>,
}
/// Edit › Color Settings: the color management policies keep, take off or convert from the
@@ -688,36 +705,109 @@ impl ReadFile {
/// reads (`importer` in `p`, or an extension only an importer lists) is read by it
/// ([`super::importer`]).
pub fn read_for_open(name: &str, bytes: &[u8], path: Option<String>, p: &Value, update_links: bool, low_res_proxy_eps: bool) -> Result<ReadFile> {
read_for_open_asking(name, bytes, path, p, update_links, low_res_proxy_eps, false)
}
/// [`read_for_open`]; with `ask` (the desktop app's File › Open), a document whose profile
/// question ([`ReadFile::question`]) Edit › Color Settings asks, and that `p` gives no
/// `profileChoice` for, stops after it is decoded: the app asks, and [`ReadFile::answer`] (or
/// [`open_read`], with the policy's choice) does the rest.
pub fn read_for_open_asking(
name: &str,
bytes: &[u8],
path: Option<String>,
p: &Value,
update_links: bool,
low_res_proxy_eps: bool,
ask: bool,
) -> Result<ReadFile> {
let opts = LoadOptions::from_params("document.open", p)?;
let (mut loaded, policy_changed) = if opts.link_pages {
let mut loaded = linked_pages(name, bytes, path.as_deref(), &opts)?;
let changed = apply_policies(&mut loaded);
(loaded, changed)
let choice = crate::cmd::colormgmt::ProfileChoice::param(p, "document.open")?;
let (loaded, color_mode) = if opts.link_pages {
(linked_pages(name, bytes, path.as_deref(), &opts)?, None)
} else {
match super::importer::pick(name, bytes, p)? {
Some(plugin) => {
let mut loaded = super::importer::load(name, bytes, &plugin, p)?;
let changed = apply_policies(&mut loaded);
(loaded, changed)
}
None => {
// The color mode `p` asks for converts the colors after the policies did, through
// the profiles the document keeps.
let mut loaded = load_with(name, bytes, &LoadOptions { color_mode: None, ..opts.clone() })?;
let changed = apply_policies(&mut loaded);
if let Some(mode) = opts.color_mode.filter(|m| *m != loaded.doc.color_mode) {
let doc = &mut loaded.doc;
vectorcraft_color::cms::with_active(super::super::colormgmt::doc_cms(doc), || {
super::super::colormgmt::set_color_mode(doc, mode, true, None, opts.grays);
});
}
(loaded, changed)
}
Some(plugin) => (super::importer::load(name, bytes, &plugin, p)?, None),
// The color mode `p` asks for converts the colors after the policies did, through the
// profiles the document keeps.
None => (load_with(name, bytes, &LoadOptions { color_mode: None, ..opts.clone() })?, opts.color_mode),
}
};
let links = crate::cmd::links::resolve(&mut loaded.doc, crate::cmd::links::LinkBase::file(path.as_deref()), update_links, low_res_proxy_eps);
Session::refresh_text_bounds(&mut loaded.doc);
Ok(ReadFile { loaded, opts, path, links, policy_changed })
let mut file = ReadFile {
loaded,
opts,
path,
links: Resolved::default(),
policy_changed: false,
choice,
rest: Some(Rest { update_links, low_res_proxy_eps, color_mode }),
answered: None,
};
if ask && file.choice.is_none() && file.question().is_some() {
return Ok(file);
}
file.finish_read()?;
Ok(file)
}
impl ReadFile {
/// The file's name, for a prompt.
pub fn name(&self) -> String {
self.path.as_deref().map(file_name).unwrap_or_else(|| self.loaded.doc.title.clone())
}
/// The profile question Edit › Color Settings asks about this file before it opens (its Ask
/// When Opening box of that kind is on), while the file waits for the answer
/// ([`read_for_open_asking`]); none once it is answered or read through.
pub fn question(&self) -> Option<crate::cmd::colormgmt::ProfileQuestion> {
self.rest.as_ref()?;
let st = vectorcraft_color::cms::working_settings();
crate::cmd::colormgmt::ProfileQuestion::of(&self.loaded.doc, &st).filter(|q| q.asked(&st))
}
/// Answer the profile question with `choice` and do the rest of the read: the policies (the
/// answer in place of the one of the document's color mode), the color mode, the linked files
/// and the type. An error (a profile to assign that is not one of that model) leaves the file
/// waiting.
pub fn answer(&mut self, choice: crate::cmd::colormgmt::ProfileChoice) -> Result<()> {
let before = self.choice.replace(choice);
let r = self.finish_read();
if r.is_err() {
self.choice = before;
}
r
}
/// The rest of [`read_for_open_asking`], once: the color management policies with the profile
/// answer, the color mode `colorMode` asks for, the linked files and the type.
fn finish_read(&mut self) -> Result<()> {
if self.rest.is_none() {
return Ok(());
}
// The question the answer was given to, for the reply's `profileChoice`.
let question = crate::cmd::colormgmt::ProfileQuestion::of(&self.loaded.doc, &vectorcraft_color::cms::working_settings());
let answered = match (&self.choice, &question) {
(Some(c), Some(q)) if c.issue() == q.issue => Some(json!({ "issue": q.issue.id(), "model": q.to_json()["model"], "choice": c.id() })),
_ => None,
};
// A failure leaves the file waiting, unchanged.
let (notes, changed) = crate::cmd::colormgmt::apply_open_policies_choosing(&mut self.loaded.doc, self.choice.as_ref())?;
let Some(rest) = self.rest.take() else { return Ok(()) };
self.answered = answered;
self.loaded.warnings.extend(notes);
self.policy_changed = changed;
if let Some(mode) = rest.color_mode.filter(|m| *m != self.loaded.doc.color_mode) {
let doc = &mut self.loaded.doc;
let grays = self.opts.grays;
vectorcraft_color::cms::with_active(super::super::colormgmt::doc_cms(doc), || {
super::super::colormgmt::set_color_mode(doc, mode, true, None, grays);
});
}
let base = crate::cmd::links::LinkBase::file(self.path.as_deref());
self.links = crate::cmd::links::resolve(&mut self.loaded.doc, base, rest.update_links, rest.low_res_proxy_eps);
Session::refresh_text_bounds(&mut self.loaded.doc);
Ok(())
}
}
/// The PDF `name` (`bytes`, read from `path`) opened with `linkPages`: its pages as placed documents
@@ -731,8 +821,15 @@ fn linked_pages(name: &str, bytes: &[u8], path: Option<&str>, opts: &LoadOptions
/// The second half of [`open_bytes_with`]: open a file [`read_for_open`] read as the new active
/// document → `document.open`'s result.
pub fn open_read(s: &mut Session, file: ReadFile) -> Result<Value> {
open_loaded(s, file.loaded, file.links, file.path, &file.opts, false, file.policy_changed)
/// A file still waiting for its profile answer ([`ReadFile::question`]) opens as its policy says.
pub fn open_read(s: &mut Session, mut file: ReadFile) -> Result<Value> {
file.finish_read()?;
let answered = file.answered.take();
let mut r = open_loaded(s, file.loaded, file.links, file.path, &file.opts, false, file.policy_changed)?;
if let Some(a) = answered {
r["profileChoice"] = a;
}
Ok(r)
}
/// File → New from Template: any readable file (at `path`, if it is one: its links are looked for
+342 -1
View File
@@ -8,7 +8,7 @@ use std::sync::{Mutex, MutexGuard};
use serde_json::json;
use vectorcraft_color::cms;
use vectorcraft_engine::Session;
use vectorcraft_engine::cmd::colormgmt::{PROFILES_KEY, doc_profiles};
use vectorcraft_engine::cmd::colormgmt::{PROFILES_KEY, ProfileChoice, ProfileIssue, doc_profiles};
use vectorcraft_engine::store::MAX_PRESET_FILE;
use vectorcraft_geom::Affine;
use vectorcraft_render::{RenderOptions, Renderer};
@@ -1019,3 +1019,344 @@ fn color_management_policies_are_checked_and_kept() {
next.attach_color_settings(file);
assert_eq!(cms::active_settings(), cms::ColorSettings::default());
}
/// The Ask boxes of Edit › Color Settings are checked, come back in the reply and are kept in
/// `Color Settings.json`.
#[test]
fn ask_boxes_are_checked_and_kept() {
let _g = settings();
let dir = fresh_dir("ask-kept");
let _reset = ColorSettingsReset { profile: None, paths: vec![dir.clone()] };
let file = dir.join("Color Settings.json");
let mut s = session();
s.attach_color_settings(file.clone());
let r = exec(&mut s, "edit.colorSettings", json!({}));
assert_eq!(
(r["askMismatchOpen"].as_bool(), r["askMismatchPaste"].as_bool(), r["askMissingOpen"].as_bool()),
(Some(false), Some(false), Some(false))
);
for bad in [json!({"askMismatchOpen": "yes"}), json!({"askMismatchPaste": 1}), json!({"askMissingOpen": []})] {
assert!(s.execute("edit.colorSettings", &bad).is_err(), "{bad}");
}
assert!(!file.exists(), "a refused change keeps nothing");
let r = exec(&mut s, "edit.colorSettings", json!({"askMismatchOpen": true, "askMissingOpen": true}));
assert_eq!(
(r["askMismatchOpen"].as_bool(), r["askMismatchPaste"].as_bool(), r["askMissingOpen"].as_bool()),
(Some(true), Some(false), Some(true))
);
let saved: cms::ColorSettings = serde_json::from_slice(&std::fs::read(&file).unwrap()).unwrap();
assert!(saved.ask_mismatch_open && !saved.ask_mismatch_paste && saved.ask_missing_open);
}
/// Two saved documents with a blue rectangle (`blue`, filled `blue0`): `tagged`, assigned Wide
/// Gamut RGB, and `plain`, untagged. The files go when it drops, and the Color Settings go back to
/// the defaults.
struct ProfileFiles {
_reset: ColorSettingsReset,
_dir: vectorcraft_testkit::TempDir,
tagged: std::path::PathBuf,
plain: std::path::PathBuf,
blue: vectorcraft_doc::NodeId,
blue0: vectorcraft_color::Color,
}
#[allow(clippy::unwrap_used, reason = "a test helper: a file that can't be written fails the test")]
fn profile_files(tag: &str) -> ProfileFiles {
let dir = fresh_dir(tag);
let reset = ColorSettingsReset { profile: None, paths: vec![dir.clone()] };
std::fs::create_dir_all(&dir).unwrap();
let (tagged, plain) = (dir.join("tagged.vectorcraft"), dir.join("plain.vectorcraft"));
let mut s = session();
let blue = rect(&mut s, 0.0, 0.0, 10.0, 10.0);
exec(&mut s, "paint.setFill", json!({"ids": [blue.0], "color": "#3366cc"}));
exec(&mut s, "file.saveAs", json!({"path": plain.to_str().unwrap()}));
exec(&mut s, "edit.assignProfile", json!({"rgb": cms::WIDE_GAMUT_RGB}));
exec(&mut s, "file.saveAs", json!({"path": tagged.to_str().unwrap()}));
let blue0 = fill_of(&s, blue);
ProfileFiles { _reset: reset, _dir: dir, tagged, plain, blue, blue0 }
}
/// The fill color of object `id` in the active document.
#[allow(clippy::unwrap_used, reason = "a test helper: a missing object or fill fails the test")]
fn fill_of(s: &Session, id: vectorcraft_doc::NodeId) -> vectorcraft_color::Color {
s.doc().unwrap().doc.node(id).and_then(|n| n.appearance.fill()).and_then(|f| f.paint.color()).unwrap()
}
/// `document.open` of `path` with the params `extra` in a new session → the reply, and the session.
#[allow(clippy::unwrap_used, reason = "a test helper: params that are not an object fail the test")]
fn open_with(path: &std::path::Path, extra: serde_json::Value) -> (Result<serde_json::Value, String>, Session) {
let mut s = session();
let mut p = json!({"path": path.to_str().unwrap()});
for (k, v) in extra.as_object().unwrap() {
p[k] = v.clone();
}
let r = s.execute("document.open", &p).map_err(|e| e.to_string());
(r, s)
}
/// `document.open`'s `profileChoice` answers what Color Settings' Profile Mismatches box asks: for
/// a document tagged with another profile than the working space of its color mode it keeps the
/// profile, converts the colors or discards the profile in place of the policy. A missing choice
/// for it is not used.
#[test]
fn profile_choice_answers_a_mismatch() {
let _g = settings();
let ProfileFiles { tagged, blue, blue0, .. } = &profile_files("profile-mismatch");
let (tagged, blue, blue0) = (tagged.as_path(), *blue, *blue0);
let fill = |s: &Session| fill_of(s, blue);
let open = open_with;
let mut s = session();
// Each choice in place of the policy (Preserve Embedded Profiles).
let (r, kept) = open(tagged, json!({"profileChoice": "useEmbedded"}));
let r = r.unwrap();
assert_eq!(r["profileChoice"], json!({"issue": "mismatch", "model": "rgb", "choice": "useEmbedded"}));
assert_eq!((doc_profiles(&kept.doc().unwrap().doc).0, fill(&kept)), (Some(cms::WIDE_GAMUT_RGB.into()), blue0));
let (r, discarded) = open(tagged, json!({"profileChoice": "discard"}));
let r = r.unwrap();
assert_eq!((doc_profiles(&discarded.doc().unwrap().doc).0, fill(&discarded)), (None, blue0), "the numbers stay");
assert!(discarded.doc().unwrap().is_dirty());
assert!(r["warnings"].as_array().unwrap().iter().any(|w| w.as_str().unwrap().contains("as chosen when it was opened")), "{r}");
let (r, converted) = open(tagged, json!({"profileChoice": "convert"}));
assert_eq!(r.unwrap()["profileChoice"]["choice"], "convert");
let source = cms::for_document(Some(cms::WIDE_GAMUT_RGB), None);
let blue1 = fill(&converted);
assert_eq!(doc_profiles(&converted.doc().unwrap().doc).0, None);
assert!(blue1 != blue0 && cms::delta_e2000(source.lab(&blue0), cms::working().lab(&blue1)) < 1.0, "{blue0:?} → {blue1:?}");
// Under policy Off, Use Embedded keeps the profile.
exec(&mut s, "edit.colorSettings", json!({"rgbPolicy": "off"}));
let (_, kept) = open(tagged, json!({"profileChoice": "useEmbedded"}));
assert_eq!(doc_profiles(&kept.doc().unwrap().doc).0, Some(cms::WIDE_GAMUT_RGB.into()));
// A missing choice for a mismatched document is not used: the policy applies.
let (r, off) = open(tagged, json!({"profileChoice": "leave"}));
assert!(r.unwrap().get("profileChoice").is_none());
assert_eq!(doc_profiles(&off.doc().unwrap().doc).0, None);
}
/// `document.open`'s `profileChoice` answers what the Missing Profiles box asks: an untagged
/// document is left, assigned the working space or assigned a profile, its numbers kept. A
/// mismatch choice for it is not used, and wrong choices are refused.
#[test]
fn profile_choice_answers_a_missing_profile() {
let _g = settings();
let ProfileFiles { tagged, plain, blue, blue0, .. } = &profile_files("profile-missing");
let (tagged, plain, blue, blue0) = (tagged.as_path(), plain.as_path(), *blue, *blue0);
let fill = |s: &Session| fill_of(s, blue);
let open = open_with;
let (r, left) = open(plain, json!({"profileChoice": "leave"}));
assert_eq!(r.unwrap()["profileChoice"], json!({"issue": "missing", "model": "rgb", "choice": "leave"}));
assert_eq!(doc_profiles(&left.doc().unwrap().doc).0, None);
assert!(!left.doc().unwrap().is_dirty());
let (_, working) = open(plain, json!({"profileChoice": "assignWorking"}));
assert_eq!(doc_profiles(&working.doc().unwrap().doc).0.as_deref(), Some(cms::canonical_name(cms::SRGB)));
assert!(working.doc().unwrap().is_dirty());
let (_, p3) = open(plain, json!({"profileChoice": "assign", "assignProfile": cms::DISPLAY_P3}));
assert_eq!((doc_profiles(&p3.doc().unwrap().doc).0, fill(&p3)), (Some(cms::DISPLAY_P3.into()), blue0), "assigning keeps the numbers");
// A mismatch choice for an untagged document is not used.
let (r, plain_kept) = open(plain, json!({"profileChoice": "convert"}));
assert!(r.unwrap().get("profileChoice").is_none());
assert_eq!(doc_profiles(&plain_kept.doc().unwrap().doc).0, None);
for bad in [
json!({"profileChoice": "bogus"}),
json!({"profileChoice": "assign"}),
json!({"profileChoice": "discard", "assignProfile": cms::DISPLAY_P3}),
json!({"assignProfile": cms::DISPLAY_P3}),
json!({"profileChoice": 3}),
] {
assert!(open(tagged, bad.clone()).0.is_err(), "{bad}");
}
let (r, none) = open(plain, json!({"profileChoice": "assign", "assignProfile": cms::DEVICE_CMYK}));
assert!(r.unwrap_err().contains("unknown rgb profile"), "a CMYK profile can't tag an RGB document");
assert_eq!(none.documents().len(), 1, "nothing opened");
}
/// The app's half of the open prompts: a file read with asking stops at the question when its box
/// is on (never without asking), and opens as answered, or as the policy says when it opens
/// unanswered. A refused answer leaves it waiting.
#[test]
fn a_read_waits_for_the_profile_answer() {
let _g = settings();
let ProfileFiles { tagged, plain, blue, blue0, .. } = &profile_files("profile-wait");
let (blue, blue0) = (*blue, *blue0);
let fill = |s: &Session| fill_of(s, blue);
let mut s = session();
let source = cms::for_document(Some(cms::WIDE_GAMUT_RGB), None);
let blue1 = source.convert_into(&cms::working(), &blue0, cms::working().settings().intent);
let bytes = std::fs::read(tagged).unwrap();
let name = tagged.to_str().unwrap();
let read =
|ask: bool| vectorcraft_engine::cmd::fileio::read_for_open_asking(name, &bytes, Some(name.into()), &json!({}), false, false, ask).unwrap();
assert!(read(true).question().is_none(), "the box is off");
exec(&mut s, "edit.colorSettings", json!({"askMismatchOpen": true, "rgbPolicy": "convert"}));
assert!(read(false).question().is_none(), "document.open never asks");
let mut waiting = read(true);
let q = waiting.question().unwrap();
assert_eq!((q.issue, q.profile.as_deref(), q.default.id()), (ProfileIssue::Mismatch, Some(cms::WIDE_GAMUT_RGB), "convert"));
assert_eq!(waiting.name(), "tagged.vectorcraft");
waiting.answer(ProfileChoice::Discard).unwrap();
assert!(waiting.question().is_none(), "answered");
let mut opened = session();
let r = vectorcraft_engine::cmd::fileio::open_read(&mut opened, waiting).unwrap();
assert_eq!(r["profileChoice"]["choice"], "discard");
assert_eq!((doc_profiles(&opened.doc().unwrap().doc).0, fill(&opened)), (None, blue0));
// Unanswered, it opens as the policy (Convert to Working Space) says.
let mut opened = session();
vectorcraft_engine::cmd::fileio::open_read(&mut opened, read(true)).unwrap();
assert_eq!((doc_profiles(&opened.doc().unwrap().doc).0, fill(&opened)), (None, blue1));
// A missing answer to a mismatch is not used: the policy decides.
let mut waiting = read(true);
waiting.answer(ProfileChoice::Leave).unwrap();
let mut opened = session();
let r = vectorcraft_engine::cmd::fileio::open_read(&mut opened, waiting).unwrap();
assert!(r.get("profileChoice").is_none());
assert_eq!(fill(&opened), blue1);
// Missing Profiles: Ask When Opening, starting on assigning the working space under Convert.
exec(&mut s, "edit.colorSettings", json!({"askMismatchOpen": false, "askMissingOpen": true}));
assert!(read(true).question().is_none(), "the mismatch box is off now");
let plain_bytes = std::fs::read(plain).unwrap();
let mut waiting =
vectorcraft_engine::cmd::fileio::read_for_open_asking("plain.vectorcraft", &plain_bytes, None, &json!({}), false, false, true).unwrap();
let q = waiting.question().unwrap();
assert_eq!((q.issue, q.profile.as_deref(), q.default.id()), (ProfileIssue::Missing, None, "assignWorking"));
assert!(waiting.answer(ProfileChoice::Assign(cms::DEVICE_CMYK.into())).is_err(), "not an RGB profile");
assert!(waiting.question().is_some(), "still waiting after a refused answer");
waiting.answer(ProfileChoice::Assign(cms::DISPLAY_P3.into())).unwrap();
let mut opened = session();
vectorcraft_engine::cmd::fileio::open_read(&mut opened, waiting).unwrap();
assert_eq!(doc_profiles(&opened.doc().unwrap().doc).0, Some(cms::DISPLAY_P3.into()));
}
/// Swatch conflicts are checked against the colors as the paste brings them: a global swatch whose
/// name and color match the destination's conflicts once the paste converts it, and pasting back
/// into its own document with conversion compares its swatches too.
#[test]
fn swatch_conflicts_follow_the_profile_conversion() {
let _g = settings();
let _reset = ColorSettingsReset { profile: None, paths: vec![] };
let mut s = session();
exec(&mut s, "swatch.new", json!({"name": "Brand", "color": "#3366cc", "global": true}));
let r = rect(&mut s, 0.0, 0.0, 10.0, 10.0);
exec(&mut s, "paint.setFill", json!({"ids": [r.0], "swatch": "Brand"}));
exec(&mut s, "edit.assignProfile", json!({"rgb": cms::WIDE_GAMUT_RGB}));
select(&mut s, &[r]);
exec(&mut s, "edit.copy", json!({}));
exec(&mut s, "file.new", json!({"width": 100, "height": 100}));
exec(&mut s, "swatch.new", json!({"name": "Brand", "color": "#3366cc", "global": true}));
let conflicts = |s: &mut Session, p: serde_json::Value| exec(s, "clipboard.conflicts", p)["swatches"].as_array().unwrap().len();
assert_eq!(conflicts(&mut s, json!({})), 0, "the numbers are kept: the same color");
assert_eq!(conflicts(&mut s, json!({"profileMismatch": "convert"})), 1, "converted, it differs");
assert!(s.execute("clipboard.conflicts", &json!({"profileMismatch": "keep"})).is_err());
// Back in the first document, under another working space, a converting paste compares too.
exec(&mut s, "document.activate", json!({"index": 0}));
exec(&mut s, "edit.assignProfile", json!({"rgb": null}));
assert_eq!(conflicts(&mut s, json!({})), 0);
assert_eq!(conflicts(&mut s, json!({"profileMismatch": "convert"})), 1);
}
/// A paste is a mismatch only for the models the copied colors use: CMYK art from a document with
/// other RGB and CMYK profiles is a CMYK mismatch alone, and so is an artboard copied without art
/// whose background is CMYK.
#[test]
fn a_paste_mismatches_only_the_models_its_colors_use() {
let _g = settings();
let _reset = ColorSettingsReset { profile: None, paths: vec![] };
let mut s = session();
let ink = rect(&mut s, 0.0, 0.0, 10.0, 10.0);
exec(&mut s, "paint.setFill", json!({"ids": [ink.0], "color": {"c": 20, "m": 40, "y": 60, "k": 10}}));
exec(&mut s, "paint.setStroke", json!({"ids": [ink.0], "none": true}));
exec(&mut s, "edit.assignProfile", json!({"rgb": cms::WIDE_GAMUT_RGB, "cmyk": cms::DEVICE_CMYK}));
select(&mut s, &[ink]);
exec(&mut s, "edit.copy", json!({}));
exec(&mut s, "file.new", json!({"width": 100, "height": 100}));
let models = |s: &mut Session| -> Vec<String> {
let r = exec(s, "clipboard.profileMismatch", json!({}));
r["mismatches"].as_array().unwrap().iter().map(|m| m["model"].as_str().unwrap().to_string()).collect()
};
assert_eq!(models(&mut s), ["cmyk"]);
exec(&mut s, "document.activate", json!({"index": 0}));
exec(&mut s, "artboard.setProps", json!({"index": 0, "color": {"c": 0, "m": 100, "y": 0, "k": 0}}));
exec(&mut s, "artboard.copy", json!({"index": 0}));
exec(&mut s, "document.activate", json!({"index": 1}));
assert_eq!(models(&mut s), ["cmyk"]);
}
/// An artboard copied without art from a document with another profile is a mismatch through its
/// background color, which converts with a paste that converts.
#[test]
fn a_pasted_artboard_background_converts() {
let _g = settings();
let _reset = ColorSettingsReset { profile: None, paths: vec![] };
let mut s = session();
exec(&mut s, "artboard.setProps", json!({"index": 0, "color": "#3366cc"}));
exec(&mut s, "edit.assignProfile", json!({"rgb": cms::WIDE_GAMUT_RGB}));
exec(&mut s, "artboard.copy", json!({"index": 0}));
exec(&mut s, "file.new", json!({"width": 100, "height": 100}));
assert_eq!(exec(&mut s, "clipboard.profileMismatch", json!({}))["mismatches"][0]["model"], "rgb");
let r = exec(&mut s, "edit.paste", json!({"profileMismatch": "convert"}));
let i = r["artboards"][0].as_u64().unwrap() as usize;
let paper = s.doc().unwrap().doc.artboards[i].color.unwrap();
let blue0 = vectorcraft_color::Color::from_hex("#3366cc").unwrap();
let source = cms::for_document(Some(cms::WIDE_GAMUT_RGB), None);
assert!(paper != blue0 && cms::delta_e2000(source.lab(&blue0), cms::working().lab(&paper)) < 1.0, "{blue0:?} → {paper:?}");
}
/// Paste compares the profiles the copied colors showed through with the destination's: a model
/// whose profile differs and whose colors the objects use is a mismatch (clipboard.profileMismatch).
/// Its colors keep their numbers or convert, as `profileMismatch` says, else as the policy says;
/// the reply lists what was done.
#[test]
fn paste_keeps_or_converts_colors_from_another_profile() {
let _g = settings();
let _reset = ColorSettingsReset { profile: None, paths: vec![] };
let mut s = session();
let blue = rect(&mut s, 0.0, 0.0, 10.0, 10.0);
exec(&mut s, "paint.setFill", json!({"ids": [blue.0], "color": "#3366cc"}));
exec(&mut s, "edit.assignProfile", json!({"rgb": cms::WIDE_GAMUT_RGB, "cmyk": cms::DEVICE_CMYK}));
select(&mut s, &[blue]);
exec(&mut s, "edit.copy", json!({}));
let blue0 = vectorcraft_color::Color::from_hex("#3366cc").unwrap();
// Back in the same document: nothing to compare.
assert_eq!(exec(&mut s, "clipboard.profileMismatch", json!({}))["mismatches"], json!([]));
exec(&mut s, "file.new", json!({"width": 100, "height": 100}));
let r = exec(&mut s, "clipboard.profileMismatch", json!({}));
// Only RGB: the objects use no CMYK color.
assert_eq!(
r["mismatches"],
json!([{"model": "rgb", "clipboard": cms::WIDE_GAMUT_RGB, "document": cms::canonical_name(cms::SRGB), "default": "preserveNumbers"}])
);
let pasted = |s: &mut Session, p: serde_json::Value| {
let r = exec(s, "edit.paste", p);
let id = vectorcraft_doc::NodeId(r["ids"][0].as_u64().unwrap());
let c = s.doc().unwrap().doc.node(id).and_then(|n| n.appearance.fill()).and_then(|f| f.paint.color()).unwrap();
(r, c)
};
let (r, kept) = pasted(&mut s, json!({}));
assert_eq!(kept, blue0, "the policy (Preserve Embedded Profiles) keeps the numbers");
assert_eq!(r["profileMismatch"][0]["choice"], "preserveNumbers");
let (r, moved) = pasted(&mut s, json!({"profileMismatch": "convert"}));
assert_eq!(r["profileMismatch"][0]["choice"], "convert");
let source = cms::for_document(Some(cms::WIDE_GAMUT_RGB), None);
assert!(moved != blue0 && cms::delta_e2000(source.lab(&blue0), cms::working().lab(&moved)) < 1.0, "{blue0:?} → {moved:?}");
exec(&mut s, "edit.colorSettings", json!({"rgbPolicy": "convert"}));
assert_eq!(exec(&mut s, "clipboard.profileMismatch", json!({}))["mismatches"][0]["default"], "convert");
let (_, by_policy) = pasted(&mut s, json!({}));
assert_eq!(by_policy, moved, "Convert to Working Space converts");
let (_, numbers) = pasted(&mut s, json!({"profileMismatch": "preserveNumbers"}));
assert_eq!(numbers, blue0);
for bad in [json!({"profileMismatch": "keep"}), json!({"profileMismatch": true})] {
assert!(s.execute("edit.paste", &bad).is_err(), "{bad}");
}
// A drag from the first document follows the policy too.
let source = s.documents()[0].uid;
let r = exec(&mut s, "edit.dropSelection", json!({"sourceDocument": source, "ids": [blue.0], "grab": [5, 5], "at": [50, 50]}));
let dropped = vectorcraft_doc::NodeId(r["ids"][0].as_u64().unwrap());
let c = s.doc().unwrap().doc.node(dropped).and_then(|n| n.appearance.fill()).and_then(|f| f.paint.color()).unwrap();
assert_eq!(c, moved, "dropped colors convert under Convert to Working Space");
// A destination assigned the source's profile has nothing to compare.
exec(&mut s, "edit.assignProfile", json!({"rgb": cms::WIDE_GAMUT_RGB}));
assert_eq!(exec(&mut s, "clipboard.profileMismatch", json!({}))["mismatches"], json!([]));
let (r, same) = pasted(&mut s, json!({}));
assert!(r.get("profileMismatch").is_none());
assert_eq!(same, blue0);
}
+1
View File
@@ -180,6 +180,7 @@ impl VectorcraftApp {
automation_roots: None,
synthetic_frame: false,
pending_plugin_install: None,
pending_profile_open: None,
pen_end: Default::default(),
host_iteration: 0,
#[cfg(test)]
+4
View File
@@ -214,6 +214,10 @@ impl VectorcraftApp {
Ok(Some(started)) => return Ok(started),
Ok(None) => {}
}
// Edit › Color Settings' Ask When Pasting, then any swatch conflict.
if let Some(r) = dialogs::profile_mismatch::ask_paste(self, id, &params) {
return r;
}
if let Some(r) = dialogs::swatch_conflict::ask(self, id, &params) {
return r;
}
+10
View File
@@ -96,6 +96,7 @@ pub mod plugin;
mod png_options;
pub mod print;
pub mod print_presets;
pub mod profile_mismatch;
mod psd_options;
pub mod raster_effects;
pub mod rearrange_artboards;
@@ -382,6 +383,8 @@ registry! {
ExportAs: ["exportAs"] => export_as::SPEC,
ImportPdf: [import_pdf::KIND] => import_pdf::SPEC,
SwatchConflict: [swatch_conflict::KIND] => swatch_conflict::SPEC,
ProfileMismatchOpen: [profile_mismatch::OPEN_KIND] => profile_mismatch::OPEN_SPEC,
ProfileMismatchPaste: [profile_mismatch::PASTE_KIND] => profile_mismatch::PASTE_SPEC,
FileInfo: [file_info::KIND] => file_info::SPEC,
RasterEffectsSettings: [raster_effects::KIND] => raster_effects::SPEC,
EffectGallery: [effect_gallery::KIND] => effect_gallery::SPEC,
@@ -666,6 +669,12 @@ pub fn cancel(app: &mut VectorcraftApp) {
if d.kind == swatch_conflict::KIND {
crate::placing::cancel_swatch_paste(app);
}
if d.kind == profile_mismatch::OPEN_KIND {
profile_mismatch::cancel_open(app);
}
if d.kind == profile_mismatch::PASTE_KIND {
crate::placing::cancel_swatch_paste(app);
}
if d.kind == plugin::INSTALL_KIND {
app.pending_plugin_install = None;
}
@@ -726,6 +735,7 @@ pub fn confirm(app: &mut VectorcraftApp) -> DialogResult {
/// time).
pub(crate) fn settle(app: &mut VectorcraftApp) {
crate::placing::settle_swatch_paste(app);
profile_mismatch::settle(app);
missing_fonts::requeue_replaced(app);
missing_fonts::stop_when_closed(app);
find_links::stop_when_closed(app);
+5 -1
View File
@@ -233,7 +233,11 @@ fn confirm(app: &mut VectorcraftApp, d: &Dialog) -> Result<Value, String> {
};
match r {
Ok(()) => {
app.ui.dialog = None;
// Opening may have asked something else (the profile of the document); only this
// dialog closes.
if app.ui.dialog.as_ref().is_some_and(|x| x.kind == KIND) {
app.ui.dialog = None;
}
Ok(Value::Null)
}
Err(e) => {
@@ -0,0 +1,244 @@
//! The questions Edit › Color Settings' Ask boxes add (Profile Mismatches: Ask When Opening and
//! Ask When Pasting, Missing Profiles: Ask When Opening), one dialog kind each for opening and for
//! pasting.
//!
//! Opening ([`OPEN_KIND`]): a document whose color mode's profile is not the working space asks
//! whether to use that profile, convert the colors to the working space or discard the profile; one
//! with no profile asks whether to leave it, assign the working space or assign a profile. The
//! choice the policy makes is chosen first. OK opens the document as chosen; Cancel doesn't open
//! it. The file read waits in [`VectorcraftApp::pending_profile_open`]. Fields: `issue` (`mismatch`
//! | `missing`), `name` (the file's), `model` (`RGB` | `CMYK`), `profile` (the one it is tagged
//! with), `working`, `choice` (a `profileChoice` of `document.open`) and `assignProfile`.
//!
//! Pasting ([`PASTE_KIND`]): colors copied from a document whose profile is not this document's ask
//! whether to keep their numbers or convert them. OK runs the paste with `profileMismatch`; Cancel
//! pastes nothing. Fields: `mismatches` (as `clipboard.profileMismatch` lists them), `choice`
//! (`preserveNumbers` | `convert`), `__command` and `__params` (the paste to run).
use serde_json::{Value, json};
use vectorcraft_color::cms::{self, ProfileKind};
use vectorcraft_engine::cmd::colormgmt::ProfileChoice;
use vectorcraft_engine::cmd::fileio::{self, ReadFile};
use super::swatch_options::{grid, label};
use super::{DialogResult, DialogSpec};
use crate::state::Dialog;
use crate::{VectorcraftApp, widgets};
/// The dialog kind of the question opening asks.
pub const OPEN_KIND: &str = "profileMismatchOpen";
/// The dialog kind of the question pasting asks.
pub const PASTE_KIND: &str = "profileMismatchPaste";
pub(super) const OPEN_SPEC: DialogSpec = DialogSpec {
heading: |d| if d.str("issue") == "missing" { tl!("Missing Profile") } else { tl!("Embedded Profile Mismatch") }.into(),
body: open_body,
confirm: open_confirm,
min_width: 400.0,
max_width: Some(480.0),
..DialogSpec::FORM
};
pub(super) const PASTE_SPEC: DialogSpec = DialogSpec {
heading: |_| tl!("Paste Profile Mismatch").into(),
body: paste_body,
confirm: paste_confirm,
min_width: 400.0,
max_width: Some(480.0),
..DialogSpec::FORM
};
/// A file read for File › Open that waits for the answer to its profile question.
pub(crate) struct PendingOpen {
file: ReadFile,
/// Where it was read from: it goes on the recent files once it opens.
path: Option<String>,
}
/// The choices of a mismatch (`missing`: of a missing profile), as (`choice`, label).
fn open_choices(missing: bool) -> [(&'static str, &'static str); 3] {
if missing {
[("leave", tl!("Leave as is")), ("assignWorking", tl!("Assign the working space")), ("assign", tl!("Assign profile:"))]
} else {
[
("useEmbedded", tl!("Use the embedded profile")),
("convert", tl!("Convert the colors to the working space")),
("discard", tl!("Discard the embedded profile")),
]
}
}
/// The choices pasting offers, as (`choice`, label).
fn paste_choices() -> [(&'static str, &'static str); 2] {
[("preserveNumbers", tl!("Preserve the color numbers")), ("convert", tl!("Convert to keep the colors' appearance"))]
}
/// Open `file`, read for File › Open from `path`, as `document.open` does, unless Edit › Color
/// Settings asks about its profile ([`ReadFile::question`]): then the dialog asks first, and the
/// result is `{dialog}`. Opened, the views follow and the file goes on the recent files
/// ([`crate::io::opened`]).
pub fn open_or_ask(app: &mut VectorcraftApp, file: ReadFile, path: Option<String>) -> Result<Value, String> {
// One question at a time: a file read while another waits opens as its policy says.
if app.pending_profile_open.is_none()
&& let Some(q) = file.question()
{
let fields = json!({
"issue": q.issue.id(),
"name": file.name(),
"model": q.model_label(),
"profile": q.profile,
"working": q.working,
"choice": q.default.id(),
"assignProfile": q.working,
});
app.pending_profile_open = Some(PendingOpen { file, path });
app.ui.dialog = Some(Dialog::new(OPEN_KIND, fields));
return Ok(json!({ "dialog": OPEN_KIND }));
}
let r = fileio::open_read(&mut app.session, file).map_err(|e| e.to_string())?;
crate::io::opened(app, &r);
if let Some(p) = &path {
crate::io::note_recent(app, p);
}
Ok(r)
}
/// The `profileChoice` the open dialog's fields give.
fn open_choice(d: &Dialog) -> Result<ProfileChoice, String> {
let choice = d.str("choice");
let profile = d.str("assignProfile");
let profile = (choice == "assign").then_some(profile.as_str());
ProfileChoice::parse(&choice, profile, "ui.dialog.confirm").map_err(|e| e.to_string())
}
fn open_body(_: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
let missing = d.str("issue") == "missing";
let (name, model, profile, working) = (d.str("name"), d.str("model"), d.str("profile"), d.str("working"));
let vars = [("name", name.as_str()), ("model", model.as_str()), ("profile", profile.as_str()), ("working", working.as_str())];
let text = if missing {
tl!("“{name}” is not tagged with a {model} profile.")
} else {
tl!("“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”.")
};
ui.label(crate::i18n::fmt(text, &vars));
ui.add_space(10.0);
let choice = d.str("choice");
for (value, text) in open_choices(missing) {
ui.horizontal(|ui| {
if widgets::radio(ui, text, choice == value, true) {
d.fields.insert("choice".into(), json!(value));
}
if value == "assign" {
let kind = if model == "CMYK" { ProfileKind::Cmyk } else { ProfileKind::Rgb };
let current = d.str("assignProfile");
ui.add_enabled_ui(choice == "assign", |ui| {
if let Some(n) = crate::panels::separations::profile_dropdown(ui, "profile-mismatch-assign", &current, kind, None) {
d.fields.insert("assignProfile".into(), json!(n));
}
});
}
});
}
false
}
/// OK: open the waiting file as chosen. A choice the file refuses keeps the dialog open.
fn open_confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult {
let choice = open_choice(d)?;
let Some(mut pending) = app.pending_profile_open.take() else {
app.ui.dialog = None;
return Ok(Value::Null);
};
if let Err(e) = pending.file.answer(choice) {
app.pending_profile_open = Some(pending);
return Err(e.to_string());
}
app.ui.dialog = None;
let PendingOpen { file, path } = pending;
let name = file.name();
match fileio::open_read(&mut app.session, file) {
Ok(r) => {
crate::io::opened(app, &r);
if let Some(p) = &path {
crate::io::note_recent(app, p);
}
Ok(r)
}
Err(e) => {
let e = e.to_string();
crate::io::report_open_error(app, &name, &e);
Err(e)
}
}
}
/// Cancel, or the dialog closed some other way: the waiting file doesn't open.
pub(crate) fn cancel_open(app: &mut VectorcraftApp) {
app.pending_profile_open = None;
}
/// A file still waiting once its dialog is gone (another dialog took its place) doesn't open.
pub(crate) fn settle(app: &mut VectorcraftApp) {
if app.pending_profile_open.is_some() && !app.ui.dialog.as_ref().is_some_and(|d| d.kind == OPEN_KIND) {
cancel_open(app);
}
}
/// Before running paste `command` with `params`: when Ask When Pasting is on, `params` don't say
/// what to do (`profileMismatch`) and the pasted colors come from another profile, open the dialog
/// instead and answer `{dialog}`.
pub fn ask_paste(app: &mut VectorcraftApp, command: &str, params: &Value) -> Option<DialogResult> {
if params.get("profileMismatch").is_some() || !cms::working_settings().ask_mismatch_paste {
return None;
}
let found = app.session.execute("clipboard.profileMismatch", &json!({})).ok()?;
let mismatches = found["mismatches"].as_array().filter(|a| !a.is_empty())?.clone();
// The policy of the first model starts chosen.
let choice = mismatches[0]["default"].as_str().unwrap_or("preserveNumbers").to_string();
let fields = json!({ "mismatches": mismatches, "choice": choice, "__command": command, "__params": params });
// A deferred paste this dialog asked about gives way to the new one.
if app.ui.dialog.as_ref().is_some_and(|d| d.kind == PASTE_KIND) {
crate::placing::cancel_swatch_paste(app);
}
app.ui.dialog = Some(Dialog::new(PASTE_KIND, fields));
Some(Ok(json!({ "dialog": PASTE_KIND })))
}
fn paste_body(_: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
let mismatches = d.fields.get("mismatches").and_then(Value::as_array).cloned().unwrap_or_default();
for m in &mismatches {
let model = m["model"].as_str().unwrap_or_default().to_ascii_uppercase();
let (from, to) = (m["clipboard"].as_str().unwrap_or_default(), m["document"].as_str().unwrap_or_default());
let text = tl!("The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”.");
ui.label(crate::i18n::fmt(text, &[("model", model.as_str()), ("from", from), ("to", to)]));
}
ui.add_space(10.0);
let choice = d.str("choice");
grid(ui, |ui| {
for (value, text) in paste_choices() {
label(ui, "");
if widgets::radio(ui, text, choice == value, true) {
d.fields.insert("choice".into(), json!(value));
}
ui.end_row();
}
});
false
}
/// OK: run the paste with the choice; any Swatch Conflict question comes next.
fn paste_confirm(app: &mut VectorcraftApp, d: &Dialog) -> DialogResult {
let choice = d.str("choice");
if !paste_choices().iter().any(|(v, _)| *v == choice) {
let key = "choice";
return Err(format!("`{key}` must be one of {}", "preserveNumbers, convert"));
}
let mut params = d.fields.get("__params").cloned().filter(Value::is_object).unwrap_or_else(|| json!({}));
params["profileMismatch"] = json!(choice);
app.ui.dialog = None;
// A paste that waited for its clipboard runs in the context it was given in.
crate::placing::confirm_swatch_paste(app, &d.str("__command"), params, d.fields.get("__deferredPaste").and_then(Value::as_u64))
}
#[cfg(test)]
mod tests;
@@ -0,0 +1,134 @@
use vectorcraft_engine::Session;
use super::*;
fn frame(app: &mut VectorcraftApp) -> String {
crate::tests_labels::painted_text(app, |app, ui| super::super::show(app, ui.ctx()))
}
fn set(app: &mut VectorcraftApp, k: &str, v: Value) {
app.ui.dialog.as_mut().unwrap().fields.insert(k.into(), v);
}
/// The native file of a document with a blue rectangle, assigned `rgb` (none: untagged).
fn file(rgb: Option<&str>) -> Vec<u8> {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 100, "height": 100})).unwrap();
s.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 20, "height": 20})).unwrap();
s.execute("paint.setFill", &json!({"color": "#3366cc"})).unwrap();
if let Some(p) = rgb {
s.execute("edit.assignProfile", &json!({ "rgb": p })).unwrap();
}
let r = s.execute("document.serialize", &json!({})).unwrap();
vectorcraft_format::base64_decode(r["dataBase64"].as_str().unwrap()).unwrap()
}
fn rgb_profile(app: &VectorcraftApp) -> Option<String> {
vectorcraft_engine::cmd::colormgmt::doc_profiles(&app.session.doc().unwrap().doc).0
}
/// With Color Settings' Ask boxes on, File › Open asks about a document whose profile is not the
/// working space, or that has none, and opens it as chosen; Cancel doesn't open it, and a refused
/// choice keeps the dialog. Paste asks about colors from another profile and pastes as chosen. With
/// the boxes off, nothing asks.
#[test]
fn opening_and_pasting_ask_about_profiles() {
const CHILD: &str = "VECTORCRAFT_TEST_PROFILE_PROMPTS";
if std::env::var_os(CHILD).is_none() {
// Color settings are process-wide: change them in a separate test process.
let output = std::process::Command::new(std::env::current_exe().unwrap())
.args(["--exact", "dialogs::profile_mismatch::tests::opening_and_pasting_ask_about_profiles", "--nocapture"])
.env(CHILD, "1")
.output()
.unwrap();
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(
output.status.success() && stdout.contains("test result: ok. 1 passed; 0 failed;"),
"isolated profile prompt test failed:\n{stdout}\n{}",
String::from_utf8_lossy(&output.stderr),
);
return;
}
let mut app = VectorcraftApp::new(Session::new(), Default::default());
let (tagged, plain) = (file(Some(cms::WIDE_GAMUT_RGB)), file(None));
// The boxes are off: the document opens as the policy says.
let r = crate::io::open_bytes(&mut app, "tagged.vectorcraft", &tagged, None).unwrap();
assert!(r.get("index").is_some() && app.ui.dialog.is_none());
assert_eq!(rgb_profile(&app).as_deref(), Some(cms::WIDE_GAMUT_RGB));
// Profile Mismatches: Ask When Opening.
app.run("edit.colorSettings", json!({"askMismatchOpen": true, "rgbPolicy": "convert"})).unwrap();
let docs = app.session.documents().len();
let r = crate::io::open_bytes(&mut app, "tagged.vectorcraft", &tagged, None).unwrap();
assert_eq!(r, json!({ "dialog": OPEN_KIND }));
assert_eq!(app.session.documents().len(), docs, "not open yet");
let d = app.ui.dialog.as_ref().unwrap();
assert_eq!(
(d.str("issue"), d.str("model"), d.str("profile"), d.str("choice")),
("mismatch".into(), "RGB".into(), cms::WIDE_GAMUT_RGB.into(), "convert".into())
);
let text = frame(&mut app);
for label in [
"Embedded Profile Mismatch",
"Use the embedded profile",
"Convert the colors to the working space",
"Discard the embedded profile",
cms::WIDE_GAMUT_RGB,
] {
assert!(text.contains(label), "{label} in {text}");
}
// Cancel: nothing opens.
super::super::cancel(&mut app);
assert!(app.pending_profile_open.is_none());
assert_eq!(app.session.documents().len(), docs);
crate::io::open_bytes(&mut app, "tagged.vectorcraft", &tagged, None).unwrap();
set(&mut app, "choice", json!("useEmbedded"));
super::super::confirm(&mut app).unwrap();
assert!(app.ui.dialog.is_none() && app.pending_profile_open.is_none());
assert_eq!(app.session.documents().len(), docs + 1);
assert_eq!(rgb_profile(&app).as_deref(), Some(cms::WIDE_GAMUT_RGB), "kept, though the policy converts");
// Missing Profiles: Ask When Opening, and a choice the file refuses.
app.run("edit.colorSettings", json!({"askMismatchOpen": false, "askMissingOpen": true, "rgbPolicy": "preserveEmbedded"})).unwrap();
crate::io::open_bytes(&mut app, "plain.vectorcraft", &plain, None).unwrap();
let d = app.ui.dialog.as_ref().unwrap();
assert_eq!((d.kind.as_str(), d.str("issue"), d.str("choice")), (OPEN_KIND, "missing".into(), "leave".into()));
let text = frame(&mut app);
for label in ["Missing Profile", "Leave as is", "Assign the working space", "Assign profile:"] {
assert!(text.contains(label), "{label} in {text}");
}
set(&mut app, "choice", json!("assign"));
set(&mut app, "assignProfile", json!(cms::DEVICE_CMYK));
assert!(super::super::confirm(&mut app).is_err());
assert!(app.ui.dialog.as_ref().is_some_and(|d| d.kind == OPEN_KIND) && app.pending_profile_open.is_some(), "still asking");
set(&mut app, "assignProfile", json!(cms::DISPLAY_P3));
super::super::confirm(&mut app).unwrap();
assert_eq!(rgb_profile(&app).as_deref(), Some(cms::DISPLAY_P3));
assert!(app.session.doc().unwrap().is_dirty(), "assigning changed the document");
// Profile Mismatches: Ask When Pasting.
app.run("edit.colorSettings", json!({"askMissingOpen": false, "askMismatchPaste": true})).unwrap();
app.run("select.all", json!({})).unwrap();
app.run("edit.copy", json!({})).unwrap();
app.run("file.new", json!({"width": 100, "height": 100})).unwrap();
let r = app.run("edit.paste", json!({})).unwrap();
assert_eq!(r, json!({ "dialog": PASTE_KIND }));
let text = frame(&mut app);
for label in ["Paste Profile Mismatch", "Preserve the color numbers", "Convert to keep the colors' appearance", cms::DISPLAY_P3] {
assert!(text.contains(label), "{label} in {text}");
}
set(&mut app, "choice", json!("convert"));
let r = super::super::confirm(&mut app).unwrap();
assert_eq!(r["profileMismatch"][0]["choice"], "convert");
assert!(app.ui.dialog.is_none());
// Cancel pastes nothing; with the box off nothing asks.
let count = |app: &VectorcraftApp| app.session.doc().unwrap().doc.layers[0].children().map_or(0, |c| c.len());
let before = count(&app);
app.run("edit.paste", json!({})).unwrap();
super::super::cancel(&mut app);
assert_eq!(count(&app), before);
app.run("edit.colorSettings", json!({"askMismatchPaste": false})).unwrap();
let r = app.run("edit.paste", json!({})).unwrap();
assert_eq!(r["profileMismatch"][0]["choice"], "preserveNumbers");
assert_eq!(count(&app), before + 1);
}
@@ -35,7 +35,12 @@ pub fn ask(app: &mut VectorcraftApp, command: &str, params: &Value) -> Option<Di
if params.get("swatchConflict").is_some() {
return None;
}
let found = app.session.execute("clipboard.conflicts", &json!({})).ok()?;
// As the paste brings the swatches, converted from another profile when it converts.
let mut q = json!({});
if let Some(m) = params.get("profileMismatch") {
q["profileMismatch"] = m.clone();
}
let found = app.session.execute("clipboard.conflicts", &q).ok()?;
let conflicts = found["swatches"].as_array().filter(|a| !a.is_empty())?.clone();
let fields = json!({
"conflicts": conflicts, "index": 0, "choice": "merge", "applyToAll": false, "choices": {},
+18
View File
@@ -5007,6 +5007,24 @@ axis Both И двете
Preserve Embedded Profiles Запазване на вградените профили
Convert to Working Space Преобразуване в работното пространство
Preserve Numbers Запазване на числата
Profile Mismatches: Несъответствия на профила:
Ask When Opening Питане при отваряне
Ask When Pasting Питане при поставяне
Missing Profiles: Липсващи профили:
Embedded Profile Mismatch Несъответствие с вградения профил
Missing Profile Липсващ профил
Paste Profile Mismatch Несъответствие на профила при поставяне
“{name}” is not tagged with a {model} profile. „{name}“ няма {model} профил.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. „{name}“ има {model} профил „{profile}“, който не е {model} работното пространство „{working}“.
Use the embedded profile Използване на вградения профил
Convert the colors to the working space Преобразуване на цветовете в работното пространство
Discard the embedded profile Отхвърляне на вградения профил
Leave as is Оставяне без промяна
Assign the working space Задаване на работното пространство
Assign profile: Задаване на профил:
Preserve the color numbers Запазване на цветовите стойности
Convert to keep the colors' appearance Преобразуване със запазване на вида на цветовете
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Поставените цветове идват от документ с {model} профил „{from}“; профилът на този документ е „{to}“.
Texture Текстура
Craquelure… Кракелюр…
Grain… Зърнистост…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+18
View File
@@ -989,6 +989,24 @@
Preserve Embedded Profiles Zadrži ugrađene profile
Convert to Working Space Pretvori u radni prostor
Preserve Numbers Zadrži brojeve
Profile Mismatches: Neusklađenost profila:
Ask When Opening Pitaj pri otvaranju
Ask When Pasting Pitaj pri lijepljenju
Missing Profiles: Nedostajući profili:
Embedded Profile Mismatch Neusklađenost ugrađenog profila
Missing Profile Nedostaje profil
Paste Profile Mismatch Neusklađenost profila pri lijepljenju
“{name}” is not tagged with a {model} profile. „{name}” nema {model} profil.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. „{name}” ima {model} profil „{profile}”, koji nije {model} radni prostor „{working}”.
Use the embedded profile Koristi ugrađeni profil
Convert the colors to the working space Pretvori boje u radni prostor
Discard the embedded profile Odbaci ugrađeni profil
Leave as is Ostavi kako jeste
Assign the working space Dodijeli radni prostor
Assign profile: Dodijeli profil:
Preserve the color numbers Zadrži brojeve boja
Convert to keep the colors' appearance Pretvori da boje zadrže izgled
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Zalijepljene boje dolaze iz dokumenta čiji je {model} profil „{from}”; profil ovog dokumenta je „{to}”.
CMYK CMYK
Texture Tekstura
Craquelure… Krakelura…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+18
View File
@@ -769,6 +769,24 @@ antiAlias Sharp Nítid
Preserve Embedded Profiles Conserva els perfils incrustats
Convert to Working Space Converteix a l'espai de treball
Preserve Numbers Conserva els números
Profile Mismatches: Discrepàncies de perfil:
Ask When Opening Pregunta en obrir
Ask When Pasting Pregunta en enganxar
Missing Profiles: Perfils que falten:
Embedded Profile Mismatch Discrepància del perfil incrustat
Missing Profile Falta el perfil
Paste Profile Mismatch Discrepància de perfil en enganxar
“{name}” is not tagged with a {model} profile. “{name}” no té cap perfil {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}” té el perfil {model} “{profile}”, que no és l’espai de treball {model} “{working}”.
Use the embedded profile Utilitza el perfil incrustat
Convert the colors to the working space Converteix els colors a l’espai de treball
Discard the embedded profile Descarta el perfil incrustat
Leave as is Deixa-ho tal com està
Assign the working space Assigna l’espai de treball
Assign profile: Assigna el perfil:
Preserve the color numbers Conserva els valors dels colors
Convert to keep the colors' appearance Converteix per conservar l’aspecte dels colors
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Els colors enganxats provenen d’un document amb el perfil {model} “{from}”; el d’aquest document és “{to}”.
Coarse Dots Punts gruixuts
Collapse Panel Group Replega el grup de panells
Collapse Panels to Icons Replega els panells a icones
Can't render this file because it contains an unexpected character in line 2 and column 73.
+18
View File
@@ -1008,6 +1008,24 @@
Preserve Embedded Profiles Zachovat vložené profily
Convert to Working Space Převést do pracovního prostoru
Preserve Numbers Zachovat čísla
Profile Mismatches: Nesoulad profilů:
Ask When Opening Ptát se při otevírání
Ask When Pasting Ptát se při vkládání
Missing Profiles: Chybějící profily:
Embedded Profile Mismatch Nesoulad vloženého profilu
Missing Profile Chybějící profil
Paste Profile Mismatch Nesoulad profilu při vkládání
“{name}” is not tagged with a {model} profile. „{name}“ nemá přiřazen profil {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. „{name}“ má profil {model} „{profile}“, který není pracovním prostorem {model} „{working}“.
Use the embedded profile Použít vložený profil
Convert the colors to the working space Převést barvy do pracovního prostoru
Discard the embedded profile Zahodit vložený profil
Leave as is Ponechat beze změny
Assign the working space Přiřadit pracovní prostor
Assign profile: Přiřadit profil:
Preserve the color numbers Zachovat hodnoty barev
Convert to keep the colors' appearance Převést a zachovat vzhled barev
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Vložené barvy pocházejí z dokumentu s profilem {model} „{from}“; tento dokument má „{to}“.
CMYK CMYK
Texture Textura
Craquelure… Krakelování…
Can't render this file because it is too large.
+18
View File
@@ -1540,6 +1540,24 @@
Preserve Embedded Profiles Bevar indlejrede profiler
Convert to Working Space Konverter til arbejdsfarverum
Preserve Numbers Bevar tal
Profile Mismatches: Profiluoverensstemmelser:
Ask When Opening Spørg ved åbning
Ask When Pasting Spørg ved indsætning
Missing Profiles: Manglende profiler:
Embedded Profile Mismatch Uoverensstemmelse med indlejret profil
Missing Profile Manglende profil
Paste Profile Mismatch Profiluoverensstemmelse ved indsætning
“{name}” is not tagged with a {model} profile. »{name}« har ingen {model}-profil.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. »{name}« har {model}-profilen »{profile}«, som ikke er {model}-arbejdsfarverummet »{working}«.
Use the embedded profile Brug den indlejrede profil
Convert the colors to the working space Konverter farverne til arbejdsfarverummet
Discard the embedded profile Kassér den indlejrede profil
Leave as is Lad være som den er
Assign the working space Tildel arbejdsfarverummet
Assign profile: Tildel profil:
Preserve the color numbers Bevar farveværdierne
Convert to keep the colors' appearance Konverter for at bevare farvernes udseende
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. De indsatte farver kommer fra et dokument med {model}-profilen »{from}«; dette dokuments er »{to}«.
CMYK CMYK
Texture Tekstur
Craquelure… Krakelering…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+18
View File
@@ -5294,6 +5294,24 @@ theme Appearance Erscheinungsbild
Preserve Embedded Profiles Eingebettete Profile beibehalten
Convert to Working Space In Arbeitsfarbraum konvertieren
Preserve Numbers Werte beibehalten
Profile Mismatches: Profilabweichungen:
Ask When Opening Beim Öffnen fragen
Ask When Pasting Beim Einfügen fragen
Missing Profiles: Fehlende Profile:
Embedded Profile Mismatch Abweichung vom eingebetteten Profil
Missing Profile Fehlendes Profil
Paste Profile Mismatch Profilabweichung beim Einfügen
“{name}” is not tagged with a {model} profile. „{name}“ ist mit keinem {model}-Profil versehen.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. „{name}“ ist mit dem {model}-Profil „{profile}“ versehen, das nicht der {model}-Arbeitsfarbraum „{working}“ ist.
Use the embedded profile Eingebettetes Profil verwenden
Convert the colors to the working space Farben in den Arbeitsfarbraum konvertieren
Discard the embedded profile Eingebettetes Profil verwerfen
Leave as is Unverändert lassen
Assign the working space Arbeitsfarbraum zuweisen
Assign profile: Profil zuweisen:
Preserve the color numbers Farbwerte beibehalten
Convert to keep the colors' appearance Konvertieren, um das Aussehen der Farben zu erhalten
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Die eingefügten Farben stammen aus einem Dokument mit dem {model}-Profil „{from}“; dieses Dokument hat „{to}“.
# PSD files.
@msg not a PSD file keine PSD-Datei
@msg Multichannel PSD files can't be read: save it in RGB, CMYK or Grayscale mode PSD-Dateien im Mehrkanalmodus können nicht gelesen werden: Speichern Sie die Datei im RGB-, CMYK- oder Graustufenmodus
Can't render this file because it is too large.
+18
View File
@@ -5260,6 +5260,24 @@ digits Malayalam Μαλαγιάλαμ
Preserve Embedded Profiles Διατήρηση ενσωματωμένων προφίλ
Convert to Working Space Μετατροπή στον χώρο εργασίας
Preserve Numbers Διατήρηση αριθμών
Profile Mismatches: Αναντιστοιχίες προφίλ:
Ask When Opening Ερώτηση κατά το άνοιγμα
Ask When Pasting Ερώτηση κατά την επικόλληση
Missing Profiles: Προφίλ που λείπουν:
Embedded Profile Mismatch Αναντιστοιχία ενσωματωμένου προφίλ
Missing Profile Λείπει προφίλ
Paste Profile Mismatch Αναντιστοιχία προφίλ κατά την επικόλληση
“{name}” is not tagged with a {model} profile. Το «{name}» δεν έχει προφίλ {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. Το «{name}» έχει το προφίλ {model} «{profile}», που δεν είναι ο χώρος εργασίας {model} «{working}».
Use the embedded profile Χρήση του ενσωματωμένου προφίλ
Convert the colors to the working space Μετατροπή των χρωμάτων στον χώρο εργασίας
Discard the embedded profile Απόρριψη του ενσωματωμένου προφίλ
Leave as is Διατήρηση ως έχει
Assign the working space Αντιστοίχιση του χώρου εργασίας
Assign profile: Αντιστοίχιση προφίλ:
Preserve the color numbers Διατήρηση των αριθμών των χρωμάτων
Convert to keep the colors' appearance Μετατροπή με διατήρηση της εμφάνισης των χρωμάτων
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Τα χρώματα που επικολλήθηκαν προέρχονται από έγγραφο με προφίλ {model} «{from}»· το προφίλ αυτού του εγγράφου είναι «{to}».
System Title Bar Γραμμή τίτλου συστήματος
VectorCraft Title Bar on Every Desktop Γραμμή τίτλου του VectorCraft σε κάθε επιφάνεια εργασίας
The VECTORCRAFT_TITLEBAR environment variable chooses the title bar while it is set. Όσο είναι ορισμένη, η μεταβλητή περιβάλλοντος VECTORCRAFT_TITLEBAR επιλέγει τη γραμμή τίτλου.
Can't render this file because it is too large.
+18
View File
@@ -5308,6 +5308,24 @@ axis Both Ambos
Preserve Embedded Profiles Conservar perfiles incrustados
Convert to Working Space Convertir en espacio de trabajo
Preserve Numbers Conservar números
Profile Mismatches: Discrepancias de perfil:
Ask When Opening Preguntar al abrir
Ask When Pasting Preguntar al pegar
Missing Profiles: Perfiles que faltan:
Embedded Profile Mismatch Discrepancia del perfil incrustado
Missing Profile Falta el perfil
Paste Profile Mismatch Discrepancia de perfil al pegar
“{name}” is not tagged with a {model} profile. “{name}” no tiene un perfil {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}” tiene el perfil {model} “{profile}”, que no es el espacio de trabajo {model} “{working}”.
Use the embedded profile Usar el perfil incrustado
Convert the colors to the working space Convertir los colores al espacio de trabajo
Discard the embedded profile Descartar el perfil incrustado
Leave as is Dejar como está
Assign the working space Asignar el espacio de trabajo
Assign profile: Asignar perfil:
Preserve the color numbers Conservar los valores de color
Convert to keep the colors' appearance Convertir para conservar el aspecto de los colores
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Los colores pegados provienen de un documento con el perfil {model} “{from}”; el de este documento es “{to}”.
Texture Textura
Craquelure… Craquelado…
Grain… Granulado…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+18
View File
@@ -992,6 +992,24 @@
Preserve Embedded Profiles Säilytä upotetut profiilit
Convert to Working Space Muunna työväriavaruuteen
Preserve Numbers Säilytä lukuarvot
Profile Mismatches: Profiilien ristiriidat:
Ask When Opening Kysy avattaessa
Ask When Pasting Kysy liitettäessä
Missing Profiles: Puuttuvat profiilit:
Embedded Profile Mismatch Upotetun profiilin ristiriita
Missing Profile Profiili puuttuu
Paste Profile Mismatch Profiiliristiriita liitettäessä
“{name}” is not tagged with a {model} profile. Kohteella ”{name}” ei ole {model}-profiilia.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. Kohteella ”{name}” on {model}-profiili ”{profile}”, joka ei ole {model}-työväriavaruus ”{working}”.
Use the embedded profile Käytä upotettua profiilia
Convert the colors to the working space Muunna värit työväriavaruuteen
Discard the embedded profile Hylkää upotettu profiili
Leave as is Jätä ennalleen
Assign the working space Määritä työväriavaruus
Assign profile: Määritä profiili:
Preserve the color numbers Säilytä värien lukuarvot
Convert to keep the colors' appearance Muunna ja säilytä värien ulkoasu
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Liitetyt värit ovat asiakirjasta, jonka {model}-profiili on ”{from}”; tämän asiakirjan profiili on ”{to}”.
CMYK CMYK
Texture Tekstuuri
Craquelure… Krakelyyri…
Can't render this file because it contains an unexpected character in line 2 and column 73.
+18
View File
@@ -5314,6 +5314,24 @@ axis Both Les deux
Preserve Embedded Profiles Conserver les profils incorporés
Convert to Working Space Convertir en espace de travail
Preserve Numbers Conserver les valeurs numériques
Profile Mismatches: Non-concordance des profils :
Ask When Opening Demander à l’ouverture
Ask When Pasting Demander au collage
Missing Profiles: Profils manquants :
Embedded Profile Mismatch Non-concordance du profil incorporé
Missing Profile Profil manquant
Paste Profile Mismatch Non-concordance de profil au collage
“{name}” is not tagged with a {model} profile. « {name} » n’a pas de profil {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. « {name} » a le profil {model} « {profile} », qui n’est pas l’espace de travail {model} « {working} ».
Use the embedded profile Utiliser le profil incorporé
Convert the colors to the working space Convertir les couleurs dans l’espace de travail
Discard the embedded profile Supprimer le profil incorporé
Leave as is Laisser tel quel
Assign the working space Attribuer l’espace de travail
Assign profile: Attribuer le profil :
Preserve the color numbers Conserver les valeurs des couleurs
Convert to keep the colors' appearance Convertir pour conserver l’aspect des couleurs
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Les couleurs collées proviennent d’un document dont le profil {model} est « {from} » ; celui de ce document est « {to} ».
Texture Texture
Craquelure… Craquelure…
Grain… Grain…
Can't render this file because it is too large.
+18
View File
@@ -476,6 +476,24 @@
Preserve Embedded Profiles એમ્બેડ કરેલી પ્રોફાઇલ જાળવો
Convert to Working Space કાર્યકારી સ્પેસમાં રૂપાંતરિત કરો
Preserve Numbers સંખ્યાઓ જાળવો
Profile Mismatches: પ્રોફાઇલ મેળ ન ખાવા:
Ask When Opening ખોલતી વખતે પૂછો
Ask When Pasting પેસ્ટ કરતી વખતે પૂછો
Missing Profiles: ખૂટતી પ્રોફાઇલ:
Embedded Profile Mismatch એમ્બેડ કરેલી પ્રોફાઇલ મેળ ખાતી નથી
Missing Profile પ્રોફાઇલ ખૂટે છે
Paste Profile Mismatch પેસ્ટ કરતી વખતે પ્રોફાઇલ મેળ ખાતી નથી
“{name}” is not tagged with a {model} profile. “{name}” પાસે કોઈ {model} પ્રોફાઇલ નથી.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}” પાસે {model} પ્રોફાઇલ “{profile}” છે, જે {model} કાર્યકારી સ્પેસ “{working}” નથી.
Use the embedded profile એમ્બેડ કરેલી પ્રોફાઇલ વાપરો
Convert the colors to the working space રંગોને કાર્યકારી સ્પેસમાં રૂપાંતરિત કરો
Discard the embedded profile એમ્બેડ કરેલી પ્રોફાઇલ કાઢી નાખો
Leave as is જેમ છે તેમ રહેવા દો
Assign the working space કાર્યકારી સ્પેસ સોંપો
Assign profile: પ્રોફાઇલ સોંપો:
Preserve the color numbers રંગોની સંખ્યાઓ જાળવો
Convert to keep the colors' appearance રંગોનો દેખાવ જાળવવા રૂપાંતરિત કરો
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. પેસ્ટ કરેલા રંગો એવા દસ્તાવેજમાંથી આવે છે જેની {model} પ્રોફાઇલ “{from}” છે; આ દસ્તાવેજની “{to}” છે.
CSS Properties CSS ગુણધર્મો
Calligraphic Brush કેલિગ્રાફિક બ્રશ
Calligraphic Brush Options કેલિગ્રાફિક બ્રશ વિકલ્પો
Can't render this file because it contains an unexpected character in line 72 and column 5.
+18
View File
@@ -889,6 +889,24 @@ antiAlias Sharp शार्प
Preserve Embedded Profiles एम्बेड की गई प्रोफ़ाइल बनाए रखें
Convert to Working Space वर्किंग स्पेस में बदलें
Preserve Numbers संख्याएँ बनाए रखें
Profile Mismatches: प्रोफ़ाइल बेमेल:
Ask When Opening खोलते समय पूछें
Ask When Pasting पेस्ट करते समय पूछें
Missing Profiles: अनुपलब्ध प्रोफ़ाइल:
Embedded Profile Mismatch एम्बेड की गई प्रोफ़ाइल बेमेल
Missing Profile प्रोफ़ाइल अनुपलब्ध
Paste Profile Mismatch पेस्ट करते समय प्रोफ़ाइल बेमेल
“{name}” is not tagged with a {model} profile. "{name}" में कोई {model} प्रोफ़ाइल नहीं है।
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. "{name}" में {model} प्रोफ़ाइल "{profile}" है, जो {model} वर्किंग स्पेस "{working}" नहीं है।
Use the embedded profile एम्बेड की गई प्रोफ़ाइल का उपयोग करें
Convert the colors to the working space रंगों को वर्किंग स्पेस में बदलें
Discard the embedded profile एम्बेड की गई प्रोफ़ाइल हटाएं
Leave as is जैसा है वैसा रहने दें
Assign the working space वर्किंग स्पेस असाइन करें
Assign profile: प्रोफ़ाइल असाइन करें:
Preserve the color numbers रंगों की संख्याएँ बनाए रखें
Convert to keep the colors' appearance रंगों का रूप बनाए रखने के लिए बदलें
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. पेस्ट किए गए रंग ऐसे दस्तावेज़ से आए हैं जिसकी {model} प्रोफ़ाइल "{from}" है; इस दस्तावेज़ की "{to}" है।
Coarse Dots मोटे बिंदु
Coincidence: संयोग:
Collapse Panel Group पैनल समूह संक्षिप्त करें
Can't render this file because it is too large.
+18
View File
@@ -700,6 +700,24 @@ font-technology Variable Változó
Preserve Embedded Profiles Beágyazott profilok megtartása
Convert to Working Space Konvertálás a munkaszíntérbe
Preserve Numbers Számértékek megtartása
Profile Mismatches: Profileltérések:
Ask When Opening Kérdezzen megnyitáskor
Ask When Pasting Kérdezzen beillesztéskor
Missing Profiles: Hiányzó profilok:
Embedded Profile Mismatch Eltérő beágyazott profil
Missing Profile Hiányzó profil
Paste Profile Mismatch Profileltérés beillesztéskor
“{name}” is not tagged with a {model} profile. „{name}” nem rendelkezik {model}-profillal.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. „{name}” {model}-profilja „{profile}”, amely nem a(z) „{working}” {model}-munkaszíntér.
Use the embedded profile A beágyazott profil használata
Convert the colors to the working space A színek konvertálása a munkaszíntérbe
Discard the embedded profile A beágyazott profil elvetése
Leave as is Változatlanul hagyás
Assign the working space A munkaszíntér hozzárendelése
Assign profile: Profil hozzárendelése:
Preserve the color numbers A színértékek megtartása
Convert to keep the colors' appearance Konvertálás a színek megjelenésének megtartásával
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. A beillesztett színek olyan dokumentumból származnak, amelynek {model}-profilja „{from}”; ennek a dokumentumnak „{to}”.
Coarse Dots Durva pontok
Collapse Panels to Icons Panelek ikonná csukása
Collapse to Icons Ikonná csukás
Can't render this file because it is too large.
+18
View File
@@ -931,6 +931,24 @@
Preserve Embedded Profiles Pertahankan Profil Tersemat
Convert to Working Space Konversi ke Ruang Kerja
Preserve Numbers Pertahankan Angka
Profile Mismatches: Ketidakcocokan Profil:
Ask When Opening Tanya Saat Membuka
Ask When Pasting Tanya Saat Menempel
Missing Profiles: Profil yang Hilang:
Embedded Profile Mismatch Ketidakcocokan Profil Tersemat
Missing Profile Profil Hilang
Paste Profile Mismatch Ketidakcocokan Profil Saat Menempel
“{name}” is not tagged with a {model} profile. “{name}” tidak memiliki profil {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}” memiliki profil {model} “{profile}”, yang bukan ruang kerja {model} “{working}”.
Use the embedded profile Gunakan profil tersemat
Convert the colors to the working space Konversi warna ke ruang kerja
Discard the embedded profile Buang profil tersemat
Leave as is Biarkan apa adanya
Assign the working space Tetapkan ruang kerja
Assign profile: Tetapkan profil:
Preserve the color numbers Pertahankan angka warna
Convert to keep the colors' appearance Konversi agar tampilan warna tetap sama
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Warna yang ditempel berasal dari dokumen dengan profil {model} “{from}”; profil dokumen ini “{to}”.
CMYK CMYK
Texture Tekstur
Craquelure… Craquelure…
1 # Indonesian (id) catalog. Same format as zh-hant.tsv: context <TAB> source <TAB> translation
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
+18
View File
@@ -5359,6 +5359,24 @@ axis Both Entrambi
Preserve Embedded Profiles Mantieni profili incorporati
Convert to Working Space Converti nello spazio di lavoro
Preserve Numbers Mantieni valori numerici
Profile Mismatches: Mancata corrispondenza profili:
Ask When Opening Chiedi all'apertura
Ask When Pasting Chiedi quando si incolla
Missing Profiles: Profili mancanti:
Embedded Profile Mismatch Profilo incorporato non corrispondente
Missing Profile Profilo mancante
Paste Profile Mismatch Profilo non corrispondente nell'incollare
“{name}” is not tagged with a {model} profile. “{name}” non ha un profilo {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}” ha il profilo {model} “{profile}”, che non è lo spazio di lavoro {model} “{working}”.
Use the embedded profile Usa il profilo incorporato
Convert the colors to the working space Converti i colori nello spazio di lavoro
Discard the embedded profile Elimina il profilo incorporato
Leave as is Lascia invariato
Assign the working space Assegna lo spazio di lavoro
Assign profile: Assegna profilo:
Preserve the color numbers Mantieni i valori dei colori
Convert to keep the colors' appearance Converti per mantenere l'aspetto dei colori
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. I colori incollati provengono da un documento con profilo {model} “{from}”; quello di questo documento è “{to}”.
Texture Texture
Craquelure… Craquelé…
Grain… Granulosità…
Can't render this file because it is too large.
+18
View File
@@ -5400,6 +5400,24 @@ swatch Bright Violet ビビッドバイオレット
Preserve Embedded Profiles 埋め込まれたプロファイルを保持
Convert to Working Space 作業用スペースに変換
Preserve Numbers カラー値を保持
Profile Mismatches: プロファイルの不一致:
Ask When Opening 開くときに確認
Ask When Pasting ペーストするときに確認
Missing Profiles: プロファイルの欠落:
Embedded Profile Mismatch 埋め込まれたプロファイルの不一致
Missing Profile プロファイルの欠落
Paste Profile Mismatch ペースト時のプロファイルの不一致
“{name}” is not tagged with a {model} profile. 「{name}」には {model} プロファイルがありません。
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. 「{name}」の {model} プロファイルは「{profile}」で、{model} 作業用スペース「{working}」ではありません。
Use the embedded profile 埋め込まれたプロファイルを使用
Convert the colors to the working space カラーを作業用スペースに変換
Discard the embedded profile 埋め込まれたプロファイルを破棄
Leave as is そのままにする
Assign the working space 作業用スペースを割り当て
Assign profile: プロファイルを割り当て:
Preserve the color numbers カラーの数値を保持
Convert to keep the colors' appearance カラーの見た目を保つように変換
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. ペーストしたカラーは {model} プロファイルが「{from}」のドキュメントのものです。このドキュメントのプロファイルは「{to}」です。
Texture テクスチャ
Craquelure… クラッキング…
Grain… 粒状…
Can't render this file because it is too large.
+18
View File
@@ -897,6 +897,24 @@
Preserve Embedded Profiles ჩაშენებული პროფილების შენარჩუნება
Convert to Working Space სამუშაო სივრცეში გადაყვანა
Preserve Numbers რიცხვების შენარჩუნება
Profile Mismatches: პროფილების შეუსაბამობა:
Ask When Opening გახსნისას კითხვა
Ask When Pasting ჩასმისას კითხვა
Missing Profiles: დაკარგული პროფილები:
Embedded Profile Mismatch ჩაშენებული პროფილის შეუსაბამობა
Missing Profile პროფილი არ არის
Paste Profile Mismatch პროფილის შეუსაბამობა ჩასმისას
“{name}” is not tagged with a {model} profile. „{name}“-ს არ აქვს {model} პროფილი.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. „{name}“-ს აქვს {model} პროფილი „{profile}“, რომელიც არ არის {model} სამუშაო სივრცე „{working}“.
Use the embedded profile ჩაშენებული პროფილის გამოყენება
Convert the colors to the working space ფერების სამუშაო სივრცეში გადაყვანა
Discard the embedded profile ჩაშენებული პროფილის უგულებელყოფა
Leave as is უცვლელად დატოვება
Assign the working space სამუშაო სივრცის მინიჭება
Assign profile: პროფილის მინიჭება:
Preserve the color numbers ფერების რიცხვების შენარჩუნება
Convert to keep the colors' appearance გადაყვანა ფერების იერსახის შესანარჩუნებლად
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. ჩასმული ფერები მოდის დოკუმენტიდან, რომლის {model} პროფილია „{from}“; ამ დოკუმენტის პროფილია „{to}“.
CMYK CMYK
Texture ტექსტურა
Craquelure… კრაკელიური…
Can't render this file because it is too large.
+18
View File
@@ -5327,6 +5327,24 @@ theme Appearance 외관
Preserve Embedded Profiles 포함된 프로필 유지
Convert to Working Space 작업 공간으로 변환
Preserve Numbers 숫자 유지
Profile Mismatches: 프로필 불일치:
Ask When Opening 열 때 묻기
Ask When Pasting 붙여넣을 때 묻기
Missing Profiles: 누락된 프로필:
Embedded Profile Mismatch 포함된 프로필 불일치
Missing Profile 프로필 없음
Paste Profile Mismatch 붙여넣기 프로필 불일치
“{name}” is not tagged with a {model} profile. “{name}”에 {model} 프로필이 없습니다.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}”의 {model} 프로필은 “{profile}”이며, {model} 작업 공간 “{working}”이(가) 아닙니다.
Use the embedded profile 포함된 프로필 사용
Convert the colors to the working space 색상을 작업 공간으로 변환
Discard the embedded profile 포함된 프로필 버리기
Leave as is 그대로 두기
Assign the working space 작업 공간 지정
Assign profile: 프로필 지정:
Preserve the color numbers 색상 값 유지
Convert to keep the colors' appearance 색상의 모양을 유지하도록 변환
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. 붙여넣은 색상은 {model} 프로필이 “{from}”인 문서에서 왔습니다. 이 문서의 프로필은 “{to}”입니다.
Texture 텍스처
Craquelure… 크랙…
Grain… 그레인…
Can't render this file because it is too large.
+18
View File
@@ -1449,6 +1449,24 @@
Preserve Embedded Profiles Ingesloten profielen behouden
Convert to Working Space Omzetten naar werkruimte
Preserve Numbers Waarden behouden
Profile Mismatches: Profielverschillen:
Ask When Opening Vragen bij openen
Ask When Pasting Vragen bij plakken
Missing Profiles: Ontbrekende profielen:
Embedded Profile Mismatch Ingesloten profiel komt niet overeen
Missing Profile Ontbrekend profiel
Paste Profile Mismatch Profielverschil bij plakken
“{name}” is not tagged with a {model} profile. „{name}” heeft geen {model}-profiel.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. „{name}” heeft het {model}-profiel „{profile}”, dat niet de {model}-werkruimte „{working}” is.
Use the embedded profile Ingesloten profiel gebruiken
Convert the colors to the working space Kleuren omzetten naar de werkruimte
Discard the embedded profile Ingesloten profiel negeren
Leave as is Laten zoals het is
Assign the working space Werkruimte toewijzen
Assign profile: Profiel toewijzen:
Preserve the color numbers Kleurwaarden behouden
Convert to keep the colors' appearance Omzetten zodat de kleuren er hetzelfde uitzien
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. De geplakte kleuren komen uit een document met het {model}-profiel „{from}”; dat van dit document is „{to}”.
CMYK CMYK
Texture Textuur
Craquelure… Craquelure…
Can't render this file because it is too large.
+18
View File
@@ -949,6 +949,24 @@
Preserve Embedded Profiles Zachowaj osadzone profile
Convert to Working Space Konwertuj do przestrzeni roboczej
Preserve Numbers Zachowaj wartości liczbowe
Profile Mismatches: Niezgodność profili:
Ask When Opening Pytaj przy otwieraniu
Ask When Pasting Pytaj przy wklejaniu
Missing Profiles: Brakujące profile:
Embedded Profile Mismatch Niezgodność osadzonego profilu
Missing Profile Brak profilu
Paste Profile Mismatch Niezgodność profilu przy wklejaniu
“{name}” is not tagged with a {model} profile. „{name}” nie ma profilu {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. „{name}” ma profil {model} „{profile}”, który nie jest przestrzenią roboczą {model} „{working}”.
Use the embedded profile Użyj osadzonego profilu
Convert the colors to the working space Konwertuj kolory do przestrzeni roboczej
Discard the embedded profile Odrzuć osadzony profil
Leave as is Pozostaw bez zmian
Assign the working space Przypisz przestrzeń roboczą
Assign profile: Przypisz profil:
Preserve the color numbers Zachowaj wartości kolorów
Convert to keep the colors' appearance Konwertuj, aby zachować wygląd kolorów
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Wklejone kolory pochodzą z dokumentu z profilem {model} „{from}”; profil tego dokumentu to „{to}”.
CMYK CMYK
Texture Tekstura
Craquelure… Spękania…
Can't render this file because it is too large.
+18
View File
@@ -3504,6 +3504,24 @@ imageTrace Outline Contorno
Preserve Embedded Profiles Preservar perfis incorporados
Convert to Working Space Converter para espaço de trabalho
Preserve Numbers Preservar números
Profile Mismatches: Incompatibilidades de perfil:
Ask When Opening Perguntar ao abrir
Ask When Pasting Perguntar ao colar
Missing Profiles: Perfis ausentes:
Embedded Profile Mismatch Incompatibilidade do perfil incorporado
Missing Profile Perfil ausente
Paste Profile Mismatch Incompatibilidade de perfil ao colar
“{name}” is not tagged with a {model} profile. “{name}” não tem um perfil {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}” tem o perfil {model} “{profile}”, que não é o espaço de trabalho {model} “{working}”.
Use the embedded profile Usar o perfil incorporado
Convert the colors to the working space Converter as cores para o espaço de trabalho
Discard the embedded profile Descartar o perfil incorporado
Leave as is Deixar como está
Assign the working space Atribuir o espaço de trabalho
Assign profile: Atribuir perfil:
Preserve the color numbers Preservar os valores das cores
Convert to keep the colors' appearance Converter para manter a aparência das cores
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. As cores coladas vêm de um documento com o perfil {model} “{from}”; o deste documento é “{to}”.
Texture Textura
Craquelure… Craquelê…
Grain… Granulação…
Can't render this file because it is too large.
+18
View File
@@ -5347,6 +5347,24 @@ axis Both Оба
Preserve Embedded Profiles Сохранять встроенные профили
Convert to Working Space Преобразовывать в рабочее пространство
Preserve Numbers Сохранять числа
Profile Mismatches: Несоответствие профилей:
Ask When Opening Спрашивать при открытии
Ask When Pasting Спрашивать при вставке
Missing Profiles: Отсутствующие профили:
Embedded Profile Mismatch Несоответствие встроенного профиля
Missing Profile Отсутствует профиль
Paste Profile Mismatch Несоответствие профиля при вставке
“{name}” is not tagged with a {model} profile. У «{name}» нет профиля {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. У «{name}» профиль {model} «{profile}», который не является рабочим пространством {model} «{working}».
Use the embedded profile Использовать встроенный профиль
Convert the colors to the working space Преобразовать цвета в рабочее пространство
Discard the embedded profile Отбросить встроенный профиль
Leave as is Оставить как есть
Assign the working space Назначить рабочее пространство
Assign profile: Назначить профиль:
Preserve the color numbers Сохранить числовые значения цветов
Convert to keep the colors' appearance Преобразовать, сохранив вид цветов
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Вставленные цвета взяты из документа с профилем {model} «{from}»; у этого документа профиль «{to}».
Texture Текстура
Craquelure… Кракелюры…
Grain… Зерно…
Can't render this file because it is too large.
+18
View File
@@ -5218,6 +5218,24 @@ axis Both Båda
Preserve Embedded Profiles Behåll inbäddade profiler
Convert to Working Space Konvertera till arbetsfärgrymd
Preserve Numbers Behåll värden
Profile Mismatches: Profilavvikelser:
Ask When Opening Fråga vid öppning
Ask When Pasting Fråga vid inklistring
Missing Profiles: Profiler som saknas:
Embedded Profile Mismatch Avvikande inbäddad profil
Missing Profile Profil saknas
Paste Profile Mismatch Profilavvikelse vid inklistring
“{name}” is not tagged with a {model} profile. ”{name}” har ingen {model}-profil.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. ”{name}” har {model}-profilen ”{profile}”, som inte är {model}-arbetsfärgrymden ”{working}”.
Use the embedded profile Använd den inbäddade profilen
Convert the colors to the working space Konvertera färgerna till arbetsfärgrymden
Discard the embedded profile Ignorera den inbäddade profilen
Leave as is Lämna som det är
Assign the working space Tilldela arbetsfärgrymden
Assign profile: Tilldela profil:
Preserve the color numbers Behåll färgvärdena
Convert to keep the colors' appearance Konvertera så att färgerna ser likadana ut
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. De inklistrade färgerna kommer från ett dokument med {model}-profilen ”{from}”; det här dokumentets är ”{to}”.
Texture Textur
Craquelure… Krakelering…
Grain… Korn…
Can't render this file because it is too large.
+18
View File
@@ -5114,6 +5114,24 @@ axis Both Her İkisi
Preserve Embedded Profiles Gömülü Profilleri Koru
Convert to Working Space Çalışma Alanına Dönüştür
Preserve Numbers Sayıları Koru
Profile Mismatches: Profil Uyuşmazlıkları:
Ask When Opening Açarken Sor
Ask When Pasting Yapıştırırken Sor
Missing Profiles: Eksik Profiller:
Embedded Profile Mismatch Gömülü Profil Uyuşmazlığı
Missing Profile Eksik Profil
Paste Profile Mismatch Yapıştırma Profili Uyuşmazlığı
“{name}” is not tagged with a {model} profile. “{name}” bir {model} profiline sahip değil.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}”, {model} çalışma alanı “{working}” olmayan “{profile}” {model} profiline sahip.
Use the embedded profile Gömülü profili kullan
Convert the colors to the working space Renkleri çalışma alanına dönüştür
Discard the embedded profile Gömülü profili at
Leave as is Olduğu gibi bırak
Assign the working space Çalışma alanını ata
Assign profile: Profil ata:
Preserve the color numbers Renk değerlerini koru
Convert to keep the colors' appearance Renklerin görünümünü korumak için dönüştür
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Yapıştırılan renkler {model} profili “{from}” olan bir belgeden geliyor; bu belgeninki “{to}”.
Texture Doku
Craquelure… Küçük çatlak…
Grain… Tahıl…
Can't render this file because it contains an unexpected character in line 5 and column 25.
+18
View File
@@ -5343,6 +5343,24 @@ axis Both Обидві
Preserve Embedded Profiles Зберігати вбудовані профілі
Convert to Working Space Перетворювати в робочий простір
Preserve Numbers Зберігати числа
Profile Mismatches: Невідповідність профілів:
Ask When Opening Питати під час відкриття
Ask When Pasting Питати під час вставлення
Missing Profiles: Відсутні профілі:
Embedded Profile Mismatch Невідповідність вбудованого профілю
Missing Profile Відсутній профіль
Paste Profile Mismatch Невідповідність профілю під час вставлення
“{name}” is not tagged with a {model} profile. «{name}» не має профілю {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. «{name}» має профіль {model} «{profile}», який не є робочим простором {model} «{working}».
Use the embedded profile Використати вбудований профіль
Convert the colors to the working space Перетворити кольори в робочий простір
Discard the embedded profile Відкинути вбудований профіль
Leave as is Залишити як є
Assign the working space Призначити робочий простір
Assign profile: Призначити профіль:
Preserve the color numbers Зберегти числові значення кольорів
Convert to keep the colors' appearance Перетворити, зберігши вигляд кольорів
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Вставлені кольори взято з документа з профілем {model} «{from}»; профіль цього документа «{to}».
Texture Текстура
Craquelure… Кракелюри…
Grain… Зерно…
Can't render this file because it is too large.
+18
View File
@@ -612,6 +612,24 @@ font-technology Variable Biến thiên
Preserve Embedded Profiles Giữ cấu hình nhúng
Convert to Working Space Chuyển sang không gian làm việc
Preserve Numbers Giữ giá trị số
Profile Mismatches: Cấu hình không khớp:
Ask When Opening Hỏi khi mở
Ask When Pasting Hỏi khi dán
Missing Profiles: Cấu hình bị thiếu:
Embedded Profile Mismatch Cấu hình nhúng không khớp
Missing Profile Thiếu cấu hình
Paste Profile Mismatch Cấu hình không khớp khi dán
“{name}” is not tagged with a {model} profile. “{name}” không có cấu hình {model}.
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}” có cấu hình {model} “{profile}”, không phải không gian làm việc {model} “{working}”.
Use the embedded profile Dùng cấu hình nhúng
Convert the colors to the working space Chuyển màu sang không gian làm việc
Discard the embedded profile Bỏ cấu hình nhúng
Leave as is Giữ nguyên
Assign the working space Gán không gian làm việc
Assign profile: Gán cấu hình:
Preserve the color numbers Giữ giá trị số của màu
Convert to keep the colors' appearance Chuyển đổi để giữ diện mạo của màu
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. Màu đã dán đến từ tài liệu có cấu hình {model} “{from}”; cấu hình của tài liệu này là “{to}”.
Coarse Dots Chấm thô
Collapse Panels to Icons Thu gọn bảng thành biểu tượng
Collapse to Icons Thu gọn thành biểu tượng
Can't render this file because it contains an unexpected character in line 204 and column 5.
+18
View File
@@ -5247,6 +5247,24 @@ imageTrace Outline 轮廓
Preserve Embedded Profiles 保留嵌入的配置文件
Convert to Working Space 转换为工作空间
Preserve Numbers 保留数值
Profile Mismatches: 配置文件不匹配:
Ask When Opening 打开时询问
Ask When Pasting 粘贴时询问
Missing Profiles: 缺少配置文件:
Embedded Profile Mismatch 嵌入的配置文件不匹配
Missing Profile 缺少配置文件
Paste Profile Mismatch 粘贴时配置文件不匹配
“{name}” is not tagged with a {model} profile. “{name}”没有 {model} 配置文件。
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. “{name}”的 {model} 配置文件为“{profile}”,不是 {model} 工作空间“{working}”。
Use the embedded profile 使用嵌入的配置文件
Convert the colors to the working space 将颜色转换为工作空间
Discard the embedded profile 放弃嵌入的配置文件
Leave as is 保持原样
Assign the working space 指定工作空间
Assign profile: 指定配置文件:
Preserve the color numbers 保留颜色数值
Convert to keep the colors' appearance 转换以保持颜色外观
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. 粘贴的颜色来自 {model} 配置文件为“{from}”的文档;此文档的配置文件为“{to}”。
Art & Illustration 艺术和插画
Branding 品牌
Film & Video 影片和视频
Can't render this file because it is too large.
+18
View File
@@ -5477,6 +5477,24 @@ axis Both 兩者
Preserve Embedded Profiles 保留內嵌描述檔
Convert to Working Space 轉換為工作空間
Preserve Numbers 保留數值
Profile Mismatches: 描述檔不符:
Ask When Opening 開啟時詢問
Ask When Pasting 貼上時詢問
Missing Profiles: 遺失的描述檔:
Embedded Profile Mismatch 內嵌描述檔不符
Missing Profile 遺失描述檔
Paste Profile Mismatch 貼上時描述檔不符
“{name}” is not tagged with a {model} profile. 「{name}」沒有 {model} 描述檔。
“{name}” is tagged with the {model} profile “{profile}”, which is not the {model} working space “{working}”. 「{name}」的 {model} 描述檔為「{profile}」,不是 {model} 工作空間「{working}」。
Use the embedded profile 使用內嵌描述檔
Convert the colors to the working space 將色彩轉換為工作空間
Discard the embedded profile 捨棄內嵌描述檔
Leave as is 保持原狀
Assign the working space 指定工作空間
Assign profile: 指定描述檔:
Preserve the color numbers 保留色彩數值
Convert to keep the colors' appearance 轉換以保持色彩外觀
The pasted colors come from a document whose {model} profile is “{from}”; this document's is “{to}”. 貼上的色彩來自 {model} 描述檔為「{from}」的文件;此文件的描述檔為「{to}」。
Texture 紋理
Craquelure… 龜裂紋…
Grain… 顆粒…
Can't render this file because it is too large.
+1
View File
@@ -26,6 +26,7 @@ pub(crate) use export::{
EXPORT_SELECTION, export_files, exported_with_notes, file_url, open_in_app, open_original, reveal_path, run_to_file, save_command_output_named,
selection_path,
};
pub(crate) use open::asks_first;
pub(crate) use open::report_installed;
pub(crate) use open::{EXPORT_PRESETS, import_presets, open_notes, open_with_on, opened, opened_after_notice, show_opened};
pub use open::{
+18 -8
View File
@@ -129,11 +129,19 @@ pub fn opens_as(name: &str) -> Option<OpensAs> {
}
/// Open a document through the engine loader with the `document.open` options in `p` →
/// `document.open`'s result.
/// `document.open`'s result, or `{dialog}` when Edit › Color Settings asks about its profile first
/// ([`dialogs::profile_mismatch::open_or_ask`]): the document then opens, and goes on the recent
/// files, once the question is answered.
pub fn open_document(app: &mut VectorcraftApp, name: &str, bytes: &[u8], path: Option<String>, p: &Value) -> Result<Value, String> {
let r = fileio::open_bytes_with(&mut app.session, name, bytes, path, p).map_err(|e| e.to_string())?;
opened(app, &r);
Ok(r)
let update_links = app.session.prefs.update_links == "automatically";
let low_res_proxy_eps = app.session.prefs.low_res_proxy_eps;
let file = fileio::read_for_open_asking(name, bytes, path.clone(), p, update_links, low_res_proxy_eps, true).map_err(|e| e.to_string())?;
dialogs::profile_mismatch::open_or_ask(app, file, path)
}
/// Did an open answer that it asks a question first (`{dialog}`), so the file isn't open yet?
pub(crate) fn asks_first(r: &Value) -> bool {
r.get("dialog").is_some()
}
/// A document just opened (`r`: `document.open`'s result): the views follow, the status bar says
@@ -400,9 +408,8 @@ pub(crate) fn open_with_on(app: &mut VectorcraftApp, p: &Value, background: bool
Err(back) => bytes = back,
}
}
let r = open_document(app, &path, &bytes, Some(path.clone()), &o)?;
note_recent(app, &path);
Ok(r)
// The open notes it on the recent files, after any question it asks first.
open_document(app, &path, &bytes, Some(path.clone()), &o)
});
if let Err(e) = &opened {
report_open_error(app, &fileio::file_name(&path), e);
@@ -566,7 +573,10 @@ fn open_file_with(app: &mut VectorcraftApp, path: &str, background: bool, p: &Va
}
}
let r = open_bytes_with(app, path, &bytes, Some(path.to_string()), p)?;
note_recent(app, path);
// A document that asks a question first goes on the recent files once it opens.
if !asks_first(&r) {
note_recent(app, path);
}
Ok(r)
}
+3
View File
@@ -344,6 +344,9 @@ pub struct VectorcraftApp {
/// The plug-in install the approval dialog asks about, kept out of the dialog's fields, which
/// `ui.dialog.set` writes.
pub(crate) pending_plugin_install: Option<dialogs::plugin::PendingInstall>,
/// The file File › Open read that waits for the answer to its profile question
/// ([`dialogs::profile_mismatch`]), kept out of the dialog's fields.
pub(crate) pending_profile_open: Option<dialogs::profile_mismatch::PendingOpen>,
/// The pen end the canvas saw last and the tool its eraser end stands in for
/// ([`stylus::sync_eraser_tool`]).
pub(crate) pen_end: stylus::PenEnd,
+9 -9
View File
@@ -89,7 +89,9 @@ pub fn start_with(app: &mut VectorcraftApp, path: &str, bytes: Vec<u8>, params:
.run(|| {
vectorcraft_engine::guard::catch_panic(|| {
cancel::scope(&raised, None, || {
fileio::read_for_open(&name, &file, Some(name.clone()), &params, update_links, low_res_proxy_eps).map_err(|e| e.to_string())
// A profile question Edit › Color Settings asks waits for the UI thread.
fileio::read_for_open_asking(&name, &file, Some(name.clone()), &params, update_links, low_res_proxy_eps, true)
.map_err(|e| e.to_string())
})
})
})
@@ -234,15 +236,13 @@ pub fn show(app: &mut VectorcraftApp, ctx: &egui::Context) {
}
}
/// Open a file read off the UI thread, as [`crate::io::open_reporting`] opens one read at once.
/// Open a file read off the UI thread, as [`crate::io::open_reporting`] opens one read at once,
/// after the profile question Edit › Color Settings asks about it, if any
/// ([`crate::dialogs::profile_mismatch::open_or_ask`]).
fn finish(app: &mut VectorcraftApp, path: &str, r: Result<ReadFile, String>) {
let opened = r.and_then(|file| fileio::open_read(&mut app.session, file).map_err(|e| e.to_string()));
match opened {
Ok(r) => {
crate::io::opened(app, &r);
crate::io::note_recent(app, path);
}
Err(e) => crate::io::report_open_error(app, &fileio::file_name(path), &e),
let opened = r.and_then(|file| crate::dialogs::profile_mismatch::open_or_ask(app, file, Some(path.to_string())));
if let Err(e) = opened {
crate::io::report_open_error(app, &fileio::file_name(path), &e);
}
}
+18 -2
View File
@@ -102,8 +102,8 @@ fn settings_section(app: &mut VectorcraftApp, ui: &mut Ui) {
}
/// The section's rows: the RGB and CMYK working spaces, intent, black point compensation, the RGB
/// and CMYK color management policies, Load
/// Profile… and Gamut Check, and the profile the active document is assigned.
/// and CMYK color management policies, the Ask boxes of Profile Mismatches and Missing Profiles,
/// Load Profile… and Gamut Check, and the profile the active document is assigned.
fn settings_rows(app: &mut VectorcraftApp, ui: &mut Ui) {
let st = cms::working_settings();
widgets::section_header(ui, tl!("Color Settings"));
@@ -144,6 +144,22 @@ fn settings_rows(app: &mut VectorcraftApp, ui: &mut Ui) {
}
});
}
// Profile Mismatches and Missing Profiles: what opening and pasting ask about.
let asks: [(&str, &str, &str, bool); 3] = [
("askMismatchOpen", tl!("Profile Mismatches:"), tl!("Ask When Opening"), st.ask_mismatch_open),
("askMismatchPaste", "", tl!("Ask When Pasting"), st.ask_mismatch_paste),
("askMissingOpen", tl!("Missing Profiles:"), tl!("Ask When Opening"), st.ask_missing_open),
];
for (key, heading, label, on) in asks {
if !heading.is_empty() {
ui.label(heading);
}
ui.push_id(key, |ui| {
if widgets::check(ui, label, on, true) {
run(app, "edit.colorSettings", json!({ key: !on }));
}
});
}
ui.horizontal(|ui| {
if widgets::flat_button(ui, tl!("Load Profile…"), 110.0).clicked() {
// Its file dialog, shown off the UI thread, loads the profile when it answers.
+3 -2
View File
@@ -503,8 +503,9 @@ pub fn drop_files(app: &mut VectorcraftApp, mut files: Vec<(DropTarget, DropFile
}
DropTarget::Open => match path.as_deref() {
Some(path) if app.services.read.is_some() => io::open_path(app, path).map(|_| ()),
_ => io::open_bytes(app, &name, &bytes, path.clone()).map(|_| {
if let Some(path) = &path {
_ => io::open_bytes(app, &name, &bytes, path.clone()).map(|r| {
// A document that asks a question first goes on the recent files once it opens.
if let Some(path) = path.as_ref().filter(|_| !io::asks_first(&r)) {
io::note_recent(app, path);
}
}),
+34 -5
View File
@@ -543,7 +543,7 @@ fn finish_paste(app: &mut VectorcraftApp, paste: Paste) {
let _ = app.run(&paste.id, paste.params);
// Also when the paste did not reach the clipboard (the Type tool took it).
app.placing.adopted = false;
if let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == crate::dialogs::swatch_conflict::KIND) {
if let Some(d) = app.ui.dialog.as_mut().filter(|d| asks_before_paste(&d.kind)) {
d.fields.insert("__deferredPaste".into(), json!(chain));
if let Ok(st) = app.session.doc() {
app.placing.swatch_paste = Some(PendingSwatch {
@@ -597,19 +597,27 @@ pub(crate) fn cancel_swatch_paste(app: &mut VectorcraftApp) {
}
}
/// Is `kind` a dialog a paste asks before it runs (Paste Profile Mismatch, Swatch Conflict), whose
/// OK runs a deferred paste in the context it was given in?
fn asks_before_paste(kind: &str) -> bool {
kind == crate::dialogs::swatch_conflict::KIND || kind == crate::dialogs::profile_mismatch::PASTE_KIND
}
/// Release a deferred paste once its dialog is no longer the active dialog.
pub(crate) fn settle_swatch_paste(app: &mut VectorcraftApp) {
let active = app.placing.swatch_paste.as_ref().is_some_and(|waiting| {
app.ui.dialog.as_ref().is_some_and(|d| {
d.kind == crate::dialogs::swatch_conflict::KIND && d.fields.get("__deferredPaste").and_then(Value::as_u64) == Some(waiting.chain)
})
app.ui
.dialog
.as_ref()
.is_some_and(|d| asks_before_paste(&d.kind) && d.fields.get("__deferredPaste").and_then(Value::as_u64) == Some(waiting.chain))
});
if app.placing.swatch_paste.is_some() && !active {
cancel_swatch_paste(app);
}
}
/// Run the command confirmed by the deferred paste's Swatch Conflict dialog.
/// Run the command confirmed by the deferred paste's Swatch Conflict or Paste Profile Mismatch
/// dialog.
pub(crate) fn confirm_swatch_paste(app: &mut VectorcraftApp, id: &str, params: Value, token: Option<u64>) -> Result<Value, String> {
if !app.placing.swatch_paste.as_ref().is_some_and(|waiting| Some(waiting.chain) == token) {
if token.is_some() || app.placing.swatch_paste.is_some() {
@@ -644,6 +652,27 @@ pub(crate) fn confirm_swatch_paste(app: &mut VectorcraftApp, id: &str, params: V
app.placing.adopted = true;
let result = app.run(id, params);
app.placing.adopted = false;
// The paste asked again (Swatch Conflict after Paste Profile Mismatch): it stays deferred, in
// the context it was given in.
let asked_again = app.ui.dialog.as_mut().filter(|d| asks_before_paste(&d.kind) && !d.fields.contains_key("__deferredPaste"));
if let Some(d) = asked_again
&& let Ok(st) = app.session.doc()
{
d.fields.insert("__deferredPaste".into(), json!(waiting.chain));
app.placing.swatch_paste = Some(PendingSwatch {
clipboard: app.session.clipboard.clone(),
insertion: insertion.clone(),
selection: waiting.selection,
doc: st.uid,
reverts: st.reverts,
chain: waiting.chain,
});
if let Some(changed) = changed {
changed.restore_changed(&insertion, app);
}
app.session.clipboard = current;
return result;
}
if let Some(changed) = changed {
changed.restore_changed(&insertion, app);
}
+13
View File
@@ -1634,6 +1634,19 @@ preferences (the folder the desktop app uses, so both see the same ones; `VECTOR
target of `view.proofSetup` simulates the working CMYK space in such a document too. `color.convert`'s
`outOfGamut` and `deltaE`, `color.gamutCheck`, and the out-of-gamut warning of the Color panel and Color Picker
check against the assigned CMYK profile, else the working CMYK space; the warning updates when either changes.
- **Profile Mismatches and Missing Profiles** (`edit.colorSettings {askMismatchOpen, askMismatchPaste,
askMissingOpen}`, all off by default and kept in `Color Settings.json`): with `askMismatchOpen` or
`askMissingOpen` on, the desktop app's File › Open asks before a document opens when the profile of its color mode
is not the working space (use the embedded profile, convert the colors to the working space, or discard the
profile) or when it has none (leave it, assign the working space, or assign a profile), starting on what the
model's policy does; Cancel leaves the file closed. `document.open` never asks: `profileChoice` (`useEmbedded`,
`convert`, `discard`; `leave`, `assignWorking`, `assign` with `assignProfile`) states the answer, else the policy
applies, and the reply's `profileChoice` names the answer used. Copy remembers the profiles the colors showed
through; pasting them into a document with another RGB or CMYK profile keeps their numbers or converts them, as
`profileMismatch` on the paste commands says, else as the model's policy does (`convert` converts, the others keep
the numbers; a profile that is not available keeps them). `clipboard.profileMismatch` lists the models that differ, only those whose colors the copied objects
use, and with `askMismatchPaste` on the desktop app's Paste asks first. New from Template, File › Revert and a drag
between documents follow the policies without asking.
Not remembered: the document, anything else. Nothing is read or written when
`VECTORCRAFT_NO_PREFS` is set, and a server confined with `--automation-read-root` or
+1
View File
@@ -746,6 +746,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
- **Out-of-gamut warning after a profile change:** the out-of-gamut warning and its closest-color correction in the Color panel and Color Picker ([the help page](https://helpx.adobe.com/illustrator/using/adjusting-colors.html)) check the color against the document's assigned CMYK profile, else the working CMYK space, and update when Edit › Assign Profile… or Edit › Color Settings… changes that space or a loaded profile changes, without a change of color. Which CMYK space the warning uses is VectorCraft's own rule. Tests: `gamut_warning_follows_a_profile_change` and `gamut_warning_follows_a_profile_loaded_again` in `dialogs/color_picker/tests.rs`.
- **Assign Profile and the working spaces:** Edit › Assign Profile… tags the document and leaves the working spaces of Edit › Color Settings… as they are, in Color Settings, the Separations panel and the settings saved for the next start. Colors show and convert through the profiles assigned; a change in Color Settings keeps the profiles the document in front is assigned in use, and removing an assigned profile in use puts the working space back in its place. The profiles in use follow the document in front: a new, opened or reverted document, a switch to another tab, a close, Undo and Redo of Assign Profile, a failed batch, each step of a batch, Export All Open and the update of placed documents put that document's profiles in use, and the working spaces where it is assigned none or no document is open. With Window › Arrange › Tile or floating document windows, each document behind the front one draws its art, paper and transparency grid through its own assigned profiles, and loading or removing a profile redraws the documents assigned it; placed documents inside it still draw through the front document's profiles. How documents behind the front one draw is VectorCraft's own rule. View › Proof Setup › Working CMYK simulates the working CMYK space of Color Settings in Proof Colors and Separations Preview, also in a document assigned another CMYK profile. Public references: [Changing the color profile for a document and About color working spaces](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=150) and [Soft-proof presets](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=134). Tests in `engine/tests/color_settings.rs`.
- **Color management policies:** Edit › Color Settings… (the Separations panel's Color Settings section and `edit.colorSettings`) has an RGB and a CMYK policy: Off, Preserve Embedded Profiles and Convert to Working Space, and Preserve Numbers for CMYK. Opening or reverting a document tagged with a profile other than the working space keeps it, takes it off with the color numbers kept, or converts that model's colors into the working space and takes it off. The policies are kept in `Color Settings.json`. Preserve Embedded Profiles as the default for both, and the per-model policy for a document tagged with both an RGB and a CMYK profile, are VectorCraft's own rules. Public reference: [Color management policy options](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf). Tests in `engine/tests/color_settings.rs` and `color/src/cms/tests.rs`.
- **Profile Mismatches and Missing Profiles:** Edit › Color Settings… (the Separations panel's Color Settings section and `edit.colorSettings`) has Profile Mismatches: Ask When Opening and Ask When Pasting, and Missing Profiles: Ask When Opening, off by default and kept in `Color Settings.json`. With a box on, File › Open asks before a document opens whose color mode's profile is not the working space (use the embedded profile, convert the colors to the working space, or discard the profile) or that has none (leave it, assign the working space, or assign a profile), and Paste asks whether colors copied from a document with another profile keep their numbers or convert; each starts on what the policy does. `document.open {profileChoice}` and the paste commands' `profileMismatch` give the answer without a prompt, and `clipboard.profileMismatch` lists what a paste would ask about. Asking about the profile of the document's color mode only, the choice a missing profile starts on under Convert to Working Space, and pastes and drags following the policies when nothing asks are VectorCraft's own rules. Public reference: [About missing and mismatched color profiles and Color management policy options](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=157). Tests in `engine/tests/color_settings.rs`, `color/src/cms/tests.rs` and `dialogs/profile_mismatch/tests.rs`.
- **New Document's More Settings and Save Preset:** More Settings opens a pop-up over New Document with only Number of Artboards, the artboard layout, Change to Right-to-Left Layout, Spacing and Columns; Done, Escape or a click outside closes it and keeps the values. Save Preset turns the top of Preset Details into a Save Document Preset heading with the preset's name, Cancel and Save, and hides the document's name, Close and Create until the preset is saved or canceled; nothing in that mode creates a document. Save Preset's default name is the first "Preset N" no saved preset has. VectorCraft's own layout. Harness tests in `dialogs/new_document.rs` cover both.
- **New Document profiles:** each built-in category's presets start documents from that category's profile, a native document holding the starting swatches, graphic styles, brushes, symbols and other assets, the ruler and Document Setup options and the print settings ([Create a custom new document profile](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/start-a-new-file/create-a-custom-new-document-profile.html)). New Document's Manage Profiles pop-up opens a profile to edit and resets one to the shipped profile (`file.newProfiles`, `file.newProfiles.edit`, `file.newProfiles.reset`; `file.new {profile}`). The profiles live in VectorCraft's own `New Document Profiles` folder next to the preferences; a profile that cannot be read or is larger than 64 MiB leaves the defaults and is reported. Tests: `tests::newdoc::an_edited_profile_starts_the_documents_of_its_category`, `the_profile_follows_the_preset_access_and_reset`, `profile_errors_name_the_file_by_its_name_outside_the_read_roots`, `a_damaged_or_oversized_profile_leaves_the_defaults_and_is_reported`, `profile_names_are_checked_and_editing_needs_the_folder`, `dialogs::new_document::tests::manage_profiles_edits_and_resets_the_profiles`.
- **Control bar with the Artboard tool:** while the Artboard tool is in use, the Control bar shows the active artboard's controls in place of the object controls: Preset, Portrait and Landscape, New Artboard, Delete Artboard, the Name field, Artboard Options, Rearrange All Artboards, the Transform link, Move and Scale Artwork with Artboard and, while the bar has room, the reference point with X and Y, and W and H with the Constrain Width and Height Proportions link. Each runs the command its Properties or Transform panel counterpart runs (`artboard.setProps`, `artboard.new`, `artboard.delete`, `tool.options {tool: "artboard"}`), and the reference point is the one the Transform panel uses. In an 800-point window the controls up to the Transform link fit, Move and Scale Artwork with Artboard show as their boxes alone with their names in tooltips, and the link opens the Transform panel with the artboard's position and size. Pointer and key tests in `panels/artboards.rs` cover the controls, W about the reference point, the orientation and the name. Public reference: [Using multiple artboards](https://web.archive.org/web/20210925094818/https://helpx.adobe.com/illustrator/using/using-multiple-artboards.html) (archived copy).