mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
Merge main into fix/canvas-process-swatch-source-color
This commit is contained in:
39 files changed
+4247
-24
No files matched your search
@@ -16,6 +16,15 @@
|
||||
| `crates/text/patterns/hyph-or.tex` | Santhosh Thottingal | https://github.com/hyphenation/tex-hyphen/blob/5684c0f51c0b81133db2efbe60a408b4155a3ff5/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-or.tex | MIT (selected option) | Unmodified; full license in file |
|
||||
| `crates/text/patterns/hyph-as.tex` | Santhosh Thottingal | https://github.com/hyphenation/tex-hyphen/blob/5684c0f51c0b81133db2efbe60a408b4155a3ff5/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-as.tex | MIT (selected option) | Unmodified; full license in file |
|
||||
|
||||
## Printing-condition characterization data
|
||||
|
||||
Fogra's terms (https://fogra.org/en/downloads/work-tools/characterisation-data): "Free use and redistribution of the Fogra characterisation data is permitted, including redistribution as part of commercial and non-commercial software, provided that the data are distributed unmodified and Fogra is identified as the source. The designation FOGRAxx may be used solely to identify the respective reference data. Such use does not imply certification, approval or endorsement by Fogra." VectorCraft computes its Coated CMYK (FOGRA51) and Uncoated CMYK (FOGRA52) working spaces from these files at run time; the files themselves are not changed.
|
||||
|
||||
| Asset | Author | Source | Licence | Notes |
|
||||
|---|---|---|---|---|
|
||||
| `crates/color/data/FOGRA51.txt` | Fogra Forschungsgesellschaft Druck e.V. (www.fogra.org) | https://fogra.org/fileadmin/files/7_downloads/Charakterisierungsdaten/F51-52.zip | Fogra characterization data terms (above): redistribution of the unmodified data with Fogra named as the source | Unmodified, byte for byte (SHA-256 `ad472a1c0bdafd558597ff93eeda5175805086565af814cb6346e910e2f25aa5`, checked by a test) |
|
||||
| `crates/color/data/FOGRA52.txt` | Fogra Forschungsgesellschaft Druck e.V. (www.fogra.org) | https://fogra.org/fileadmin/files/7_downloads/Charakterisierungsdaten/F51-52.zip | Fogra characterization data terms (above): redistribution of the unmodified data with Fogra named as the source | Unmodified, byte for byte (SHA-256 `be4f0732328ed62ade63ec7f317d3b9e9dad6bbe2430fefddaf0f901d5ba13d6`, checked by a test) |
|
||||
|
||||
Every non-code asset in this repository (icons, images, fonts, example art, colour profiles, presets) is listed here with its author, source and licence. `cargo xtask assets` (part of `cargo xtask ci`) fails if an asset file is missing from this table.
|
||||
|
||||
**Policy (mandatory):** VectorCraft contains **no Adobe iconography, images, artwork, presets, swatch/brush/symbol/pattern libraries or ICC profiles**. Every asset is either original work by VectorCraft contributors, or third-party material under an open licence (OSI open source, public domain / CC0, or Creative Commons that allows redistribution), and it is attributed below. Screenshots of Adobe software are never committed. The one exception is the ArtCraft name, wordmark and logos in `docs/brand/`: ArtCraft trademarks, not open source, usable only under [`docs/brand/LICENSE-brand.txt`](docs/brand/LICENSE-brand.txt).
|
||||
|
||||
Generated
+1
@@ -8480,6 +8480,7 @@ dependencies = [
|
||||
"proptest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sha2 0.10.9",
|
||||
"thiserror 2.0.21",
|
||||
]
|
||||
|
||||
|
||||
@@ -152,6 +152,17 @@ Copyright (C) 2016 Santhosh Thottingal, used under the MIT license option.
|
||||
Original copyright and full license notices are preserved in each hyph-*.tex file.
|
||||
Source: hyphenation/tex-hyphen, commit 5684c0f51c0b81133db2efbe60a408b4155a3ff5.
|
||||
|
||||
FOGRA51 and FOGRA52 characterization data (crates/color/data/):
|
||||
Source: Fogra Forschungsgesellschaft Druck e.V., www.fogra.org,
|
||||
https://fogra.org/en/downloads/work-tools/characterisation-data. The files are distributed
|
||||
unmodified. Fogra's terms: "Free use and redistribution of the Fogra characterisation data is
|
||||
permitted, including redistribution as part of commercial and non-commercial software, provided
|
||||
that the data are distributed unmodified and Fogra is identified as the source. The designation
|
||||
FOGRAxx may be used solely to identify the respective reference data. Such use does not imply
|
||||
certification, approval or endorsement by Fogra." VectorCraft's Coated CMYK (FOGRA51) and
|
||||
Uncoated CMYK (FOGRA52) working spaces are computed from this data by VectorCraft's own code;
|
||||
they are not Fogra profiles.
|
||||
|
||||
|
||||
JPEG encoder dependency notices
|
||||
|
||||
|
||||
@@ -22,3 +22,4 @@ moxcms = "0.8"
|
||||
[dev-dependencies]
|
||||
proptest = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
sha2 = { version = "0.10", default-features = false }
|
||||
@@ -0,0 +1,2 @@
|
||||
# The characterization data files are kept byte for byte as published (CRLF line endings).
|
||||
*.txt -text
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+41
-6
@@ -5,7 +5,9 @@
|
||||
//! (1998 primaries), Display P3, ProPhoto RGB) or user `.icc` files. Display output is sRGB;
|
||||
//! the desktop canvas converts it into the display's own profile last, in the app.
|
||||
//! * **CMYK spaces:** [`GENERIC_CMYK`] is our own documented parametric press model
|
||||
//! ([`generic`]); [`DEVICE_CMYK`] is the old profile-free formula (kept for exact legacy numbers);
|
||||
//! ([`generic`]); [`FOGRA51_CMYK`] and [`FOGRA52_CMYK`] are the same model computed from
|
||||
//! Fogra's published characterization data ([`measured`]); [`DEVICE_CMYK`] is the old
|
||||
//! profile-free formula (kept for exact legacy numbers);
|
||||
//! any CMYK `.icc` the user loads goes through `moxcms` (LUT-based profiles).
|
||||
//! * The **active settings** are process-wide: the working settings (Edit → Color Settings), with
|
||||
//! the profiles [`use_document_profiles`] last put in place of the working spaces;
|
||||
@@ -16,6 +18,7 @@
|
||||
pub mod generic;
|
||||
pub mod icc;
|
||||
pub mod lab;
|
||||
pub mod measured;
|
||||
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
|
||||
@@ -36,6 +39,12 @@ pub const DISPLAY_P3: &str = "Display P3";
|
||||
pub const PROPHOTO_RGB: &str = "ProPhoto RGB";
|
||||
/// Our parametric press model (see [`generic`]). Not an Adobe/ECI profile.
|
||||
pub const GENERIC_CMYK: &str = "VectorCraft Generic CMYK (SWOP-like)";
|
||||
/// VectorCraft's own press model computed from Fogra's FOGRA51 characterization data (offset on
|
||||
/// premium coated paper, see [`measured`]).
|
||||
pub const FOGRA51_CMYK: &str = "VectorCraft Coated CMYK (FOGRA51)";
|
||||
/// VectorCraft's own press model computed from Fogra's FOGRA52 characterization data (offset on
|
||||
/// wood-free uncoated paper, see [`measured`]).
|
||||
pub const FOGRA52_CMYK: &str = "VectorCraft Uncoated CMYK (FOGRA52)";
|
||||
/// Profile-free CMYK (`rgb = (1−c)(1−k)` …): uncalibrated, kept for legacy numbers.
|
||||
pub const DEVICE_CMYK: &str = "Device CMYK (uncalibrated)";
|
||||
/// The grey space greyscale exports are written in: sRGB's tone curve (a grey shows as on screen).
|
||||
@@ -43,7 +52,7 @@ pub const GRAY: &str = "Gray (sRGB tone curve)";
|
||||
|
||||
/// Built-in RGB and CMYK working spaces, in menu order.
|
||||
const BUILTIN_RGB: [&str; 4] = [SRGB, WIDE_GAMUT_RGB, DISPLAY_P3, PROPHOTO_RGB];
|
||||
const BUILTIN_CMYK: [&str; 2] = [GENERIC_CMYK, DEVICE_CMYK];
|
||||
const BUILTIN_CMYK: [&str; 4] = [GENERIC_CMYK, FOGRA51_CMYK, FOGRA52_CMYK, DEVICE_CMYK];
|
||||
|
||||
/// Names earlier versions gave built-in profiles: (old name, current name). Settings, documents
|
||||
/// and commands that still use an old name get the current profile.
|
||||
@@ -239,6 +248,21 @@ fn generic() -> Arc<GenericCmyk> {
|
||||
G.get_or_init(|| Arc::new(GenericCmyk::new(generic::swop_like()))).clone()
|
||||
}
|
||||
|
||||
/// The working space of `condition`, computed from its data once and kept.
|
||||
fn measured_space(condition: &measured::Condition) -> Result<Arc<GenericCmyk>, CmsError> {
|
||||
static SPACES: [OnceLock<Option<Arc<GenericCmyk>>>; measured::CONDITIONS.len()] = [const { OnceLock::new() }; measured::CONDITIONS.len()];
|
||||
let slot = measured::CONDITIONS.iter().position(|c| c.name == condition.name).and_then(|i| SPACES.get(i));
|
||||
slot.and_then(|s| s.get_or_init(|| measured::model(condition).map(Arc::new)).clone())
|
||||
.ok_or_else(|| CmsError::BadProfile(format!("{}: the {} data does not give a press model", condition.name, condition.reference)))
|
||||
}
|
||||
|
||||
/// The registered printing condition a built-in CMYK working space characterizes: its reference
|
||||
/// name, the `/OutputConditionIdentifier` of a PDF/X output intent, and the registry it belongs
|
||||
/// to (by its current or legacy name). `None` for every other profile.
|
||||
pub fn characterization(name: &str) -> Option<(&'static str, &'static str)> {
|
||||
measured::condition(canonical_name(name)).map(|c| (c.reference, measured::REGISTRY))
|
||||
}
|
||||
|
||||
static USER: RwLock<Vec<Arc<IccProfile>>> = RwLock::new(Vec::new());
|
||||
/// Counts the profiles [`register_icc`] has registered ([`profiles_generation`]).
|
||||
static PROFILES_GENERATION: AtomicU64 = AtomicU64::new(0);
|
||||
@@ -259,7 +283,11 @@ fn user_profile(name: &str) -> Option<Arc<IccProfile>> {
|
||||
}
|
||||
|
||||
fn cmyk_space(name: &str) -> Result<CmykSpace, CmsError> {
|
||||
match canonical_name(name) {
|
||||
let canonical = canonical_name(name);
|
||||
if let Some(c) = measured::condition(canonical) {
|
||||
return measured_space(c).map(CmykSpace::Generic);
|
||||
}
|
||||
match canonical {
|
||||
GENERIC_CMYK => Ok(CmykSpace::Generic(generic())),
|
||||
DEVICE_CMYK => Ok(CmykSpace::Device),
|
||||
_ => match user_profile(name) {
|
||||
@@ -382,9 +410,13 @@ pub fn icc_bytes(name: &str) -> Result<Arc<[u8]>, CmsError> {
|
||||
CmykSpace::Generic(g) => g.paper_xyz(),
|
||||
CmykSpace::Device | CmykSpace::Icc(_) => lab::D50,
|
||||
};
|
||||
let copyright = match measured::condition(name) {
|
||||
Some(c) => format!("Computed by VectorCraft from the {} characterization data. Data source: Fogra, www.fogra.org", c.reference),
|
||||
None => icc::NO_COPYRIGHT.to_string(),
|
||||
};
|
||||
let to_lab = |c| cms.cmyk_to_lab(c);
|
||||
let shadows = |l| mapped.lab_to_cmyk(l, Intent::RelativeColorimetric);
|
||||
icc::encode(&icc::cmyk_profile(name, paper, to_lab, shadows, |l| cms.lab_to_cmyk(l, Intent::RelativeColorimetric)))?
|
||||
icc::encode(&icc::cmyk_profile(name, paper, ©right, to_lab, shadows, |l| cms.lab_to_cmyk(l, Intent::RelativeColorimetric)))?
|
||||
} else {
|
||||
icc::builtin_rgb_bytes(name)?
|
||||
}
|
||||
@@ -496,7 +528,8 @@ impl Cms {
|
||||
/// directly into the RGB profile: not through display sRGB, which would clip colours a wider
|
||||
/// RGB space holds (Wide Gamut RGB keeps CMYK cyan that sRGB can't show), and with the
|
||||
/// settings' black-point compensation. The built-in CMYK spaces go through sRGB as before
|
||||
/// (Generic CMYK compensates in its own model).
|
||||
/// (Generic CMYK compensates in its own model); with the absolute colorimetric intent the
|
||||
/// paper colour shows.
|
||||
pub fn cmyk_to_rgb(&self, cmyk: [f32; 4], intent: Intent) -> [f32; 3] {
|
||||
let cmyk = cmyk.map(|v| v.clamp(0.0, 1.0));
|
||||
let src = match &self.cmyk {
|
||||
@@ -509,7 +542,7 @@ impl Cms {
|
||||
};
|
||||
src.zip(dest)
|
||||
.and_then(|(s, d)| s.to_rgb_of(&d, &cmyk, intent, self.settings.bpc))
|
||||
.unwrap_or_else(|| self.srgb_to_rgb(self.cmyk_to_srgb(cmyk, false)))
|
||||
.unwrap_or_else(|| self.srgb_to_rgb(self.cmyk_to_srgb(cmyk, intent == Intent::AbsoluteColorimetric)))
|
||||
}
|
||||
/// Display sRGB → working CMYK with `intent`.
|
||||
pub fn srgb_to_cmyk(&self, srgb: [f32; 3], intent: Intent) -> [f32; 4] {
|
||||
@@ -1315,3 +1348,5 @@ pub(crate) fn cmyk_is_device() -> bool {
|
||||
mod tests;
|
||||
#[cfg(test)]
|
||||
mod tests_icc;
|
||||
#[cfg(test)]
|
||||
mod tests_measured;
|
||||
@@ -30,6 +30,7 @@ use std::sync::OnceLock;
|
||||
|
||||
use super::Intent;
|
||||
use super::lab::{D50, Lab, delta_e2000, lab_to_xyz, srgb_to_lab, xyz_to_lab, xyz_to_srgb};
|
||||
use super::measured::Lattice;
|
||||
|
||||
/// Black generation.
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
@@ -129,6 +130,9 @@ pub struct GenericCmyk {
|
||||
paper_xyz: [f32; 3],
|
||||
/// Media-relative XYZ of the black point (for black-point compensation).
|
||||
black_rel: [f32; 3],
|
||||
/// A media-relative Lab correction added to the model, fitted to measured data
|
||||
/// ([`super::measured`]).
|
||||
correction: Option<Lattice>,
|
||||
gbd: OnceLock<Gbd>,
|
||||
}
|
||||
|
||||
@@ -139,6 +143,15 @@ impl GenericCmyk {
|
||||
}
|
||||
|
||||
pub fn new(params: GenericCmykParams) -> Self {
|
||||
Self::build(params, None)
|
||||
}
|
||||
|
||||
/// The model of `params` with `correction` added to its media-relative Lab.
|
||||
pub fn with_correction(params: GenericCmykParams, correction: Lattice) -> Self {
|
||||
Self::build(params, Some(correction))
|
||||
}
|
||||
|
||||
fn build(params: GenericCmykParams, correction: Option<Lattice>) -> Self {
|
||||
let paper_xyz = lab_to_xyz(params.paper);
|
||||
let mut prim = [D50; 16];
|
||||
for (p, lab) in prim[1..].iter_mut().zip(params.primaries.iter()) {
|
||||
@@ -149,7 +162,7 @@ impl GenericCmyk {
|
||||
let g = params.tvi50[i];
|
||||
if g > 1e-6 { (1.0 - params.tvi40[i] / (0.96 * g)) / 0.2 } else { 0.0 }
|
||||
});
|
||||
let mut g = Self { params, prim, skew, paper_xyz, black_rel: [0.0; 3], gbd: OnceLock::new() };
|
||||
let mut g = Self { params, prim, skew, paper_xyz, black_rel: [0.0; 3], correction, gbd: OnceLock::new() };
|
||||
g.black_rel = g.to_xyz_rel(g.black_point_build());
|
||||
g
|
||||
}
|
||||
@@ -218,6 +231,14 @@ impl GenericCmyk {
|
||||
|
||||
/// Media-relative XYZ (paper = D50 white).
|
||||
pub fn to_xyz_rel(&self, cmyk: [f32; 4]) -> [f32; 3] {
|
||||
match &self.correction {
|
||||
Some(_) => lab_to_xyz(self.to_lab_rel(cmyk)),
|
||||
None => self.neugebauer(cmyk),
|
||||
}
|
||||
}
|
||||
|
||||
/// Media-relative XYZ of the Neugebauer model alone.
|
||||
fn neugebauer(&self, cmyk: [f32; 4]) -> [f32; 3] {
|
||||
let e = [0, 1, 2, 3].map(|i| self.gain(i, cmyk[i]));
|
||||
let mut out = [0.0f32; 3];
|
||||
for (i, p) in self.prim.iter().enumerate() {
|
||||
@@ -236,7 +257,14 @@ impl GenericCmyk {
|
||||
}
|
||||
|
||||
pub fn to_lab_rel(&self, cmyk: [f32; 4]) -> Lab {
|
||||
xyz_to_lab(self.to_xyz_rel(cmyk))
|
||||
let lab = xyz_to_lab(self.neugebauer(cmyk));
|
||||
match &self.correction {
|
||||
Some(c) => {
|
||||
let d = c.at(cmyk);
|
||||
Lab::new((lab.l + d[0]).max(0.0), lab.a + d[1], lab.b + d[2])
|
||||
}
|
||||
None => lab,
|
||||
}
|
||||
}
|
||||
pub fn to_lab_abs(&self, cmyk: [f32; 4]) -> Lab {
|
||||
xyz_to_lab(self.to_xyz(cmyk))
|
||||
|
||||
@@ -432,10 +432,17 @@ fn text_tag(s: &str) -> Option<ProfileText> {
|
||||
Some(ProfileText::Localizable(vec![LocalizableString::new("en".into(), "US".into(), s.into())]))
|
||||
}
|
||||
|
||||
/// The copyright text of profiles made here: they carry no copyright claim.
|
||||
pub(super) const NO_COPYRIGHT: &str = "No copyright, use freely";
|
||||
|
||||
/// Profiles made here carry their name and no copyright claim.
|
||||
fn labelled(mut p: ColorProfile, name: &str) -> ColorProfile {
|
||||
fn labelled(p: ColorProfile, name: &str) -> ColorProfile {
|
||||
with_copyright(p, name, NO_COPYRIGHT)
|
||||
}
|
||||
|
||||
fn with_copyright(mut p: ColorProfile, name: &str, copyright: &str) -> ColorProfile {
|
||||
p.description = text_tag(name);
|
||||
p.copyright = text_tag("No copyright, use freely");
|
||||
p.copyright = text_tag(copyright);
|
||||
p
|
||||
}
|
||||
|
||||
@@ -452,10 +459,11 @@ const GAMUT_GRID: usize = 9;
|
||||
/// It carries every tag ICC.1 requires of an output profile: the tables for all three intents
|
||||
/// and the gamut tag (Windows rejects a CMYK profile without them, so Photos couldn't show a CMYK
|
||||
/// TIFF that embedded one, #2707). The media white point is `paper` (absolute XYZ, D50), which
|
||||
/// the ICC-absolute colorimetric intent reproduces.
|
||||
/// the ICC-absolute colorimetric intent reproduces; the copyright tag holds `copyright`.
|
||||
pub(super) fn cmyk_profile(
|
||||
name: &str,
|
||||
paper: [f32; 3],
|
||||
copyright: &str,
|
||||
to_lab: impl Fn([f32; 4]) -> lab::Lab,
|
||||
mapped: impl Fn(lab::Lab) -> [f32; 4],
|
||||
colorimetric: impl Fn(lab::Lab) -> [f32; 4],
|
||||
@@ -520,7 +528,7 @@ pub(super) fn cmyk_profile(
|
||||
p.lut_b_to_a_saturation = Some(b2a_mapped);
|
||||
p.lut_b_to_a_colorimetric = Some(b2a);
|
||||
p.gamut = Some(gamut);
|
||||
labelled(p, name)
|
||||
with_copyright(p, name, copyright)
|
||||
}
|
||||
|
||||
/// The grey space of greyscale exports: sRGB's tone curve, D50 white.
|
||||
|
||||
@@ -0,0 +1,378 @@
|
||||
//! CMYK working spaces computed from published characterization data.
|
||||
//!
|
||||
//! Fogra publishes the measured colors of its reference printing conditions
|
||||
//! (<https://fogra.org/en/downloads/work-tools/characterisation-data>) and allows the data to be
|
||||
//! redistributed unmodified, with Fogra named as the source. VectorCraft embeds the FOGRA51 and
|
||||
//! FOGRA52 files byte for byte (`crates/color/data/`) and computes each press model from them the
|
||||
//! first time it is used:
|
||||
//!
|
||||
//! * The paper is the measured blank patch. The 15 solids and overprints of the
|
||||
//! [`super::generic`] model are the measured patches of those builds, and each ink's tone curve
|
||||
//! is fitted to its single-ink ramp.
|
||||
//! * What that model still misses at each patch (in media-relative Lab) is fitted with a smoothed
|
||||
//! lattice over CMYK ([`Lattice`]), which [`GenericCmyk::to_xyz_rel`] adds to the model. The
|
||||
//! smoothing carries the fit into regions the patch set does not sample, such as dark builds
|
||||
//! with more than 60% black.
|
||||
//!
|
||||
//! The total ink limit and the black generation are VectorCraft's own values.
|
||||
|
||||
use super::generic::{GenericCmyk, GenericCmykParams, swop_like};
|
||||
use super::lab::{D50, Lab, lab_to_xyz, xyz_to_lab};
|
||||
|
||||
/// A printing condition with published characterization data.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct Condition {
|
||||
/// The working space's name.
|
||||
pub name: &'static str,
|
||||
/// The reference name of the characterization data, which a PDF/X output intent uses as
|
||||
/// its `/OutputConditionIdentifier`.
|
||||
pub reference: &'static str,
|
||||
/// The characterization data file, as published.
|
||||
pub data: &'static [u8],
|
||||
/// Total area coverage limit (sum of inks, 1.0 = 100%): VectorCraft's own value.
|
||||
pub tac: f32,
|
||||
}
|
||||
|
||||
/// The registry that the reference names of [`CONDITIONS`] belong to
|
||||
/// (<https://registry.color.org/cmyk-registry/>).
|
||||
pub const REGISTRY: &str = "http://www.color.org";
|
||||
|
||||
/// The printing conditions VectorCraft computes working spaces for.
|
||||
pub const CONDITIONS: [Condition; 2] = [
|
||||
Condition { name: super::FOGRA51_CMYK, reference: "FOGRA51", data: include_bytes!("../../data/FOGRA51.txt"), tac: 3.0 },
|
||||
Condition { name: super::FOGRA52_CMYK, reference: "FOGRA52", data: include_bytes!("../../data/FOGRA52.txt"), tac: 3.0 },
|
||||
];
|
||||
|
||||
/// The condition a working space of [`CONDITIONS`] is computed for.
|
||||
pub fn condition(name: &str) -> Option<&'static Condition> {
|
||||
CONDITIONS.iter().find(|c| c.name == name)
|
||||
}
|
||||
|
||||
/// One measured patch: nominal inks (0..1) and absolute Lab (D50).
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub struct Patch {
|
||||
pub cmyk: [f32; 4],
|
||||
pub lab: Lab,
|
||||
}
|
||||
|
||||
/// The most patches [`parse`] reads.
|
||||
const MAX_PATCHES: usize = 20_000;
|
||||
|
||||
/// The patches of a CGATS / ISO 28178 characterization data file with `CMYK_C`, `CMYK_M`,
|
||||
/// `CMYK_Y`, `CMYK_K`, `LAB_L`, `LAB_A` and `LAB_B` fields. `None` when a field is missing, a
|
||||
/// row is short or holds a value that is not a finite number, an ink is outside 0 to 100, the
|
||||
/// file has no rows, the rows do not end with `END_DATA`, or a `NUMBER_OF_SETS` in the header is
|
||||
/// not the number of rows.
|
||||
pub fn parse(data: &[u8]) -> Option<Vec<Patch>> {
|
||||
let text = std::str::from_utf8(data).ok()?;
|
||||
let sets = text.lines().map(str::trim).take_while(|l| *l != "BEGIN_DATA").find_map(|l| {
|
||||
let mut words = l.split_whitespace();
|
||||
(words.next() == Some("NUMBER_OF_SETS")).then(|| words.next().map(|n| n.trim_matches('"')))
|
||||
});
|
||||
let sets = match sets {
|
||||
Some(n) => Some(n?.parse::<usize>().ok()?),
|
||||
None => None,
|
||||
};
|
||||
let mut lines = text.lines().map(str::trim);
|
||||
lines.by_ref().find(|l| *l == "BEGIN_DATA_FORMAT")?;
|
||||
let mut fields = vec![];
|
||||
for line in lines.by_ref() {
|
||||
if line == "END_DATA_FORMAT" {
|
||||
break;
|
||||
}
|
||||
fields.extend(line.split_whitespace());
|
||||
}
|
||||
let at = |f: &str| fields.iter().position(|x| *x == f);
|
||||
let cols = [at("CMYK_C")?, at("CMYK_M")?, at("CMYK_Y")?, at("CMYK_K")?, at("LAB_L")?, at("LAB_A")?, at("LAB_B")?];
|
||||
lines.by_ref().find(|l| *l == "BEGIN_DATA")?;
|
||||
let mut out = vec![];
|
||||
let mut ended = false;
|
||||
for line in lines {
|
||||
if line == "END_DATA" {
|
||||
ended = true;
|
||||
break;
|
||||
}
|
||||
if line.is_empty() {
|
||||
continue;
|
||||
}
|
||||
if out.len() >= MAX_PATCHES {
|
||||
return None;
|
||||
}
|
||||
let row: Vec<&str> = line.split_whitespace().collect();
|
||||
let mut v = [0f32; 7];
|
||||
for (slot, &col) in v.iter_mut().zip(&cols) {
|
||||
*slot = row.get(col)?.parse::<f32>().ok().filter(|x| x.is_finite())?;
|
||||
}
|
||||
if v[..4].iter().any(|x| !(0.0..=100.0).contains(x)) {
|
||||
return None;
|
||||
}
|
||||
out.push(Patch { cmyk: [v[0], v[1], v[2], v[3]].map(|x| x / 100.0), lab: Lab::new(v[4], v[5], v[6]) });
|
||||
}
|
||||
(ended && !out.is_empty() && sets.is_none_or(|n| n == out.len())).then_some(out)
|
||||
}
|
||||
|
||||
/// Absolute Lab → media-relative Lab (`paper` maps to the D50 white).
|
||||
fn relative(lab: Lab, paper: [f32; 3]) -> Lab {
|
||||
let x = lab_to_xyz(lab);
|
||||
xyz_to_lab([0, 1, 2].map(|i| x[i] * D50[i] / paper[i]))
|
||||
}
|
||||
|
||||
/// The mean of the Lab values of the patches whose inks are `inks`, in XYZ.
|
||||
fn mean_lab(patches: &[Patch], inks: [f32; 4]) -> Option<Lab> {
|
||||
let mut sum = [0f32; 3];
|
||||
let mut n = 0;
|
||||
for p in patches.iter().filter(|p| p.cmyk.iter().zip(&inks).all(|(a, b)| (a - b).abs() < 1e-4)) {
|
||||
let x = lab_to_xyz(p.lab);
|
||||
for i in 0..3 {
|
||||
sum[i] += x[i];
|
||||
}
|
||||
n += 1;
|
||||
}
|
||||
(n > 0).then(|| xyz_to_lab(sum.map(|v| v / n as f32)))
|
||||
}
|
||||
|
||||
/// The tone value increase at 50% and 40% of ink `ink`, fitted to its single-ink ramp with the
|
||||
/// curve of [`super::generic`]: the effective area is `a + u·4a(1−a) + v·4a(1−a)(2a−1)`, so the
|
||||
/// 50% increase is `u` and the 40% increase is `0.96·u − 0.192·v`. Each patch's effective area
|
||||
/// comes from the Murray–Davies formula in the media-relative XYZ channel the ink darkens most
|
||||
/// (`paper` is the paper's absolute XYZ, `solid` the solid's media-relative XYZ).
|
||||
fn tone_increase(patches: &[Patch], ink: usize, paper: [f32; 3], solid: [f32; 3]) -> Option<(f32, f32)> {
|
||||
let ch = (0..3).max_by(|&a, &b| (D50[a] - solid[a]).abs().total_cmp(&(D50[b] - solid[b]).abs()))?;
|
||||
let span = D50[ch] - solid[ch];
|
||||
if span.abs() < 1e-4 {
|
||||
return None;
|
||||
}
|
||||
let (mut s11, mut s12, mut s22, mut r1, mut r2) = (0f64, 0f64, 0f64, 0f64, 0f64);
|
||||
for p in patches {
|
||||
let a = p.cmyk[ink];
|
||||
let alone = p.cmyk.iter().enumerate().all(|(i, v)| i == ink || *v == 0.0);
|
||||
if !alone || a <= 0.0 || a >= 1.0 {
|
||||
continue;
|
||||
}
|
||||
let e = (D50[ch] - relative_xyz(p.lab, paper)[ch]) / span;
|
||||
let (b1, b2) = (f64::from(4.0 * a * (1.0 - a)), f64::from(4.0 * a * (1.0 - a) * (2.0 * a - 1.0)));
|
||||
let d = f64::from(e - a);
|
||||
s11 += b1 * b1;
|
||||
s12 += b1 * b2;
|
||||
s22 += b2 * b2;
|
||||
r1 += b1 * d;
|
||||
r2 += b2 * d;
|
||||
}
|
||||
let det = s11 * s22 - s12 * s12;
|
||||
if det.abs() < 1e-12 {
|
||||
return None;
|
||||
}
|
||||
let u = ((r1 * s22 - r2 * s12) / det) as f32;
|
||||
let v = ((s11 * r2 - s12 * r1) / det) as f32;
|
||||
let tvi50 = u.clamp(0.0, 0.45);
|
||||
let tvi40 = (0.96 * u - 0.192 * v).clamp(0.0, 0.45);
|
||||
Some((tvi50, tvi40))
|
||||
}
|
||||
|
||||
/// Absolute Lab → media-relative XYZ.
|
||||
fn relative_xyz(lab: Lab, paper: [f32; 3]) -> [f32; 3] {
|
||||
let x = lab_to_xyz(lab);
|
||||
[0, 1, 2].map(|i| x[i] * D50[i] / paper[i])
|
||||
}
|
||||
|
||||
/// The press model of `condition`, computed from its data. `None` when the data does not parse,
|
||||
/// lacks the paper, a solid or overprint, or a single-ink ramp, or gives a paper whose XYZ is not
|
||||
/// positive and finite.
|
||||
pub fn model(condition: &Condition) -> Option<GenericCmyk> {
|
||||
fit(condition, &parse(condition.data)?, SMOOTHING)
|
||||
}
|
||||
|
||||
/// The press model of `condition` fitted to `patches`, with the lattice's `smoothing` (`None` in
|
||||
/// the cases [`model`] lists).
|
||||
pub(crate) fn fit(condition: &Condition, patches: &[Patch], smoothing: f64) -> Option<GenericCmyk> {
|
||||
let paper = mean_lab(patches, [0.0; 4])?;
|
||||
let paper_xyz = lab_to_xyz(paper);
|
||||
if paper_xyz.iter().any(|v| !v.is_finite() || *v <= 0.0) {
|
||||
return None;
|
||||
}
|
||||
let mut primaries = [Lab::new(0.0, 0.0, 0.0); 15];
|
||||
for (i, slot) in primaries.iter_mut().enumerate() {
|
||||
let bits = i + 1;
|
||||
let inks = [0, 1, 2, 3].map(|b| if bits & (1 << b) != 0 { 1.0 } else { 0.0 });
|
||||
*slot = relative(mean_lab(patches, inks)?, paper_xyz);
|
||||
}
|
||||
let mut tvi50 = [0f32; 4];
|
||||
let mut tvi40 = [0f32; 4];
|
||||
for ink in 0..4 {
|
||||
let solid = lab_to_xyz(primaries[(1 << ink) - 1]);
|
||||
(tvi50[ink], tvi40[ink]) = tone_increase(patches, ink, paper_xyz, solid)?;
|
||||
}
|
||||
let params = GenericCmykParams { name: condition.name, paper, primaries, tvi50, tvi40, tac: condition.tac, bg: swop_like().bg };
|
||||
let base = GenericCmyk::new(params.clone());
|
||||
let points: Vec<([f32; 4], [f32; 3])> = patches
|
||||
.iter()
|
||||
.map(|p| {
|
||||
let want = relative(p.lab, paper_xyz);
|
||||
let got = base.to_lab_rel(p.cmyk);
|
||||
(p.cmyk, [want.l - got.l, want.a - got.a, want.b - got.b])
|
||||
})
|
||||
.collect();
|
||||
Some(GenericCmyk::with_correction(params, Lattice::fit(&points, smoothing)))
|
||||
}
|
||||
|
||||
/// Weight of the lattice's smoothness against its fit to the patches.
|
||||
pub(crate) const SMOOTHING: f64 = 0.02;
|
||||
|
||||
/// Knots of each ink's axis of the [`Lattice`]: the steps of the published single-ink ramps.
|
||||
const KNOTS: [f32; 9] = [0.0, 0.1, 0.2, 0.3, 0.4, 0.55, 0.7, 0.85, 1.0];
|
||||
const N: usize = KNOTS.len();
|
||||
const NODES: usize = N * N * N * N;
|
||||
|
||||
/// A Lab correction over CMYK, read by multilinear interpolation between nodes at [`KNOTS`].
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Lattice {
|
||||
values: Vec<[f32; 3]>,
|
||||
}
|
||||
|
||||
/// The cell of `v` along an axis and its position in it.
|
||||
fn locate(v: f32) -> (usize, f32) {
|
||||
let v = if v.is_finite() { v.clamp(0.0, 1.0) } else { 0.0 };
|
||||
let i = KNOTS.iter().skip(1).position(|k| v <= *k).unwrap_or(N - 2).min(N - 2);
|
||||
let (lo, hi) = (KNOTS[i], KNOTS[i + 1]);
|
||||
(i, ((v - lo) / (hi - lo)).clamp(0.0, 1.0))
|
||||
}
|
||||
|
||||
/// The 16 nodes around `cmyk` with their interpolation weights.
|
||||
fn corners(cmyk: [f32; 4]) -> [(usize, f32); 16] {
|
||||
let cells = cmyk.map(locate);
|
||||
let mut out = [(0, 0.0); 16];
|
||||
for (corner, slot) in out.iter_mut().enumerate() {
|
||||
let mut index = 0;
|
||||
let mut w = 1.0;
|
||||
for (axis, (cell, t)) in cells.iter().enumerate() {
|
||||
let up = corner & (1 << axis) != 0;
|
||||
index = index * N + cell + usize::from(up);
|
||||
w *= if up { *t } else { 1.0 - t };
|
||||
}
|
||||
*slot = (index, w);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Index strides of the four axes (C is the slowest).
|
||||
const STRIDES: [usize; 4] = [N * N * N, N * N, N, 1];
|
||||
|
||||
impl Lattice {
|
||||
/// The correction at `cmyk`.
|
||||
pub fn at(&self, cmyk: [f32; 4]) -> [f32; 3] {
|
||||
let mut out = [0f32; 3];
|
||||
for (i, w) in corners(cmyk) {
|
||||
if w == 0.0 {
|
||||
continue;
|
||||
}
|
||||
let v = self.values.get(i).copied().unwrap_or_default();
|
||||
for c in 0..3 {
|
||||
out[c] += w * v[c];
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// The lattice that best fits `points` (inks, correction) in the least-squares sense, with
|
||||
/// `smoothing` times the squared second differences of the nodes along each axis added to the
|
||||
/// error. The node at no ink stays 0, so the paper keeps the model's color (white, media-
|
||||
/// relative). Solved by conjugate gradients, one Lab channel at a time.
|
||||
pub fn fit(points: &[([f32; 4], [f32; 3])], smoothing: f64) -> Lattice {
|
||||
let weights: Vec<[(usize, f32); 16]> = points.iter().map(|(cmyk, _)| corners(*cmyk)).collect();
|
||||
// The divided second difference at interior knot j, scaled to a unit spacing of 1/8.
|
||||
let curvature: Vec<[f64; 3]> = (1..N - 1)
|
||||
.map(|j| {
|
||||
let (h1, h2) = (f64::from(KNOTS[j] - KNOTS[j - 1]), f64::from(KNOTS[j + 1] - KNOTS[j]));
|
||||
let s = 0.125f64 * 0.125;
|
||||
[2.0 / (h1 * (h1 + h2)) * s, -2.0 / (h1 * h2) * s, 2.0 / (h2 * (h1 + h2)) * s]
|
||||
})
|
||||
.collect();
|
||||
let apply = |x: &[f64], out: &mut [f64]| {
|
||||
out.fill(0.0);
|
||||
for w in &weights {
|
||||
let v: f64 = w.iter().map(|(i, w)| f64::from(*w) * x.get(*i).copied().unwrap_or(0.0)).sum();
|
||||
for (i, w) in w {
|
||||
if let Some(o) = out.get_mut(*i) {
|
||||
*o += f64::from(*w) * v;
|
||||
}
|
||||
}
|
||||
}
|
||||
for node in 0..NODES {
|
||||
let mut rest = node;
|
||||
for stride in STRIDES {
|
||||
let j = rest / stride;
|
||||
rest %= stride;
|
||||
// Only interior knots (1 to N − 2) have a second difference.
|
||||
let Some(c) = j.checked_sub(1).and_then(|k| curvature.get(k)) else { continue };
|
||||
let idx = [node - stride, node, node + stride];
|
||||
let d: f64 = idx.iter().zip(c).map(|(i, c)| c * x.get(*i).copied().unwrap_or(0.0)).sum();
|
||||
for (i, c) in idx.iter().zip(c) {
|
||||
if let Some(o) = out.get_mut(*i) {
|
||||
*o += smoothing * c * d;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (o, v) in out.iter_mut().zip(x) {
|
||||
*o += 1e-9 * v;
|
||||
}
|
||||
// The paper's node is held: with its right-hand side 0 it stays 0 in every iterate.
|
||||
if let (Some(o), Some(v)) = (out.first_mut(), x.first()) {
|
||||
*o = *v;
|
||||
}
|
||||
};
|
||||
let mut values = vec![[0f32; 3]; NODES];
|
||||
for ch in 0..3 {
|
||||
let mut b = vec![0f64; NODES];
|
||||
for (w, (_, r)) in weights.iter().zip(points) {
|
||||
for (i, w) in w {
|
||||
if let Some(o) = b.get_mut(*i) {
|
||||
*o += f64::from(*w) * f64::from(r[ch]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if let Some(o) = b.first_mut() {
|
||||
*o = 0.0;
|
||||
}
|
||||
let x = conjugate_gradients(&apply, &b, 4000);
|
||||
for (v, x) in values.iter_mut().zip(&x) {
|
||||
v[ch] = *x as f32;
|
||||
}
|
||||
}
|
||||
Lattice { values }
|
||||
}
|
||||
}
|
||||
|
||||
/// Solve `A x = b` for the symmetric positive definite `A` that `apply` multiplies by.
|
||||
fn conjugate_gradients(apply: &dyn Fn(&[f64], &mut [f64]), b: &[f64], max_iterations: usize) -> Vec<f64> {
|
||||
let n = b.len();
|
||||
let mut x = vec![0f64; n];
|
||||
let mut r = b.to_vec();
|
||||
let mut p = r.clone();
|
||||
let mut ap = vec![0f64; n];
|
||||
let dot = |a: &[f64], b: &[f64]| a.iter().zip(b).map(|(a, b)| a * b).sum::<f64>();
|
||||
let mut rr = dot(&r, &r);
|
||||
let stop = rr * 1e-20;
|
||||
for _ in 0..max_iterations {
|
||||
if rr <= stop || rr == 0.0 {
|
||||
break;
|
||||
}
|
||||
apply(&p, &mut ap);
|
||||
let pap = dot(&p, &ap);
|
||||
if pap <= 0.0 || !pap.is_finite() {
|
||||
break;
|
||||
}
|
||||
let alpha = rr / pap;
|
||||
for i in 0..n {
|
||||
x[i] += alpha * p[i];
|
||||
r[i] -= alpha * ap[i];
|
||||
}
|
||||
let next = dot(&r, &r);
|
||||
let beta = next / rr;
|
||||
rr = next;
|
||||
for i in 0..n {
|
||||
p[i] = r[i] + beta * p[i];
|
||||
}
|
||||
}
|
||||
x
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
use super::*;
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
fn hex(bytes: &[u8]) -> String {
|
||||
Sha256::digest(bytes).iter().map(|b| format!("{b:02x}")).collect()
|
||||
}
|
||||
|
||||
/// The data files ship exactly as Fogra publishes them in
|
||||
/// https://fogra.org/fileadmin/files/7_downloads/Charakterisierungsdaten/F51-52.zip.
|
||||
#[test]
|
||||
fn characterization_data_is_the_published_files() {
|
||||
let want = [
|
||||
("FOGRA51", "ad472a1c0bdafd558597ff93eeda5175805086565af814cb6346e910e2f25aa5", 57_111),
|
||||
("FOGRA52", "be4f0732328ed62ade63ec7f317d3b9e9dad6bbe2430fefddaf0f901d5ba13d6", 56_781),
|
||||
];
|
||||
for (c, (reference, sha, len)) in measured::CONDITIONS.iter().zip(want) {
|
||||
assert_eq!(c.reference, reference);
|
||||
assert_eq!((c.data.len(), hex(c.data).as_str()), (len, sha), "{reference}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_data_parses_into_its_patches() {
|
||||
for c in &measured::CONDITIONS {
|
||||
let patches = measured::parse(c.data).unwrap();
|
||||
assert_eq!(patches.len(), 1617, "{}", c.reference);
|
||||
assert_eq!(patches[0].cmyk, [0.0; 4]);
|
||||
}
|
||||
let p = measured::parse(measured::CONDITIONS[0].data).unwrap();
|
||||
assert_eq!(p[0].lab, Lab::new(95.0, 1.5, -6.0));
|
||||
assert_eq!(p[1].cmyk, [0.0, 0.1, 0.0, 0.0]);
|
||||
assert_eq!(p[1].lab, Lab::new(90.08, 8.15, -7.42));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn malformed_data_is_refused() {
|
||||
let file = |format: &str, rows: &str| format!("ISO28178\nBEGIN_DATA_FORMAT\n{format}\nEND_DATA_FORMAT\nBEGIN_DATA\n{rows}\nEND_DATA\n");
|
||||
let fields = "SAMPLE_ID CMYK_C CMYK_M CMYK_Y CMYK_K LAB_L LAB_A LAB_B";
|
||||
let good = file(fields, "1 0 0 0 0 95 1 -6\n2 100 0 0 0 55 -37 -50");
|
||||
assert_eq!(measured::parse(good.as_bytes()).map(|p| p.len()), Some(2));
|
||||
for bad in [
|
||||
file("SAMPLE_ID CMYK_C CMYK_M CMYK_Y LAB_L LAB_A LAB_B", "1 0 0 0 95 1 -6"),
|
||||
file(fields, "1 0 0 0 0 95 1"),
|
||||
file(fields, "1 0 0 0 0 95 NaN -6"),
|
||||
file(fields, "1 0 0 0 0 95 x -6"),
|
||||
file(fields, "1 0 0 0 101 95 1 -6"),
|
||||
file(fields, "1 -1 0 0 0 95 1 -6"),
|
||||
file(fields, ""),
|
||||
"BEGIN_DATA\n1 0 0 0 0 95 1 -6\nEND_DATA\n".into(),
|
||||
] {
|
||||
assert_eq!(measured::parse(bad.as_bytes()), None, "{bad}");
|
||||
}
|
||||
assert_eq!(measured::parse(&[0xff, 0xfe, 0x00]), None);
|
||||
// The rows end with END_DATA, and a NUMBER_OF_SETS in the header counts them.
|
||||
let rows = "1 0 0 0 0 95 1 -6\n2 100 0 0 0 55 -37 -50";
|
||||
let header = |sets: &str| format!("ISO28178\nBEGIN_DATA_FORMAT\n{fields}\nEND_DATA_FORMAT\n{sets}\nBEGIN_DATA\n{rows}\n");
|
||||
assert_eq!(measured::parse(header("NUMBER_OF_SETS\t2").as_bytes()), None, "no END_DATA");
|
||||
for (sets, len) in [
|
||||
("NUMBER_OF_SETS\t2", Some(2)),
|
||||
("NUMBER_OF_SETS\t3", None),
|
||||
("NUMBER_OF_SETS\t1", None),
|
||||
("NUMBER_OF_SETS\tx", None),
|
||||
("NUMBER_OF_SETS", None),
|
||||
] {
|
||||
assert_eq!(measured::parse(format!("{}END_DATA\n", header(sets)).as_bytes()).map(|p| p.len()), len, "{sets}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A paper measured as black has no XYZ to make the other patches relative to.
|
||||
#[test]
|
||||
fn a_paper_without_light_is_refused() {
|
||||
let c = &measured::CONDITIONS[0];
|
||||
let mut patches = measured::parse(c.data).unwrap();
|
||||
for p in patches.iter_mut().filter(|p| p.cmyk == [0.0; 4]) {
|
||||
p.lab = Lab::new(0.0, 0.0, 0.0);
|
||||
}
|
||||
assert!(measured::fit(c, &patches, measured::SMOOTHING).is_none());
|
||||
}
|
||||
|
||||
/// ΔE2000 between each measured patch and the model's absolute Lab for its inks: (mean, max).
|
||||
fn accuracy(g: &GenericCmyk, patches: &[measured::Patch]) -> (f32, f32) {
|
||||
let errors: Vec<f32> = patches.iter().map(|p| delta_e2000(g.to_lab_abs(p.cmyk), p.lab)).collect();
|
||||
(errors.iter().sum::<f32>() / errors.len() as f32, errors.iter().copied().fold(0.0, f32::max))
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_working_spaces_reproduce_the_measured_patches() {
|
||||
for c in &measured::CONDITIONS {
|
||||
let patches = measured::parse(c.data).unwrap();
|
||||
let start = std::time::Instant::now();
|
||||
let g = measured::model(c).unwrap();
|
||||
let took = start.elapsed();
|
||||
let (mean, max) = accuracy(&g, &patches);
|
||||
println!("{}: computed in {took:?}, mean ΔE2000 {mean:.3}, max {max:.3}", c.reference);
|
||||
assert!(mean < 0.1 && max < 0.6, "{}: mean {mean}, max {max}", c.reference);
|
||||
// The paper is the measured blank patch.
|
||||
assert!(delta_e2000(g.to_lab_abs([0.0; 4]), patches[0].lab) < 0.05);
|
||||
}
|
||||
}
|
||||
|
||||
/// A model fitted without every fourth patch (the paper and the solids and overprints stay in)
|
||||
/// predicts the patches it left out. The data repeats some builds, and every row of a build is
|
||||
/// on the side of the build's first row, so the fit never sees a left-out build.
|
||||
#[test]
|
||||
fn the_fit_predicts_patches_it_left_out() {
|
||||
for c in &measured::CONDITIONS {
|
||||
let patches = measured::parse(c.data).unwrap();
|
||||
let corner = |p: &measured::Patch| p.cmyk.iter().all(|v| *v == 0.0 || *v == 1.0);
|
||||
let first = |p: &measured::Patch| patches.iter().position(|q| q.cmyk == p.cmyk).unwrap_or(0);
|
||||
let (kept, left): (Vec<&measured::Patch>, Vec<_>) = patches.iter().partition(|p| first(p) % 4 != 3 || corner(p));
|
||||
assert!(left.iter().all(|l| kept.iter().all(|k| k.cmyk != l.cmyk)), "{}", c.reference);
|
||||
let kept: Vec<measured::Patch> = kept.into_iter().copied().collect();
|
||||
let left: Vec<measured::Patch> = left.into_iter().copied().collect();
|
||||
let g = measured::fit(c, &kept, measured::SMOOTHING).unwrap();
|
||||
let (mean, max) = accuracy(&g, &left);
|
||||
println!("{}: {} patches left out, mean ΔE2000 {mean:.3}, max {max:.3}", c.reference, left.len());
|
||||
assert!(mean < 0.3 && max < 2.5, "{}: mean {mean}, max {max}", c.reference);
|
||||
}
|
||||
}
|
||||
|
||||
/// More of any ink makes a build lighter by less than 0.3 L*, also where the data has few patches
|
||||
/// (black above 60%, and builds over the ink limit).
|
||||
#[test]
|
||||
fn more_ink_lightens_a_build_by_less_than_0_3_l() {
|
||||
let steps: Vec<f32> = (0..=20).map(|i| i as f32 / 20.0).collect();
|
||||
let coarse = [0.0, 0.25, 0.5, 0.75, 1.0];
|
||||
for c in &measured::CONDITIONS {
|
||||
let g = measured::model(c).unwrap();
|
||||
let mut worst = 0f32;
|
||||
for ink in 0..4 {
|
||||
for a in coarse {
|
||||
for b in coarse {
|
||||
for d in coarse {
|
||||
let mut others = [a, b, d].into_iter();
|
||||
let mut build = [0f32; 4];
|
||||
for (i, slot) in build.iter_mut().enumerate() {
|
||||
if i != ink {
|
||||
*slot = others.next().unwrap();
|
||||
}
|
||||
}
|
||||
let mut last = f32::INFINITY;
|
||||
for &v in &steps {
|
||||
build[ink] = v;
|
||||
let l = g.to_lab_rel(build).l;
|
||||
worst = worst.max(l - last);
|
||||
last = l;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
println!("{}: largest L* rise with more ink {worst:.3}", c.reference);
|
||||
assert!(worst < 0.3, "{}: {worst}", c.reference);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_working_spaces_follow_generic_cmyk_in_the_list() {
|
||||
let cmyk: Vec<String> = profiles().into_iter().filter(|p| p.kind == ProfileKind::Cmyk && p.builtin).map(|p| p.name).collect();
|
||||
assert_eq!(cmyk, [GENERIC_CMYK, FOGRA51_CMYK, FOGRA52_CMYK, DEVICE_CMYK]);
|
||||
assert_eq!(ColorSettings::default().cmyk, GENERIC_CMYK);
|
||||
assert_eq!(characterization(FOGRA51_CMYK), Some(("FOGRA51", "http://www.color.org")));
|
||||
assert_eq!(characterization(FOGRA52_CMYK), Some(("FOGRA52", "http://www.color.org")));
|
||||
assert_eq!(characterization(GENERIC_CMYK), None);
|
||||
assert!(matches!(register_icc(&icc_bytes(FOGRA51_CMYK).unwrap(), None), Err(CmsError::Unsupported(_))));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn colors_separate_and_come_back_in_the_measured_spaces() {
|
||||
for name in [FOGRA51_CMYK, FOGRA52_CMYK] {
|
||||
let cms = Cms::new(&ColorSettings { cmyk: name.into(), ..ColorSettings::default() }).unwrap();
|
||||
// A 50% gray (L* 53) lies well inside both measured gamuts (the darkest patches measure
|
||||
// L* 11.43 and 26.36), so it comes back whatever the gamut check says.
|
||||
let gray = [0.5, 0.5, 0.5];
|
||||
for srgb in [[0.8, 0.3, 0.2], [0.2, 0.5, 0.7], gray, [0.9, 0.85, 0.6], [0.1, 0.1, 0.1]] {
|
||||
let inks = cms.srgb_to_cmyk(srgb, Intent::RelativeColorimetric);
|
||||
assert!(inks.iter().sum::<f32>() <= 3.0 + 1e-3, "{name} {srgb:?}: {inks:?}");
|
||||
if srgb == gray || cms.gamut_error(&Color::Rgb { r: srgb[0], g: srgb[1], b: srgb[2] }) < GAMUT_THRESHOLD {
|
||||
let back = cms.cmyk_to_srgb(inks, false);
|
||||
let de = delta_e2000(lab::srgb_to_lab(srgb), lab::srgb_to_lab(back));
|
||||
assert!(de < 1.5, "{name} {srgb:?}: {inks:?} -> {back:?} (ΔE {de})");
|
||||
}
|
||||
}
|
||||
// White is paper with no ink, and black is the darkest build within the ink limit.
|
||||
assert_eq!(cms.srgb_to_cmyk([1.0; 3], Intent::RelativeColorimetric), [0.0; 4]);
|
||||
let black = cms.srgb_to_cmyk([0.0; 3], Intent::RelativeColorimetric);
|
||||
assert!(black[3] > 0.8 && black.iter().sum::<f32>() <= 3.0 + 1e-3, "{name}: {black:?}");
|
||||
}
|
||||
// The coated paper prints a larger gamut than the uncoated one.
|
||||
let blue = Color::Rgb { r: 0.1, g: 0.2, b: 0.6 };
|
||||
let coated = Cms::new(&ColorSettings { cmyk: FOGRA51_CMYK.into(), ..ColorSettings::default() }).unwrap();
|
||||
let uncoated = Cms::new(&ColorSettings { cmyk: FOGRA52_CMYK.into(), ..ColorSettings::default() }).unwrap();
|
||||
assert!(coated.gamut_error(&blue) < uncoated.gamut_error(&blue));
|
||||
}
|
||||
|
||||
/// Absolute Lab of `cmyk` in a context whose CMYK space is one of the Generic-type spaces.
|
||||
fn absolute_lab(cms: &Cms, cmyk: [f32; 4]) -> Lab {
|
||||
match &cms.cmyk {
|
||||
CmykSpace::Generic(g) => g.to_lab_abs(cmyk),
|
||||
CmykSpace::Device | CmykSpace::Icc(_) => panic!("not a Generic-type CMYK space"),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn absolute_cmyk_to_rgb_shows_the_paper() {
|
||||
for name in [GENERIC_CMYK, FOGRA51_CMYK, FOGRA52_CMYK] {
|
||||
let cms = Cms::new(&ColorSettings { cmyk: name.into(), ..ColorSettings::default() }).unwrap();
|
||||
let paper = cms.cmyk_to_rgb([0.0; 4], Intent::AbsoluteColorimetric);
|
||||
assert_eq!(paper, cms.srgb_to_rgb(cms.cmyk_to_srgb([0.0; 4], true)), "{name}");
|
||||
assert_ne!(paper, cms.cmyk_to_rgb([0.0; 4], Intent::RelativeColorimetric), "{name}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn absolute_cmyk_conversion_keeps_the_source_paper() {
|
||||
// Generic CMYK's paper (L* 93, b* 2.5) is darker and yellower than FOGRA51's (L* 95, b* -6),
|
||||
// so printing it on FOGRA51 paper takes ink.
|
||||
let generic = Cms::new(&ColorSettings { cmyk: GENERIC_CMYK.into(), ..ColorSettings::default() }).unwrap();
|
||||
let coated = Cms::new(&ColorSettings { cmyk: FOGRA51_CMYK.into(), ..ColorSettings::default() }).unwrap();
|
||||
let Color::Cmyk { c, m, y, k } = generic.convert_into(&coated, &Color::Cmyk { c: 0.0, m: 0.0, y: 0.0, k: 0.0 }, Intent::AbsoluteColorimetric)
|
||||
else {
|
||||
panic!("a CMYK colour converts to CMYK");
|
||||
};
|
||||
let inks = [c, m, y, k];
|
||||
assert!(inks.iter().sum::<f32>() > 0.01, "{inks:?}");
|
||||
let de = delta_e2000(absolute_lab(&coated, inks), absolute_lab(&generic, [0.0; 4]));
|
||||
assert!(de < 2.0, "{inks:?}: ΔE {de}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn the_profiles_carry_the_paper_and_the_data_source() {
|
||||
for c in &measured::CONDITIONS {
|
||||
let start = std::time::Instant::now();
|
||||
let bytes = icc_bytes(c.name).unwrap();
|
||||
println!("{}: {} bytes in {:?}", c.reference, bytes.len(), start.elapsed());
|
||||
let p = moxcms::ColorProfile::new_from_slice(&bytes).unwrap();
|
||||
assert_eq!(
|
||||
(p.profile_class, p.color_space, p.pcs),
|
||||
(moxcms::ProfileClass::OutputDevice, moxcms::DataColorSpace::Cmyk, moxcms::DataColorSpace::Lab)
|
||||
);
|
||||
assert!(p.lut_a_to_b_perceptual.is_some() && p.lut_b_to_a_perceptual.is_some() && p.lut_a_to_b_colorimetric.is_some());
|
||||
let paper = lab::lab_to_xyz(measured::parse(c.data).unwrap()[0].lab);
|
||||
let white = p.media_white_point.unwrap();
|
||||
for (got, want) in [white.x, white.y, white.z].iter().zip(paper) {
|
||||
assert!((*got - f64::from(want)).abs() < 2e-3, "{}: {white:?} vs {paper:?}", c.reference);
|
||||
}
|
||||
let text = format!("{:?}", p.copyright);
|
||||
assert!(text.contains(c.reference) && text.contains("Fogra"), "{text}");
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,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\", 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.newFromTemplate, 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 bpc 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 (built in: \"VectorCraft Generic CMYK (SWOP-like)\" (default), \"VectorCraft Coated CMYK (FOGRA51)\" and \"VectorCraft Uncoated CMYK (FOGRA52)\" (computed from Fogra's characterization data), \"Device CMYK (uncalibrated)\"), 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.newFromTemplate, 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 bpc 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
|
||||
),
|
||||
|
||||
@@ -128,7 +128,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"Export PDF",
|
||||
[],
|
||||
None,
|
||||
"{path?, preset?: \"VectorCraft Default\" (built-in or saved: pdf.preset.list), artboard? | artboards?: [i…] | range?: \"1-3, 5\" (1-based; default all, one page each), useArtboards?: true (false: one page, the bounds of the visible art the page draws (non-printing layers left out unless includeNonPrinting or createLayers keeps them), as document.export writes it; artboard, artboards and range are then ignored, Preserve Editing is left out (with a warning when it is on), and a document with no visible art is refused), standard?: none|pdfA2b|pdfX1a (CMYK, grey and spot colours only: colours and images converted to output.destination or the CMYK output intent, untagged; transparency flattened with flattenerPreset; PDF 1.3)|pdfX3 (colours ICC-tagged, CMYK in the output intent's profile as DeviceCMYK; transparency flattened; PDF 1.3)|pdfX4 (transparency and layers kept; colours ICC-tagged, CMYK in the output intent's profile as DeviceCMYK; PDF 1.6 at most) (PDF/X: a /GTS_PDFX output intent, by default the CMYK profile in effect, embedded; TrimBox, Trapped, GTS_PDFXVersion, title and dates; fonts embedded or outlined), compatibility?: 1.3 (no transparency: it is flattened with flattenerPreset, without the layers the file leaves out; images keep no see-through pixels)|1.4|1.5|1.6|1.7 (default)|2.0 (choosing a standard sets its version: 1.7 for pdfA2b, 1.6 for pdfX4, 1.3 for pdfX1a and pdfX3, which write 1.4 as 1.3 too; pdfA2b refuses 1.3; in pdfA2b files, and with longPagesInPoints: false, a page with a side longer than 14,400 pt keeps its size with a UserUnit from 1.6 on: 1.5 is then written as 1.6, with 1.5's encryption, and so is 1.4 in pdfA2b files, with a warning; PDF/X files and other 1.3 and 1.4 files write it in points, and 1.3 and 1.4 (pdfX1a and pdfX3 too) refuse a page past 32,767 pt whose size or art needs a real number past 32,767; a page whose short side is 3 pt or longer but would be under 3 units at that UserUnit gets a smaller one that keeps the short side at 3 units; a warning gives each such page's size), longPagesInPoints?: true (such a page is written at its size in points, without a UserUnit, at every version, and 1.5 stays 1.5, in files without a standard (PDF/A files keep the UserUnit); apps that keep to the limit cut it to 200 in; false: the UserUnit as above, with a warning that names this option), preserveEditing? (on in VectorCraft Default: the native document as an embedded file, which document.open restores; choosing a standard turns it off, a standard refuses it), thumbnails? (each page drawn as a /Thumb image, 106 px on its long side), fastWebView? (a linearised file: the first page shows while the rest downloads; it stays linearised when encrypted), viewAfterSaving? (the app opens the written file), createLayers? (each layer and sublayer but template layers as a PDF layer, an optional content group listed under its layer's: hidden layers off, non-printing ones /PrintState /OFF, locked ones locked; needs 1.5 or later; they reopen as layers; choosing pdfX1a or pdfX3 turns it off; they refuse it), includeNonPrinting? (keep layers whose Print option is off; left out by default unless createLayers), flattenerPreset?: \"\" (High Resolution) | high | medium | low | a saved preset (flattener.presets.list): what PDF 1.3 files flatten transparency with, flattener?: {object.flattenTransparency options over it}, compression?: {color?, gray?: {downsample: none|average|subsample|bicubic, ppi: 300, abovePpi: 450, compression: none|zip|jpeg|jpeg2000|auto, quality: minimum|low|medium|high|maximum}, mono?: {downsample, ppi: 1200, abovePpi: 1800, compression: none|ccittG3|ccittG4|zip|runLength} (black-and-white images), compressText?: true} (images above abovePpi are resampled to ppi; auto keeps JPEGs JPEG, the others lossless; JPEG needs opaque images; none, jpeg2000, CCITT and runLength are written as ZIP with a warning), marks?: {trim, registration, colorBars, pageInfo, kind: roman|japanese, weight: 0.25 (trim marks and targets), offset: 6 (pt from the artboard, at least the bleed)} (printer's marks in [Registration], every plate: trim marks, registration targets mid-side, CMYK/spot/black-tint colour bars on top, page information (title, artboard, date UTC) below), bleed?: {useDocument (the document's bleed, document.setup), top, bottom, left, right} (pt; art in the bleed is kept; a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning, and so does a count of the visible objects that reach the trim edge (within 0.5 pt) on a side with a bleed but end before the bleed edge; layers that don't print are left out unless includeNonPrinting, and art and boxes are written unchanged). Each page: TrimBox = artboard, BleedBox = artboard + bleed, MediaBox = that + the marks' room (art clipped to the BleedBox), output?: {conversion: none (default)|destination (every colour into the destination profile's model, CMYK or RGB, also colours of that model in
Line truncated
|
||||
"{path?, preset?: \"VectorCraft Default\" (built-in or saved: pdf.preset.list), artboard? | artboards?: [i…] | range?: \"1-3, 5\" (1-based; default all, one page each), useArtboards?: true (false: one page, the bounds of the visible art the page draws (non-printing layers left out unless includeNonPrinting or createLayers keeps them), as document.export writes it; artboard, artboards and range are then ignored, Preserve Editing is left out (with a warning when it is on), and a document with no visible art is refused), standard?: none|pdfA2b|pdfX1a (CMYK, grey and spot colours only: colours and images converted to output.destination or the CMYK output intent, untagged; transparency flattened with flattenerPreset; PDF 1.3)|pdfX3 (colours ICC-tagged, CMYK in the output intent's profile as DeviceCMYK; transparency flattened; PDF 1.3)|pdfX4 (transparency and layers kept; colours ICC-tagged, CMYK in the output intent's profile as DeviceCMYK; PDF 1.6 at most) (PDF/X: a /GTS_PDFX output intent, by default the CMYK profile in effect, embedded; TrimBox, Trapped, GTS_PDFXVersion, title and dates; fonts embedded or outlined), compatibility?: 1.3 (no transparency: it is flattened with flattenerPreset, without the layers the file leaves out; images keep no see-through pixels)|1.4|1.5|1.6|1.7 (default)|2.0 (choosing a standard sets its version: 1.7 for pdfA2b, 1.6 for pdfX4, 1.3 for pdfX1a and pdfX3, which write 1.4 as 1.3 too; pdfA2b refuses 1.3; in pdfA2b files, and with longPagesInPoints: false, a page with a side longer than 14,400 pt keeps its size with a UserUnit from 1.6 on: 1.5 is then written as 1.6, with 1.5's encryption, and so is 1.4 in pdfA2b files, with a warning; PDF/X files and other 1.3 and 1.4 files write it in points, and 1.3 and 1.4 (pdfX1a and pdfX3 too) refuse a page past 32,767 pt whose size or art needs a real number past 32,767; a page whose short side is 3 pt or longer but would be under 3 units at that UserUnit gets a smaller one that keeps the short side at 3 units; a warning gives each such page's size), longPagesInPoints?: true (such a page is written at its size in points, without a UserUnit, at every version, and 1.5 stays 1.5, in files without a standard (PDF/A files keep the UserUnit); apps that keep to the limit cut it to 200 in; false: the UserUnit as above, with a warning that names this option), preserveEditing? (on in VectorCraft Default: the native document as an embedded file, which document.open restores; choosing a standard turns it off, a standard refuses it), thumbnails? (each page drawn as a /Thumb image, 106 px on its long side), fastWebView? (a linearised file: the first page shows while the rest downloads; it stays linearised when encrypted), viewAfterSaving? (the app opens the written file), createLayers? (each layer and sublayer but template layers as a PDF layer, an optional content group listed under its layer's: hidden layers off, non-printing ones /PrintState /OFF, locked ones locked; needs 1.5 or later; they reopen as layers; choosing pdfX1a or pdfX3 turns it off; they refuse it), includeNonPrinting? (keep layers whose Print option is off; left out by default unless createLayers), flattenerPreset?: \"\" (High Resolution) | high | medium | low | a saved preset (flattener.presets.list): what PDF 1.3 files flatten transparency with, flattener?: {object.flattenTransparency options over it}, compression?: {color?, gray?: {downsample: none|average|subsample|bicubic, ppi: 300, abovePpi: 450, compression: none|zip|jpeg|jpeg2000|auto, quality: minimum|low|medium|high|maximum}, mono?: {downsample, ppi: 1200, abovePpi: 1800, compression: none|ccittG3|ccittG4|zip|runLength} (black-and-white images), compressText?: true} (images above abovePpi are resampled to ppi; auto keeps JPEGs JPEG, the others lossless; JPEG needs opaque images; none, jpeg2000, CCITT and runLength are written as ZIP with a warning), marks?: {trim, registration, colorBars, pageInfo, kind: roman|japanese, weight: 0.25 (trim marks and targets), offset: 6 (pt from the artboard, at least the bleed)} (printer's marks in [Registration], every plate: trim marks, registration targets mid-side, CMYK/spot/black-tint colour bars on top, page information (title, artboard, date UTC) below), bleed?: {useDocument (the document's bleed, document.setup), top, bottom, left, right} (pt; art in the bleed is kept; a PDF/X file with no bleed on a side where the document's bleed has one comes back with a warning, and so does a count of the visible objects that reach the trim edge (within 0.5 pt) on a side with a bleed but end before the bleed edge; layers that don't print are left out unless includeNonPrinting, and art and boxes are written unchanged). Each page: TrimBox = artboard, BleedBox = artboard + bleed, MediaBox = that + the marks' room (art clipped to the BleedBox), output?: {conversion: none (default)|destination (every colour into the destination profile's model, CMYK or RGB, also colours of that model in
Line truncated
|
||||
has_doc,
|
||||
export_pdf
|
||||
),
|
||||
|
||||
@@ -615,6 +615,10 @@ impl Dest {
|
||||
|
||||
/// The catalog entries `set` asks for (none in PDF/A files, which carry their own); a PDF/X file's
|
||||
/// output intent profile is `cmyk_profile` (the CMYK profile in effect) unless `set` names one.
|
||||
/// When the settings leave the condition identifier blank, a profile computed for a registered
|
||||
/// printing condition ([`cms::characterization`]) gives the condition's name as the identifier,
|
||||
/// and its registry when the settings leave the registry blank too. An identifier set in the
|
||||
/// settings is written as given, with the settings' registry.
|
||||
fn catalog(set: &PdfSettings, cmyk_profile: &str) -> Option<Catalog> {
|
||||
let o = &set.output;
|
||||
if set.standard == Standard::PdfA2b {
|
||||
@@ -631,13 +635,13 @@ fn catalog(set: &PdfSettings, cmyk_profile: &str) -> Option<Catalog> {
|
||||
ProfileKind::Gray => None,
|
||||
});
|
||||
let text = |s: &str| s.trim().chars().take(MAX_TEXT).collect::<String>();
|
||||
OutputIntent {
|
||||
id: text(if id.is_empty() { name } else { id }),
|
||||
condition: text(&o.output_condition),
|
||||
registry: text(&o.registry),
|
||||
info: text(name),
|
||||
profile,
|
||||
}
|
||||
// Without a condition identifier, a profile computed for a registered printing condition
|
||||
// names that condition and, unless the settings name one, the registry it belongs to.
|
||||
let (id, registry) = match cms::characterization(name) {
|
||||
Some((reference, registry)) if id.is_empty() => (reference, if o.registry.trim().is_empty() { registry } else { o.registry.as_str() }),
|
||||
_ => (if id.is_empty() { name } else { id }, o.registry.as_str()),
|
||||
};
|
||||
OutputIntent { id: text(id), condition: text(&o.output_condition), registry: text(registry), info: text(name), profile }
|
||||
});
|
||||
let trapped = (o.trapped || intent.is_some()).then_some(o.trapped);
|
||||
(intent.is_some() || trapped.is_some()).then_some(Catalog { intent, trapped })
|
||||
|
||||
@@ -151,6 +151,75 @@ fn each_standard_writes_its_header_output_intent_boxes_and_identification() {
|
||||
assert!(matches!(e, Err(PdfError::BadSetting(m)) if m.contains("embeds")));
|
||||
}
|
||||
|
||||
/// The ICC tag signatures of `icc`'s tag table.
|
||||
fn icc_tags(icc: &[u8]) -> Vec<String> {
|
||||
let count = u32::from_be_bytes(icc[128..132].try_into().unwrap()) as usize;
|
||||
(0..count).map(|i| String::from_utf8_lossy(&icc[132 + 12 * i..136 + 12 * i]).into_owned()).collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_registered_condition_profile_names_its_condition_and_embeds_itself() {
|
||||
use std::io::Read;
|
||||
let d = doc(&[Color::cmyk(0.0, 1.0, 1.0, 0.0), Color::cmyk(0.6, 0.0, 0.2, 0.1)]);
|
||||
for (profile, reference) in [(cms::FOGRA51_CMYK, "FOGRA51"), (cms::FOGRA52_CMYK, "FOGRA52")] {
|
||||
let r = export_with_report(&d, &opts(Standard::PdfX4, |s| s.output.output_intent = profile.into())).unwrap();
|
||||
assert!(r.warnings.is_empty(), "{:?}", r.warnings);
|
||||
let t = text(&r.bytes);
|
||||
let info = profile.replace('(', r"\(").replace(')', r"\)");
|
||||
for want in [
|
||||
"/S/GTS_PDFX".to_string(),
|
||||
format!("/OutputConditionIdentifier({reference})"),
|
||||
"/RegistryName(http://www.color.org)".into(),
|
||||
format!("/Info({info})"),
|
||||
] {
|
||||
assert!(t.contains(&want), "{profile}: {want}");
|
||||
}
|
||||
// The embedded profile is the working space's: a CMYK output profile with Lab tables both
|
||||
// ways, read from the file's bytes.
|
||||
let oi: u32 = t.split("/DestOutputProfile ").nth(1).unwrap().split(' ').next().unwrap().parse().unwrap();
|
||||
let (start, end) = crate::patch::Xref::read(&r.bytes).unwrap().dict(&r.bytes, oi).unwrap();
|
||||
let obj = &r.bytes[start..end];
|
||||
let at = crate::lab_spot::find(obj, b"/Length", 0).unwrap();
|
||||
let (length, _) = crate::patch::number(obj, at + b"/Length".len()).unwrap();
|
||||
let mut data = crate::lab_spot::find(obj, b"stream", at).unwrap() + b"stream".len();
|
||||
data += obj[data..].iter().take(2).take_while(|b| matches!(b, b'\r' | b'\n')).count();
|
||||
let raw = &obj[data..data + length];
|
||||
let mut icc = vec![];
|
||||
if crate::lab_spot::find(&obj[..data], b"/FlateDecode", 0).is_some() {
|
||||
flate2::read::ZlibDecoder::new(raw).read_to_end(&mut icc).unwrap();
|
||||
} else {
|
||||
icc = raw.to_vec();
|
||||
}
|
||||
assert_eq!(icc.as_slice(), &*cms::icc_bytes(profile).unwrap());
|
||||
assert_eq!((&icc[12..16], &icc[16..20], &icc[20..24], &icc[36..40]), (&b"prtr"[..], &b"CMYK"[..], &b"Lab "[..], &b"acsp"[..]));
|
||||
assert!(matches!(icc[8], 2 | 4), "ICC version {}", icc[8]);
|
||||
let tags = icc_tags(&icc);
|
||||
for tag in ["A2B0", "B2A0", "A2B1", "B2A1", "gamt", "wtpt", "desc", "cprt"] {
|
||||
assert!(tags.iter().any(|t| t == tag), "{profile}: {tag} in {tags:?}");
|
||||
}
|
||||
let back = cms::IccProfile::from_bytes(None, &icc).unwrap();
|
||||
assert_eq!((back.name.as_str(), back.kind), (profile, cms::ProfileKind::Cmyk));
|
||||
assert!(import(&r.bytes).is_ok());
|
||||
}
|
||||
// A condition identifier or registry the settings give stays.
|
||||
let o = opts(Standard::PdfX4, |s| {
|
||||
s.output.output_intent = cms::FOGRA51_CMYK.into();
|
||||
s.output.output_condition_id = "Press 2".into();
|
||||
});
|
||||
let t = text(&export(&d, &o).unwrap());
|
||||
assert!(t.contains("/OutputConditionIdentifier(Press 2)") && !t.contains("/RegistryName"), "{t}");
|
||||
let o = opts(Standard::PdfX4, |s| {
|
||||
s.output.output_intent = cms::FOGRA51_CMYK.into();
|
||||
s.output.registry = "https://example.com/registry".into();
|
||||
});
|
||||
let t = text(&export(&d, &o).unwrap());
|
||||
assert!(t.contains("/OutputConditionIdentifier(FOGRA51)") && t.contains("/RegistryName(https://example.com/registry)"));
|
||||
// Other profiles keep their name as the identifier, with no registry.
|
||||
let t = text(&export(&d, &opts(Standard::PdfX4, |s| s.output.output_intent = GENERIC_CMYK.into())).unwrap());
|
||||
let id = GENERIC_CMYK.replace('(', r"\(").replace(')', r"\)");
|
||||
assert!(t.contains(&format!("/OutputConditionIdentifier({id})")) && !t.contains("/RegistryName"), "{t}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pdfx_1a_files_have_no_rgb() {
|
||||
let mut d = doc(&[Color::rgb(0.9, 0.1, 0.1), Color::Lab { l: 50.0, a: 40.0, b: -20.0 }, Color::gray(0.5), Color::cmyk(0.1, 0.2, 0.3, 0.4)]);
|
||||
|
||||
@@ -6624,6 +6624,8 @@ arrowhead Feather Перо
|
||||
VectorCraft Default По подразбиране за VectorCraft
|
||||
VectorCraft Defaults Стандартни настройки на VectorCraft
|
||||
VectorCraft Generic CMYK (SWOP-like) Общ CMYK за VectorCraft (подобен на SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) Мелиран CMYK за VectorCraft (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) Немелиран CMYK за VectorCraft (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) Образци на VectorCraft (.vcswatches)
|
||||
Vertical Align Вертикално подравняване
|
||||
Vertical Area Type Вертикално въвеждане в област
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -657,6 +657,8 @@
|
||||
RGB RGB
|
||||
sRGB IEC61966-2.1 sRGB IEC61966-2.1
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraft generički CMYK (sličan SWOP-u)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraft premazani CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraft nepremazani CMYK (FOGRA52)
|
||||
Legacy Macintosh RGB (Gamma 1.8) Naslijeđeni Macintosh RGB (gama 1.8)
|
||||
Internet Standard RGB (sRGB) Internet standardni RGB (sRGB)
|
||||
Monitor RGB RGB monitora
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -5970,6 +5970,8 @@ digits Malayalam Malaiàlam
|
||||
VectorCraft didn't quit normally last time. These documents had unsaved changes: VectorCraft no es va tancar correctament l’última vegada. Aquests documents tenien canvis no desats:
|
||||
VectorCraft documents: one locked object, updated when the file changes. Documents de VectorCraft: un objecte bloquejat, actualitzat quan canvia el fitxer.
|
||||
VectorCraft Generic CMYK (SWOP-like) CMYK genèric de VectorCraft (similar a SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) CMYK estucat de VectorCraft (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) CMYK no estucat de VectorCraft (FOGRA52)
|
||||
VectorCraft Help… Ajuda de VectorCraft…
|
||||
VectorCraft on getartcraft.com VectorCraft a getartcraft.com
|
||||
VectorCraft on GitHub VectorCraft al GitHub
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -669,6 +669,8 @@
|
||||
RGB RGB
|
||||
sRGB IEC61966-2.1 sRGB IEC61966-2.1
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraft obecný CMYK (podobný SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraft natíraný CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraft nenatíraný CMYK (FOGRA52)
|
||||
Legacy Macintosh RGB (Gamma 1.8) Starší Macintosh RGB (gama 1,8)
|
||||
Internet Standard RGB (sRGB) Standardní internetové RGB (sRGB)
|
||||
Monitor RGB RGB monitoru
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -3441,6 +3441,8 @@ liquify-list-end {0}, {1} {0} og {1}
|
||||
RGB RGB
|
||||
sRGB IEC61966-2.1 sRGB IEC61966-2.1
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraft-generisk CMYK (SWOP-lignende)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraft bestrøget CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraft ubestrøget CMYK (FOGRA52)
|
||||
Legacy Macintosh RGB (Gamma 1.8) Ældre Macintosh RGB (gamma 1,8)
|
||||
Internet Standard RGB (sRGB) Internetstandard-RGB (sRGB)
|
||||
Monitor RGB Skærm-RGB
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6625,6 +6625,8 @@ arrowhead Feather Φτερό
|
||||
VectorCraft Default Προεπιλογή VectorCraft
|
||||
VectorCraft Defaults Προεπιλογές VectorCraft
|
||||
VectorCraft Generic CMYK (SWOP-like) Γενικό CMYK του VectorCraft (τύπου SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) CMYK επιχρισμένου χαρτιού του VectorCraft (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) CMYK μη επιχρισμένου χαρτιού του VectorCraft (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) Δείγματα χρωμάτων VectorCraft (.vcswatches)
|
||||
Vertical Align Κατακόρυφη στοίχιση
|
||||
Vertical Area Type Κατακόρυφο κείμενο περιοχής
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6795,6 +6795,8 @@ mark-style Japanese Japonesas
|
||||
Variation Variación
|
||||
VectorCraft Default Predeterminado de VectorCraft
|
||||
VectorCraft Generic CMYK (SWOP-like) CMYK genérico de VectorCraft (similar a SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) CMYK estucado de VectorCraft (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) CMYK no estucado de VectorCraft (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) Muestras de VectorCraft (.vcswatches)
|
||||
Vertical Area Type Texto de área vertical
|
||||
Vertical Type Texto vertical
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -663,6 +663,8 @@
|
||||
RGB RGB
|
||||
sRGB IEC61966-2.1 sRGB IEC61966-2.1
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraftin yleinen CMYK (SWOP-tyyppinen)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraftin päällystetty CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraftin päällystämätön CMYK (FOGRA52)
|
||||
Legacy Macintosh RGB (Gamma 1.8) Vanha Macintosh RGB (gamma 1.8)
|
||||
Internet Standard RGB (sRGB) Internetin standardi-RGB (sRGB)
|
||||
Monitor RGB Näytön RGB
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6906,6 +6906,8 @@ arrowhead Feather Empennage
|
||||
VectorCraft Default VectorCraft par défaut
|
||||
VectorCraft Defaults Valeurs par défaut de VectorCraft
|
||||
VectorCraft Generic CMYK (SWOP-like) CMJN générique VectorCraft (de type SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) CMJN couché VectorCraft (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) CMJN non couché VectorCraft (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) Nuances VectorCraft (.vcswatches)
|
||||
Vertical Align Alignement vertical
|
||||
Vertical Area Type Texte captif vertical
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6399,6 +6399,8 @@ arrowhead Feather पंख
|
||||
VectorCraft didn't quit normally last time. These documents had unsaved changes: पिछली बार VectorCraft सामान्य तरीके से बंद नहीं हुआ था। इन डॉक्यूमेंट्स में बिना सेव किए बदलाव थे:
|
||||
VectorCraft documents: one locked object, updated when the file changes. VectorCraft डॉक्यूमेंट्स: एक लॉक्ड ऑब्जेक्ट, जो फ़ाइल बदलने पर अपडेट होता है।
|
||||
VectorCraft Generic CMYK (SWOP-like) वेक्टर क्रेफ्ट जेनेरिक CMYK (SWOP-like)
|
||||
VectorCraft Coated CMYK (FOGRA51) वेक्टर क्रेफ्ट कोटेड CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) वेक्टर क्रेफ्ट अनकोटेड CMYK (FOGRA52)
|
||||
VectorCraft Help… VectorCraft मदद…
|
||||
VectorCraft on getartcraft.com getartcraft.com पर VectorCraft
|
||||
VectorCraft on GitHub GitHub पर VectorCraft
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -5344,6 +5344,8 @@ mark-style Japanese Japán
|
||||
VectorCraft didn't quit normally last time. These documents had unsaved changes: A VectorCraft legutóbb nem szabályosan lépett ki. Ezekben a dokumentumokban mentetlen módosítások voltak:
|
||||
VectorCraft documents: one locked object, updated when the file changes. VectorCraft-dokumentumok: egyetlen zárolt objektum, amely a fájl változásakor frissül.
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraft általános CMYK (SWOP-szerű)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraft mázolt CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraft mázolatlan CMYK (FOGRA52)
|
||||
VectorCraft Help… VectorCraft súgó…
|
||||
VectorCraft on getartcraft.com A VectorCraft a getartcraft.com oldalon
|
||||
VectorCraft on GitHub A VectorCraft a GitHubon
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1316,6 +1316,8 @@
|
||||
RGB RGB
|
||||
sRGB IEC61966-2.1 sRGB IEC61966-2.1
|
||||
VectorCraft Generic CMYK (SWOP-like) CMYK generik VectorCraft (mirip SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) CMYK kertas berlapis VectorCraft (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) CMYK kertas tanpa lapisan VectorCraft (FOGRA52)
|
||||
Legacy Macintosh RGB (Gamma 1.8) RGB Macintosh lama (Gamma 1.8)
|
||||
Internet Standard RGB (sRGB) RGB standar Internet (sRGB)
|
||||
Monitor RGB RGB monitor
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8403,6 +8403,8 @@ mark-style Japanese იაპონური
|
||||
Variation ვარიაცია
|
||||
VectorCraft Default VectorCraft-ის ნაგულისხმევი
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraft-ის ზოგადი CMYK (SWOP-ის მსგავსი)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraft-ის ცარციანი ქაღალდის CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraft-ის უცარცო ქაღალდის CMYK (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) VectorCraft-ის ფერის ნიმუშები (.vcswatches)
|
||||
Vertical Area Type ვერტიკალური არის ტექსტი
|
||||
Vertical Type ვერტიკალური ტექსტი
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1302,6 +1302,8 @@ liquify-list-end {0}, {1} {0} en {1}
|
||||
RGB RGB
|
||||
sRGB IEC61966-2.1 sRGB IEC61966-2.1
|
||||
VectorCraft Generic CMYK (SWOP-like) Generieke VectorCraft-CMYK (SWOP-achtig)
|
||||
VectorCraft Coated CMYK (FOGRA51) Gestreken VectorCraft-CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) Ongestreken VectorCraft-CMYK (FOGRA52)
|
||||
Legacy Macintosh RGB (Gamma 1.8) Verouderde Macintosh-RGB (Gamma 1.8)
|
||||
Internet Standard RGB (sRGB) Internetstandaard-RGB (sRGB)
|
||||
Monitor RGB Monitor-RGB
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6773,6 +6773,8 @@ mark-style Japanese Japonesas
|
||||
Variation Variação
|
||||
VectorCraft Default Padrão do VectorCraft
|
||||
VectorCraft Generic CMYK (SWOP-like) CMYK Genérico do VectorCraft (tipo SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) CMYK Revestido do VectorCraft (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) CMYK Não Revestido do VectorCraft (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) Amostras do VectorCraft (.vcswatches)
|
||||
Vertical Area Type Texto de Área Vertical
|
||||
Vertical Type Texto Vertical
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -8005,6 +8005,8 @@ arrowhead Target Мишень
|
||||
VectorCraft Default VectorCraft по умолчанию
|
||||
VectorCraft Defaults Стандартные VectorCraft
|
||||
VectorCraft Generic CMYK (SWOP-like) Общий CMYK VectorCraft (как SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) CMYK VectorCraft для мелованной бумаги (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) CMYK VectorCraft для немелованной бумаги (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) Образцы VectorCraft (.vcswatches)
|
||||
Vertical Align Вертикальное выравнивание
|
||||
Vertical Area Type Вертикальный текст в области
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6817,6 +6817,8 @@ arrowhead Feather Fjäder
|
||||
VectorCraft Default VectorCraft-standard
|
||||
VectorCraft Defaults VectorCraft-standardvärden
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraft allmän CMYK (SWOP-liknande)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraft bestruken CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraft obestruken CMYK (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) VectorCraft-färgrutor (.vcswatches)
|
||||
Vertical Align Vertikal justering
|
||||
Vertical Area Type Vertikal områdestext
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6662,6 +6662,8 @@ arrowhead Feather Tüy
|
||||
VectorCraft Default VectorCraft Varsayılanı
|
||||
VectorCraft Defaults VectorCraft Varsayılanları
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraft Genel CMYK (SWOP benzeri)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraft Kaplamalı CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraft Kaplamasız CMYK (FOGRA52)
|
||||
VectorCraft Swatches (.vcswatches) VectorCraft Renk Örnekleri (.vcswatches)
|
||||
Vertical Align Dikey Hizalama
|
||||
Vertical Area Type Dikey Alan Türü
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -6212,6 +6212,8 @@ liquify-list-end {0}, {1} {0}和{1}
|
||||
Photo Low Fidelity 低保真照片
|
||||
Restricted Colors 受限颜色
|
||||
VectorCraft Generic CMYK (SWOP-like) VectorCraft 通用 CMYK (类 SWOP)
|
||||
VectorCraft Coated CMYK (FOGRA51) VectorCraft 涂布纸 CMYK (FOGRA51)
|
||||
VectorCraft Uncoated CMYK (FOGRA52) VectorCraft 非涂布纸 CMYK (FOGRA52)
|
||||
sRGB IEC61966-2.1 sRGB IEC61966-2.1
|
||||
Working RGB 工作 RGB
|
||||
Dot Gain 15% 网点扩大 15%
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -59,6 +59,15 @@ pub(crate) fn row(ui: &mut Ui, label: &str, value: &str) -> bool {
|
||||
clicked
|
||||
}
|
||||
|
||||
/// Whether no artwork is selected. Artboards the Artboard tool has selected are not artwork:
|
||||
/// `document.info` lists them under Document whatever this says.
|
||||
fn no_artwork_selected(app: &VectorcraftApp) -> bool {
|
||||
match app.session.active() {
|
||||
Some(st) => st.selection.objects.is_empty(),
|
||||
None => true,
|
||||
}
|
||||
}
|
||||
|
||||
/// `document.info` with its categories, fetched again only when the document, the scope or the
|
||||
/// artboards the Artboard tool has selected change. A frame that fetches nothing returns the stored
|
||||
/// result without copying it and stores nothing; a failed fetch leaves the stored result as it was.
|
||||
@@ -85,6 +94,9 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let DocInfoView { selection_only: sel_only, category } = app.ui.doc_info.clone();
|
||||
let mut copy = None;
|
||||
Stack::new().show(ui, |ui, _| {
|
||||
if sel_only && no_artwork_selected(app) {
|
||||
Text::new(tl!("(No artwork selected)").to_string()).shade(Shade::Muted).show(ui);
|
||||
}
|
||||
let sections = i["sections"].as_array().map_or(&[][..], Vec::as_slice);
|
||||
let shown = sections.iter().filter(|s| category.is_empty() || s["id"] == category.as_str());
|
||||
for (n, s) in shown.enumerate() {
|
||||
@@ -919,4 +931,79 @@ mod tests {
|
||||
assert_eq!(in_lang("de", &json!({"type": "grid", "rows": 1, "cols": 3, "instances": 3})), "Rasterwiederholung, 1 Zeile × 3 Spalten");
|
||||
assert_eq!(repeat_value(&json!({"type": "spiral", "instances": 2})), None);
|
||||
}
|
||||
|
||||
/// Objects rows the panel paints with Selection Only `on`, the Objects category shown.
|
||||
fn objects_panel(app: &mut VectorcraftApp, on: bool) -> String {
|
||||
app.ui.doc_info.selection_only = on;
|
||||
app.ui.doc_info.category = "objects".to_string();
|
||||
crate::tests_labels::painted_text(app, show)
|
||||
}
|
||||
|
||||
/// With Selection Only off, Objects counts every object in the document.
|
||||
#[test]
|
||||
fn test_doc_info_counts_entire_document() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({"width": 200, "height": 200})).unwrap();
|
||||
app.session.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 40, "height": 20})).unwrap();
|
||||
app.session.execute("shape.rectangle", &json!({"x": 80, "y": 10, "width": 30, "height": 20})).unwrap();
|
||||
app.session.execute("text.create", &json!({"x": 10, "y": 80, "text": "Hi"})).unwrap();
|
||||
app.session.execute("select.none", &json!({})).unwrap();
|
||||
let text = objects_panel(&mut app, false);
|
||||
assert!(text.contains("Paths\n2\n") && text.contains("Text Objects\n1\n"), "{text}");
|
||||
assert!(!text.contains("(No artwork selected)"), "{text}");
|
||||
}
|
||||
|
||||
/// Selection Only counts the selected object and what it holds, and an empty selection says so.
|
||||
#[test]
|
||||
fn test_doc_info_selection_only_toggles_and_filters_counts() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({"width": 200, "height": 200})).unwrap();
|
||||
let path = app.session.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 40, "height": 20})).unwrap()["id"].clone();
|
||||
let text_id = app.session.execute("text.create", &json!({"x": 10, "y": 80, "text": "Hi"})).unwrap()["id"].clone();
|
||||
app.session.execute("select.set", &json!({"ids": [text_id]})).unwrap();
|
||||
let text = objects_panel(&mut app, true);
|
||||
assert!(text.contains("Text Objects\n1\n") && !text.contains("Paths\n"), "the selected type only: {text}");
|
||||
app.session.execute("select.set", &json!({"ids": [path]})).unwrap();
|
||||
let path_only = objects_panel(&mut app, true);
|
||||
assert!(path_only.contains("Paths\n1\n") && !path_only.contains("Text Objects\n"), "the selected path only: {path_only}");
|
||||
app.session.execute("select.none", &json!({})).unwrap();
|
||||
let empty = objects_panel(&mut app, true);
|
||||
assert!(empty.contains("(No artwork selected)") && !empty.contains("Paths\n") && !empty.contains("Text Objects\n"), "{empty}");
|
||||
}
|
||||
|
||||
/// With Selection Only on, an artboard the Artboard tool has selected still shows under
|
||||
/// Document when no artwork is selected, and the empty-state message speaks of artwork only.
|
||||
#[test]
|
||||
fn test_doc_info_selection_only_keeps_selected_artboard() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({"width": 100, "height": 100})).unwrap();
|
||||
app.session.execute("artboard.new", &json!({"x": 150, "y": 40, "width": 60, "height": 80})).unwrap();
|
||||
app.session.execute("artboard.setProps", &json!({"index": 1, "name": "Back"})).unwrap();
|
||||
app.session.execute("select.none", &json!({})).unwrap();
|
||||
app.select_tool("artboard");
|
||||
app.session.set_tool_option("selected", &json!([1]));
|
||||
app.ui.doc_info.selection_only = true;
|
||||
app.ui.doc_info.category = "document".to_string();
|
||||
let text = crate::tests_labels::painted_text(&mut app, show);
|
||||
assert!(text.contains("Back"), "the selected artboard: {text}");
|
||||
assert!(!text.contains("(No selection)"), "no generic empty state: {text}");
|
||||
assert!(text.contains("(No artwork selected)"), "{text}");
|
||||
}
|
||||
|
||||
/// The panel menu's Selection Only item toggles `selection_only` and updates its checked state.
|
||||
#[test]
|
||||
fn test_doc_info_panel_menu_toggles_state() {
|
||||
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
|
||||
app.session.execute("file.new", &json!({"width": 100, "height": 100})).unwrap();
|
||||
let check = |app: &VectorcraftApp| {
|
||||
let mut states = CommandStates::default();
|
||||
menu_states(app, &mut states);
|
||||
states.get(&CommandRef::new("ui.docInfo.selectionOnly")).and_then(CommandState::is_checked)
|
||||
};
|
||||
assert_eq!(check(&app), Some(false));
|
||||
run(&mut app, "ui.docInfo.selectionOnly", &json!({})).unwrap().unwrap();
|
||||
assert_eq!(check(&app), Some(true));
|
||||
run(&mut app, "ui.docInfo.selectionOnly", &json!({})).unwrap().unwrap();
|
||||
assert_eq!(check(&app), Some(false));
|
||||
}
|
||||
}
|
||||
+5
-1
@@ -1,6 +1,6 @@
|
||||
# Gaps
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-25 · **Change:** minor (G12: History row menus adapted to shared Craft list/menu controls after rebase (#8845); scores and estimates unchanged; previously: G12: OpenType panel feature rows have an item context menu (Turn On / Turn Off, Reset OpenType Features); scores and estimates unchanged; previously: G3 lists shadows from the first light and graphics as done and drops angular cut caps, which Revolve's Cap closes, #8312; scores and estimates unchanged; previously: G12/M14: History row context menus, pending-edit snapshot targeting, keyboard access and document-switch dismissal (#8845); scores and estimates unchanged; previously: G3 lists shadows from the first light and graphics as done and drops angular cut caps, which Revolve's Cap closes, #8312; scores and estimates unchanged; previously: G12: Asset Export tile context menus; scores and estimates unchanged; previously: M14/G12: Appearance panel: right-click item context menus for rows (Duplicate, Delete, Hide/Show, Edit Effect, Clear Appearance, Reduce to Basic Appearance) with selection handling, #8809; previously: G12: Properties panel Quick Actions include contextual text actions (Create Outlines, Retype, Find and Replace…); scores and estimates unchanged; previously: G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; G4 and G13 Missing lists drop the shipped Touch Type, Snap to Glyph and Dimension tool, and G13's snapping entry keeps only what is still missing, the partial Snapping panel and the items not yet checked (#8387); G13 keeps one estimate (13–23 h); estimates unchanged; previously: Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as live text in TextAs::Text mode if ToUnicode exists on non-colour fonts (TextAs::Outlines produces grouped outlines), #6740; scores and estimates unchanged; previously: icon-strip flyouts also resize from the top edge and the canvas-side top corner, keeping tLine truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-25 · **Change:** minor (G12: History row menus adapted to shared Craft list/menu controls after rebase (#8845); scores and estimates unchanged; previously: G12: Document Info panel menu Selection Only (`ui.docInfo.selectionOnly`) counts the selection, and with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show; scores and estimates unchanged; previously: G12: OpenType panel feature rows have an item context menu (Turn On / Turn Off, Reset OpenType Features); scores and estimates unchanged; previously: G3 lists shadows from the first light and graphics as done and drops angular cut caps, which Revolve's Cap closes, #8312; scores and estimates unchanged; previously: G12/M14: History row context menus, pending-edit snapshot targeting, keyboard access and document-switch dismissal (#8845); scores and estimates unchanged; previously: G3 lists shadows from the first light and graphics as done and drops angular cut caps, which Revolve's Cap closes, #8312; scores and estimates unchanged; previously: G12: Asset Export tile context menus; scores and estimates unchanged; previously: M14/G12: Appearance panel: right-click item context menus for rows (Duplicate, Delete, Hide/Show, Edit Effect, Clear Appearance, Reduce to Basic Appearance) with selection handling, #8809; previously: G12: Properties panel Quick Actions include contextual text actions (Create Outlines, Retype, Find and Replace…); scores and estimates unchanged; previously: G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Direct Selection: Space during an ordinary path's handle drag repositions its anchor and handles, including a Pen loan (#7237, request 3 only; scores and estimates unchanged); previously: SVG export preserves document units on root width/height for physical units, #864; G11 estimate 8–15 → 6–13 h; G4 and G13 Missing lists drop the shipped Touch Type, Snap to Glyph and Dimension tool, and G13's snapping entry keeps only what is still missing, the partial Snapping panel and the items not yet checked (#8387); G13 keeps one estimate (13–23 h); estimates unchanged; previously: Retype phase 1 (#4934): Type › Retype (`type.retype`) turns outlined text that exactly matches an available font back into point text; scores and estimates unchanged; previously: Production Preflight: output-aware fonts, text overflow, linked files and effective image resolution, clickable findings and automatic rechecking; scores and estimates unchanged; previously: PDF export writes the document language as the catalog's `/Lang`, #3644; Recolor Artwork follow-up (#8031, remaining #4028): native Lab input, picker swatch libraries and Assign-row menus; UI interaction regression coverage; scores and estimates unchanged; previously: Eraser review: hidden Rasterize and Along/Across stroke rows do not block preserving visible gradients; scores and estimates unchanged; previously: Eraser review: ordinary Group/Layer paints and reproducible evaluated gradient placements are preserved; other placements retain existing fitting; scores and estimates unchanged; previously: Eraser: shared fill-only area cutting for fixed and varied tips and the Alt-drag marquee, #6582; scores and estimates unchanged; previously: G4 type: modal Check Spelling dialog (Edit › Spelling › Check Spelling…), #4936; spell check complete; previously: Type: the Middle Eastern & South Asian composers are done as a per-paragraph choice with the Standard composers (#4935); G5: built-in Neon & Glow graphic style library (Cyan Neon, Magenta Laser, Amber Tube, Electric Lime, Pulse Violet, Cobalt Phosphor); estimate unchanged (3–13 h); previously: Tech Circuit brush library, G5; previously: G5: built-in Weather Icons symbol library (Sun, Moon, Cloud, Rain, Thunder, Snow); estimate 5–15 → 4–14 h; previously: 3D: the seams of white-light Extrude & Bevel, Inflate and Rotate, and the face seams of the 3D (Classic) effects, have round joins instead of miters; previously: PDF import: preserve Type 3 font text runs as named groups <g>, or as lLine truncated
|
||||
|
||||
> Scissors snapping update (2026-11-11): with Alt released, hover and cuts use the Pen's path, alignment, intersection and anchor snaps (#6470). Scores and estimates unchanged.
|
||||
|
||||
@@ -67,6 +67,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12: Document Info › Selection Only (`ui.docInfo.selectionOnly`) counts objects in the selection through `document.info`; with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: History panel row context menus: New Document from State uses the clicked snapshot; Step to This State runs undo/redo; Clear History clears both stacks. Current-state stepping and empty-history clearing are disabled. Headless tests in `crates/ui-egui/src/panels/history.rs`; scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12: OpenType panel feature rows have an item context menu (Turn On / Turn Off, Reset OpenType Features); a secondary click keeps the text selection, a mixed row turns the feature on, and each choice is one undo step. Headless regressions: panels::opentype::tests. Scores and estimates unchanged. |
|
||||
@@ -537,6 +538,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
|
||||
|
||||
## G12 Preferences and panels that don't act yet
|
||||
|
||||
- **Implemented and tested (2026-11-21):** Document Info's panel menu Selection Only (`ui.docInfo.selectionOnly`; kept in memory for the session, not stored) asks `document.info` for the selection: object counts cover the selected nodes and their descendants, and with no artwork selected it shows `(No artwork selected)` instead of the document's counts, while artboards the Artboard tool has selected still show under Document. With the item off, counts stay for the whole document. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard` and `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged.
|
||||
|
||||
- **Implemented (2026-11-20):** History panel row context menus (2026-11-20, G12): Right-clicking any state offers New Document from State, Step to This State, and Clear History. Creating a document uses the clicked snapshot without stepping the source document; Step to This State uses undo/redo and is disabled on the current row; Clear History removes undo and redo steps without changing artwork and is disabled when history is empty. Headless tests in `crates/ui-egui/src/panels/history.rs` cover opening an earlier row menu, snapshot creation, backward/forward jumps, and clearing history. The snapshot chosen when the menu opens is retained while it stays open; pending tool edits are settled before resolving that snapshot to its new row; a discarded snapshot reports that it is unavailable instead of acting on a neighboring row. Jumps settle pending typing before counting undo/redo steps. Shift+F10 opens the focused row menu; Escape dismisses it and restores row focus. Switching documents dismisses the menu before it can act on another document. Headless tests cover these keyboard and document-switch paths. The list and menu use shared Craft UI controls. Scores and estimates unchanged.
|
||||
|
||||
- **Implemented and tested (2026-11-21):** OpenType panel feature rows have an item context menu. A secondary click keeps the text selection and offers Turn Off when the feature is on for every character the panel acts on, or Turn On when it is off or mixed. Turn On and Turn Off use the same toggle as a click on the checkbox, so a mixed row turns the feature on for every character. Reset OpenType Features applies the same default as the panel menu and is enabled on the same condition. Each choice is one undo step; a checkbox click stays a toggle. The Stylistic Sets button and the East Asian menu items are unchanged. Headless regression coverage: `panels::opentype::tests::right_clicking_an_opentype_row_offers_turn_on_or_turn_off`, `panels::opentype::tests::clicking_turn_on_sets_that_feature_in_one_undo_step`, and `panels::opentype::tests::clicking_reset_opentype_features_clears_the_rows` in `crates/ui-egui/src/panels/opentype.rs`. Scores and estimates unchanged.
|
||||
@@ -1008,6 +1011,7 @@ trap, and the defaults (0.25 pt, 100%, 40%) are VectorCraft's own, the pages giv
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12: Document Info › Selection Only (`ui.docInfo.selectionOnly`) counts objects in the selection through `document.info`; with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12: OpenType panel feature rows have an item context menu (Turn On / Turn Off, Reset OpenType Features); a secondary click keeps the text selection, a mixed row turns the feature on, and each choice is one undo step. Headless regressions: panels::opentype::tests. Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G3: shadows from the first light and graphics on 3D surfaces moved from Missing to Done, as three-d.md documents them, and angular cut caps dropped from Missing, as Revolve's Cap closes a partial sweep's cut sides ([revolve.md](revolve.md)) (#8312); estimate unchanged |
|
||||
|
||||
+12
@@ -11839,6 +11839,18 @@ PDF/X-4 always embeds one), a TrimBox on every page (the artboard), `/Trapped` T
|
||||
document has none) and dates; type is outlined or embedded; editing data, passwords and, in PDF/X-1a and PDF/X-3, PDF
|
||||
layers are refused.
|
||||
|
||||
The built-in CMYK working spaces `VectorCraft Coated CMYK (FOGRA51)` and `VectorCraft Uncoated CMYK (FOGRA52)` are
|
||||
VectorCraft's own press models, computed when first used from the FOGRA51 and FOGRA52 characterization data that Fogra
|
||||
publishes (<https://fogra.org/en/downloads/work-tools/characterisation-data>); the data files ship unmodified in
|
||||
`crates/color/data/`. An output intent with one of them, and with `output.outputConditionId` blank, has the
|
||||
`/OutputConditionIdentifier` `FOGRA51` or `FOGRA52` and, unless `output.registry` names another, the `/RegistryName`
|
||||
`http://www.color.org` (<https://registry.color.org/cmyk-registry/>), with the profile embedded. Their total ink limit
|
||||
(300%) and black generation are VectorCraft's own values.
|
||||
|
||||
```json
|
||||
{"name":"run_command","arguments":{"command":"document.exportPdf","params":{"path":"/tmp/press.pdf","preset":"PDF/X-4:2010","output":{"outputIntent":"VectorCraft Coated CMYK (FOGRA51)"}}}}
|
||||
```
|
||||
|
||||
- **pdfX1a** (PDF/X-1a:2001, written as PDF 1.3): CMYK, grey and spot colours only. Every colour and image is converted
|
||||
to `output.destination` (blank: the output intent's CMYK profile, else the working CMYK profile), untagged; an RGB
|
||||
destination or output intent is refused. Transparency is flattened before writing.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Parity with Adobe Illustrator
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-25 · **Change:** minor (G12: History row context menus use shared Craft controls, snapshot targeting, keyboard access and document-switch dismissal (#8845); scores and estimates unchanged; previously: Essentials readiness row: Shape Builder item names its remaining depth, #937's fix unconfirmed on the reporter's file, #8314; scores and estimates unchanged; previously: Pencil Edit Selected Paths follows lifted strokes, carves, loops, closes and redraws compound paths; Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: G12: Asset Export tile context menus; scores and estimates unchanged; previously: M14/G12: Appearance panel: right-click item context menus for rows (Duplicate, Delete, Hide/Show, Edit Effect, Clear Appearance, Reduce to Basic Appearance) with selection handling, #8809; previously: Text styles panel: right-click item context menus for Character Styles and Paragraph Styles with Options, Duplicate, Delete, Redefine, Clear Overrides; scores and estimates unchanged; previously: G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged; previously: Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and estimates unchanged; previously: Windows/Linux menu access keys and localized cues (#6596); previously: Backquote/~ arrow pattern nudges (#7717); scores and estimates unchanged; previously: Window > Toolbars > Compact TLine truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-25 · **Change:** minor (Essentials readiness row: Shape Builder item names its remaining depth, #937's fix unconfirmed on the reporter's file, #8314; scores and estimates unchanged; previously: G12: History row context menus use shared Craft controls, snapshot targeting, keyboard access and document-switch dismissal (#8845); scores and estimates unchanged; previously: G12: Document Info Selection Only counts the selection, and with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show; scores and estimates unchanged; previously: Pencil Edit Selected Paths follows lifted strokes, carves, loops, closes and redraws compound paths; Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: G12: Asset Export tile context menus; scores and estimates unchanged; previously: M14/G12: Appearance panel: right-click item context menus for rows (Duplicate, Delete, Hide/Show, Edit Effect, Clear Appearance, Reduce to Basic Appearance) with selection handling, #8809; previously: Text styles panel: right-click item context menus for Character Styles and Paragraph Styles with Options, Duplicate, Delete, Redefine, Clear Overrides; scores and estimates unchanged; previously: G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged; previously: Layers: a targeted item with an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the target circle's four looks differ, #8711; scores and estimates unchanged; previously: Trim View hides the ruler guides, guide paths and the grid while it is on and greys out Show/Hide Guides and Show/Hide Grid, #8363; scores and estimates unchanged; previously: Scissors shows the actual proposed cut point while hovering, using its existing snapping and cut target (#8655); scores and estimates unchanged; previously: G12: Brushes panel: item right-click context menu (Brush Options, Duplicate Brush, Delete Brush) with selection handling; scores and estimates unchanged; previously: Graphic Styles panel: right-click item context menu for tiles and rows with Options, Duplicate, Delete, Redefine, Break Link; scores and estimates unchanged; previously: In the web build, an edit while the view of a heavy document moves (a tool drag held at an edge of the canvas, #8551, or a wheel scroll during a drag) draws only the part it changed into the last frame, which stays drawn moved with the view, instead of rendering the whole canvas each frame, and edits that go on once the view is still don't put off its render (#8688); scores and estimates unchanged; previously: G12: Links panel row context menu (Relink…, Go To Link, Update Link, Edit Original, Show in Folder, Embed Image / Unembed…) with selection handling; scores and estimates unchanged; previously: Artboard tool: Shift held once a move or Alt-copy drag is under way keeps it to the level, upright or 45° line, #8580; scores and estimates unchanged; previously: Image Trace Ignore Color keeps the canvas View and stays armed on a missed pixel (#8068); a tool drag held near an edge of the canvas scrolls the view, #8551; scores and estimates unchanged; previously: G12: Place: show progress window with Cancel for slow placed files exceeding 0.4 s, part of #5930; scores and estimates unchanged; previously: All Tools drawer: a tool the toolbar holds is dimmed in the readable dim text colour, not the disabled colour that was unreadable against the panel, and a hovered dimmed row takes the panel's darker fill so it stays readable, #8294; scores and estimates unchanged; previously: Layers: selected guide rows stay highlighted after the pointer leaves (#7344); scores and estimates unchanged; previously: PDF import: type filled and stroked after a page of type filled only comes in filled and stroked, #8549 follow-up; scores and estimates unchanged; previously: selected Dimension extension-line color and weight in Properties (#7078; four focused UI regressions passed); scores and estimates unchanged; previously: Brush Options Key Color: restore canvas input for the existing one-shot pick, then resume the retained draft and previous tool (#8284; six full-app input regressions passed); scores and estimates unchanged; previously: #8200: `.ai` and EPS import: an Art brush in Tints of a swatch-linked stroke color comes in brushed, its tints linked to the swatch; scores and estimates unchanged; previously: Ellipse: Up/Down changes Anchors while drawing (#7840); scores and esLine truncated
|
||||
>
|
||||
> Tech Circuit update (2026-11-14): three original procedural brushes; ten built-in brush libraries (G5).
|
||||
>
|
||||
@@ -91,6 +91,7 @@ Artboard Options forwards the active Artboard tool's Scale Artwork with Artboard
|
||||
| 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: History panel row context menus: New Document from State uses the clicked snapshot; Step to This State runs undo/redo; Clear History clears both stacks. Current-state stepping and empty-history clearing are disabled. Headless tests in `crates/ui-egui/src/panels/history.rs`; scores and estimates unchanged. |
|
||||
| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers: checking #937's fix on the reporter's file, still unconfirmed (the reproduced case is fixed), #8314. Scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12: Document Info Selection Only (`ui.docInfo.selectionOnly`) counts the selection through `document.info`; with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Variables panel row context menus implemented with row highlighting, bound-object selection, options, unbinding, selection-based dynamic actions and single-step deletion; headless regression coverage. Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Actions panel item context menus for action sets (New Action…, New Set…, Duplicate Set, Delete Set, Set Options…) and actions (Play, Record, Duplicate, Delete, Action Options…, Batch…) with selection handling; clicking Duplicate on an action duplicates that action; headless tests in `crates/ui-egui/src/panels/actions.rs`; scores and estimates unchanged. |
|
||||
@@ -336,7 +337,7 @@ dominate; 3D, graphs and automation are specialist). They sum to 105. Feature de
|
||||
| Export for Screens, Asset Export, slices, Save for Web | 3 | 85% | anti-aliasing ghost borders (#983); TIFF choices and settings are implemented | 2–4 | estimated |
|
||||
| Print, colour management, separations, flattener | 3 | 80% | Production Preflight available; print preview fidelity remains | 2–4 | estimated |
|
||||
| Automation (Actions, Variables, scripting, batch) | 3 | 60% | a scripting surface (Illustrator: JavaScript/ExtendScript), Batch, image and graph variables, dataset import/export | 8–14 | estimated; MCP `add_text` exposes existing vertical type; score and hours unchanged |
|
||||
| UI chrome (panels, Properties, workspaces, preferences) | 6 | 80% | Asset Export item context menus implemented (G12); Properties per context, 2 Preferences options stored but unused (#394, audited 2026-10-30: Scratch Disks, legacy vector clipboard), context menus in the remaining panels that have none (History rows implemented, #8845), accessibility | 13–20 | estimated; floating panels in OS windows of their own on the desktop (#4135), score and hours unchanged; macOS save Format menu implemented (#866), score and hours unchanged; Eyedropper cursor and precise setting checked (#1269), OS visual QA unverified; the line under the Preferences fields describes each General, Selection & Anchor Display, Guides & Grid, Smart Guides, Slices, Hyphenation, Plug-ins & Scratch Disks, User Interface, Performance, File Handling, Clipboard Handling, Appearance of Black and Devices setting on hover and keyboard focus (#8199, #8223, #8248, #8264, #8360, #8376, #8402, #8429, #8453, #8475, #8483, #8498), score and hours unchanged; numeric-field focus and normal text drags regression-tested (#1326); a focus click released more than 1 pt from its press keeps the caret and a tap within 1 pt selects all (#6659); artboard navigation synchronizes the tool selection before destructive actions; status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates (sample widths cached by language/unit/DPI; regression and contributor original-file evidence below; scores/hours unchanged); effect dialogs' colour fields show a swatch that opens the Color Picker (#5365), score and hours unchanged; icon-strip flyouts retain user sizes (#5713); floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), scores and hours unchanged ; interim macOS cursor delivery (#2292), headless coverage only; native validation pending, score and hours unchanged; Swatches item context menus have focused regressions and rendered-layout evidence below; Character Styles and Paragraph Styles item context menus have focused regressions (panels::text_styles::tests::right_click_context_menu_*); scores and estimates unchanged; History row context menus have snapshot, pending-edit, typing and clear-history headless regressions (panels::history::tests, #8845); swatches dropped on New Swatch or Delete Swatch carry the selected swatches the find field or kind filter hides (#8620); scores and estimates unchanged |
|
||||
| UI chrome (panels, Properties, workspaces, preferences) | 6 | 80% | Document Info Selection Only (`ui.docInfo.selectionOnly`) counts the selection through `document.info`, and with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show (`panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`); Asset Export item context menus implemented (G12); Properties per context, 2 Preferences options stored but unused (#394, audited 2026-10-30: Scratch Disks, legacy vector clipboard), context menus in the remaining panels that have none (History rows implemented, #8845), accessibility | 13–20 | estimated; floating panels in OS windows of their own on the desktop (#4135), score and hours unchanged; macOS save Format menu implemented (#866), score and hours unchanged; Eyedropper cursor and precise setting checked (#1269), OS visual QA unverified; the line under the Preferences fields describes each General, Selection & Anchor Display, Guides & Grid, Smart Guides, Slices, Hyphenation, Plug-ins & Scratch Disks, User Interface, Performance, File Handling, Clipboard Handling, Appearance of Black and Devices setting on hover and keyboard focus (#8199, #8223, #8248, #8264, #8360, #8376, #8402, #8429, #8453, #8475, #8483, #8498), score and hours unchanged; numeric-field focus and normal text drags regression-tested (#1326); a focus click released more than 1 pt from its press keeps the caret and a tap within 1 pt selects all (#6659); artboard navigation synchronizes the tool selection before destructive actions; status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates (sample widths cached by language/unit/DPI; regression and contributor original-file evidence below; scores/hours unchanged); effect dialogs' colour fields show a swatch that opens the Color Picker (#5365), score and hours unchanged; icon-strip flyouts retain user sizes (#5713); floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), scores and hours unchanged ; interim macOS cursor delivery (#2292), headless coverage only; native validation pending, score and hours unchanged; Swatches item context menus have focused regressions and rendered-layout evidence below; Character Styles and Paragraph Styles item context menus have focused regressions (panels::text_styles::tests::right_click_context_menu_*); scores and estimates unchanged; History row context menus have snapshot, pending-edit, typing and clear-history headless regressions (panels::history::tests, #8845); swatches dropped on New Swatch or Delete Swatch carry the selected swatches the find field or kind filter hides (#8620); scores and estimates unchanged |
|
||||
| Libraries, Links, Package | 2 | 82% | shared libraries, linked graphics, gradients and patterns as library items (no cloud by design) | 2–3 | estimated; #5804: private native-picked raster editor (scores unchanged) |
|
||||
| Generative AI (Text to Vector, Generative Recolor, Shape Fill, Concept to Vector, Prompt to Edit, Rewrite Text) | 2 | 0% | a pluggable provider and the panels; needs an owner decision on models | 30–60 | measured (absent) |
|
||||
| **Feature depth** | **105** | **~75%** | | **~250–420** | |
|
||||
@@ -2110,6 +2111,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Eyedropper colors in a CMYK document (#2276):** a CMYK image (a four-component JPEG, or an 8- or 16-bit chunky CMYK TIFF) gives its ink amounts as they are, and an RGB image's pixel or an RGB color given to `paint.setFill`, `paint.setStroke`, `paint.sampleColor` or `swatch.new {color}` (hex input and gradient stops included) is separated through the color settings' CMYK working space and intent, as Document Color Mode converts it. With the default Generic CMYK, RGB 83/170/223 separates to C62 M19 Y0 K0, where the profile-free formula gave C63 M24 Y0 K13.
|
||||
- **RGB input to other commands in a CMYK document:** type colors (`text.create`, `text.setStyle`, `text.setRangeStyle`), a Shape Builder hex fill, `paint.editGradient` stops, freeform gradient points, gradient mesh points (the Mesh tool gives a new point the fill's color in its own model), the Symbol Stainer's color and the swatch commands (`swatch.new {colors}`, `swatch.newGroup`, `swatch.editGroup`, `swatch.edit`) separate RGB through the color settings as `paint.setFill` does: with Generic CMYK, `text.setStyle {fill: "#53aadf"}` gives C62 M19 Y0 K0. A color a swatch already has keeps its model, and a swatch color given with `mode` is converted into that mode only.
|
||||
- **Generic CMYK (SWOP-like):** each ink's 40% and 50% tints gain as [CGATS TR 001](https://registry.color.org/cmyk-registry/cgats_tr_001) gives for SWOP printing, and separations stay within SWOP's [300% total ink limit](https://en.wikipedia.org/wiki/Specifications_for_Web_Offset_Publications). The paper, solid and overprint colors, the black-generation curve and the black point are VectorCraft's own values: RGB black separates to 90% black under neutral cyan, magenta and yellow that fill the ink limit (C75 M68 Y67 K90). The ICC profile written for it (embedded in exports) gives the paper as its media white point, and its colorimetric Lab → CMYK table is the inverse of its CMYK → Lab table, without black-point compensation; the perceptual and saturation tables keep compensation.
|
||||
- **Coated CMYK (FOGRA51) and Uncoated CMYK (FOGRA52):** VectorCraft's own press models, computed when first used from the characterization data Fogra publishes (<https://fogra.org/en/downloads/work-tools/characterisation-data>), which ships unmodified: the measured paper, solids and overprints, a tone curve fitted to each ink's ramp, and a smoothed Lab correction lattice fitted to all 1,617 patches. The models reproduce the patches within a mean ΔE2000 of 0.04 (largest 0.37), and patches left out of the fit within 0.15 to 0.17 (largest 1.67). A PDF/X output intent made with one embeds the profile; with the condition identifier left blank it names `FOGRA51` or `FOGRA52`, in the `http://www.color.org` registry unless the settings give a registry, and an identifier the settings give is written as given. The 300% ink limit and black generation are VectorCraft's own values.
|
||||
- **Swatches made from a shown color in a CMYK document:** the Color panel menu's Create New Swatch, an Alt-click on the Swatches panel's New Swatch button, the New Swatch dialog for a gradient, a Fill or Stroke proxy or the Gradient panel's thumbnail dropped on the Swatches panel (or Alt-dropped on a swatch of its kind), and the Gradient panel's Add to Swatches and Save to Swatches keep each color's model, as the Color Guide's and Color Themes' saved colors do: an RGB object's color gives an RGB swatch, and a gradient's RGB stops stay RGB.
|
||||
- **Color Themes Set Active Color:** a button on the Color Themes panel's Create tab makes the selected theme color the current color, the action the [help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=222) describes for creating a color theme. VectorCraft's own rules: the color goes to the proxy in front (Fill or Stroke), on the selection and the default for new art, in its own color model, through `paint.setFill` or `paint.setStroke`; with characters selected with the Type tool, only those characters take it and the default for new art stays as it was, as with a swatch click; a click is one undo step, a click that changes no art adds none, and the button is off without a document. Tests: `set_active_color_*` in `crates/ui-egui/src/panels/color_themes.rs`.
|
||||
- **Color Themes find field:** on the Color Themes panel's My Themes tab, Show Find Field in the panel menu shows a Find field that lists only the saved themes whose names hold its text; the [help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=255) describes looking up a saved theme by its name this way (printed page 249). VectorCraft's own rules: the menu item is checked while the field shows and is off in a new session; a name matches when it holds the text anywhere, in any letter case, with spaces at either end of the text ignored; colors are not searched; the list keeps its saved order and shows No matches. when nothing matches; a picked theme the field hides stays picked, but Edit Theme, Add to Swatches and Delete Theme are off until the list shows it again; turning the field off lists every theme, and turning it on again in the same session restores its text. The field does not change the saved themes or `colorTheme.list`. Tests: `show_find_field_toggles_the_find_field_on_my_themes`, `the_find_field_lists_themes_whose_names_hold_its_text`, `no_saved_themes_is_not_no_matches`, `a_theme_the_find_field_hides_is_not_acted_on` and `footer_buttons_are_off_for_a_hidden_pick` in `crates/ui-egui/src/panels/color_themes.rs`.
|
||||
@@ -2161,6 +2163,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
Document Info's Spot Color Objects category lists the objects that use spot colors, the category the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes as objects using spot color separations. Each object is listed by name with the spot colors it uses. With Selection Only it lists those in the selection, and the Document Info report and Package's report list them too (`document.info {category: "spotColors"}`, `spotObjects`). Taking a solid color or a gradient stop linked to a spot swatch at a tint above 0 and a grayscale image colorized with one, leaving out process colors that look the same, Registration, gradients whose stops are all at an opacity of 0, gradient stops at an opacity of 0 that mix only with other stops at an opacity of 0 or only over stretches with no width, fills and strokes at an opacity of 0, paint that draws nothing by the rules Pattern Objects follows, spot swatches no art uses and spot colors inside patterns, symbols, opacity masks, effects and placed files, are VectorCraft's own rules. A stop at an opacity of 0 next to a stop above it stays listed, since the stretch between them is drawn in its color. Objects counts the listed objects as Spot Color Objects. Tests: `cmd::docinfo::tests::info_lists_the_spot_color_objects`, `spot_color_objects_take_colorized_images_and_skip_clear_gradients`, `spot_color_objects_skip_clear_fills_and_strokes`, `spot_color_objects_skip_spot_stops_only_in_clear_stretches` and `drawn_stops_follow_the_sampled_stretches` (vectorcraft-engine).
|
||||
Document Info's Brushes, Spot Color Objects, Pattern Objects and Gradient Objects categories leave out hidden objects, objects at an opacity of 0 and the objects inside a hidden group or layer or one at an opacity of 0, their characters' paints and colorized images included. With Selection Only an object selected inside such a group or layer is left out too, and Objects still counts every object as before. This is VectorCraft's own rule. Test: `cmd::docinfo::tests::info_skips_paints_on_hidden_and_clear_objects_and_their_members` (vectorcraft-engine).
|
||||
Document Info's Save… writes the category the panel shows, with Selection Only applied, as the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes ("Exports the selected category's visible information to a text file"). With All Categories shown it writes every category, which is VectorCraft's own rule (`docInfo.save {category}`). Test: `panels::doc_info::tests::save_writes_the_category_the_panel_shows`.
|
||||
Document Info's panel menu Selection Only (`ui.docInfo.selectionOnly`) is kept in memory for the session, not stored. With it on, `document.info` counts the selected objects and their descendants; with it off, the counts stay for the whole document. With no artwork selected it shows `(No artwork selected)` instead of those counts; artboards the Artboard tool has selected still show under Document. Tests: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard` and `test_doc_info_panel_menu_toggles_state` (vectorcraft-ui-egui).
|
||||
Document Info's Document category lists the document's transparency settings, as the [Document Info panel](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/document-info-panel.html) page describes: File › Document Setup's grid size, grid colors, Simulate Colored Paper and flattener preset (`document.info`'s `document.transparency`). While the Artboard tool is the current tool, it also lists the width, height and position of each artboard that tool has selected, as the same page describes for the selected artboard (`document.selectedArtboards`). Listing every selected artboard, measuring the position at the top-left corner from the ruler origin of the tool's active artboard, and naming two custom grid colors by their values are VectorCraft's own rules. The panel shows the values in the interface language, and the report keeps them in English. Tests: `cmd::docinfo::tests::info_lists_the_transparency_settings` and `info_lists_the_artboards_the_artboard_tool_selected` (vectorcraft-engine), `panels::doc_info::tests::document_shows_transparency_and_the_artboard_tools_selection` (vectorcraft-ui-egui).
|
||||
Document Info's category menu and headings show every category title in the interface language, Font Details, Linked Images and Embedded Images included, and the Objects category shows every count label in it too: Compound Paths, Text Objects, Placed Documents, Symbol Instances, Gradient Meshes, Blends, Envelopes, Intertwine Groups, Opacity Masks and Objects with Effects. The Document category's Pattern Swatches row and the Objects category's Path Length row are translated in every catalog that has every menu label. `document.info` and the saved report keep the English labels. Showing these labels in the interface language is VectorCraft's own rule. Test: `i18n::tests::document_info_labels_are_in_complete_catalogs` (vectorcraft-ui-egui).
|
||||
Document Info shows the values it makes in the interface language too: the Units, the Raster Effects resolution, each font's file, substitution and embedding permission (or that it is built in or missing), each image's size and linked file, each Repeat object's kind with its instances, rows and columns in the language's plural forms, and gradients named by their kind. Font, face, file, swatch and other names stay as they are, a gradient swatch named like a kind included, and `document.info`, Save… and Package's report keep the English values (`document.unitId`, `fontDetails`, `imageObjects`, `gradientObjects` `kinds`). Showing these values in the interface language is VectorCraft's own rule. Tests: `panels::doc_info::tests::values_follow_interface_language_and_keep_names`, `repeat_value_uses_locale_plural_forms_and_drawn_count`, `i18n::tests::document_info_values_are_in_complete_catalogs` (vectorcraft-ui-egui), `cmd::docinfo::tests::info_exposes_structured_font_details_without_changing_english_rows`, `info_exposes_ordered_images_and_unit_id` and `gradient_kinds_tell_kinds_from_swatch_names` (vectorcraft-engine).
|
||||
@@ -3277,6 +3280,7 @@ Edit › Copy and Cut put the selected ruler guides on the clipboard, with the s
|
||||
| 2026-11-24 | minor | G12: History row context menus use shared Craft List and Menu controls after rebasing onto the panel migration. App-specific actions retain the chosen snapshot across pending edits and dismiss on document switches; keyboard context requests and focus restoration use the shared runtime. Regression cases retained (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12/M14: History row context menus retain the chosen snapshot while the menu is open and pending edits settle; jumps settle typing before counting undo/redo, and discarded states report that they are unavailable. Shift+F10 opens the focused row menu, Escape restores row focus, and switching documents dismisses the popup. History checklist, area and milestone evidence updated (#8845); scores and estimates unchanged. |
|
||||
| 2026-11-22 | minor | Essentials readiness row: the Shape Builder item names what its 4–8 h still covers: checking #937's fix on the reporter's file, still unconfirmed (the reproduced case is fixed), #8314. Scores and estimates unchanged. |
|
||||
| 2026-11-21 | minor | G12: Document Info Selection Only (`ui.docInfo.selectionOnly`) counts the selection through `document.info`; with no artwork selected it shows (No artwork selected) and artboards the Artboard tool has selected still show. Headless regressions: `panels::doc_info::tests::test_doc_info_counts_entire_document`, `test_doc_info_selection_only_toggles_and_filters_counts`, `test_doc_info_selection_only_keeps_selected_artboard`, `test_doc_info_panel_menu_toggles_state`. Scores and estimates unchanged. |
|
||||
| 2026-11-20 | minor | G12: Asset Export tiles have item context menus for Export, Remove, Rename, Select Artwork on Canvas and collecting selected artwork; right-click selects an unselected tile and preserves an existing multi-selection. Headless regressions: panels::tests_asset_export. Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | Layers: a target circle whose item is targeted and has an appearance of its own keeps its inner ring visible around a smaller appearance dot, so the four looks (not targeted, targeted, with an appearance, both) differ (#8711). Scores and estimates unchanged. |
|
||||
| 2026-11-19 | minor | Guides, grids, smart guides, snapping, rulers: View › Trim View hides the ruler guides, guide paths and the grid while it is on and greys out their Show/Hide items; a ruler drag or double-click makes no guide meanwhile (#8363). Scores and estimates unchanged. |
|
||||
|
||||
Reference in new issue
Block a user