Merge remote-tracking branch 'origin/main' into HEAD

# Conflicts:
#	docs/target-app-parity.md
This commit is contained in:
Taha-Mahmoodi
2026-11-17 15:00:20 +04:30
55 changed files with 2328 additions and 91 deletions
+1
View File
@@ -649,6 +649,7 @@ pub const UNCHECKED: &[&str] = &[
"transparency.setOpacityMask",
"transparency.unlinkOpacityMask",
"type.pathOptions",
"webExport.optimizeToFileSize",
"webExport.presets.save",
"webExport.settings",
];
+2 -2
View File
@@ -23,7 +23,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Print Setup",
[],
None,
"{preset?: name ([Default] or a saved print preset, any case: print.presets.list; its settings replace the document's, as choosing it in the Print dialog does), settings?: {copies: 1 (1–999), collate: true, reverse, artboards: all|range|ignore (all the art as one page), range: \"1-3, 5\" (1-based, with artboards: range), skipBlank (leave out artboards with no art that prints), media: letter|legal|tabloid|a3|a4|a5|a6|b4|b5|b4 (jis)|b5 (jis)|b6 (jis)|japanese postcard|japanese double postcard|japanese envelope #3|japanese envelope #4|kaku #2|kaku #3|yonroku-ban|custom (a paper is named by its id or its dialog label, any case and spacing, so `B5 (JIS)` works; b4 and b5 stay the ISO 216 sizes, 250 × 353 and 176 × 250 mm, and the JIS sizes are b4 (jis) 257 × 364 mm, b5 (jis) 182 × 257 mm and b6 (jis) 128 × 182 mm), width, height (custom paper, 72–14400 pt), orientation: portrait|landscape|portraitFlipped|landscapeFlipped, autoRotate: true (turn the paper to each artboard; orientation ignored), transverse (the page a quarter turn on the paper), printLayers: visiblePrintable|visible|all (template layers never print), placement: {origin: topLeft|top|topRight|left|center|right|bottomLeft|bottom|bottomRight (the point of the printed area, the artboard with its bleed and marks, on the same point of the imageable area), x, y (pt, right and down)}, scaling: none|fit|custom|tileFull|tileImageable, scale: {width: 100, height: 100 (1–1000 % with custom and tiling), linked: true (width and height stay equal: give one and the other follows, and turning it on sets the height to the width; a different width and height without linked turn it off, and with linked: true, or linked: null over a linked scale, are an error; a saved scale without linked reads it as false)}, overlap: 0 (pt between tiles), tileRange: \"\" (1-based tiles across then down; empty: all), copiesPerSheet: false (not with tiling: as many copies of each artboard, with its bleed and marks, as fit the imageable area, across then down, not turned; the placement places the grid; an artboard that doesn't fit prints one copy per sheet, with a warning), gutter: 0 (pt between copies, 0–720), margin: 0 (pt the device can't print around the paper: the imageable area is inside it), marks: {trim, registration, colorBars, pageInfo, kind: roman|japanese, weight: 0.25, offset: 6} (as document.exportPdf, at the paper's scale; page information adds the tile and the ink), bleed: {useDocument: true (the document's bleed, document.setup), top, bottom, left, right} (pt), output: {mode: composite|separations (one gray page per ink that prints), emulsion: up|down (down mirrors), image: positive|negative, spotsToProcess, overprintBlack: false (separations: solid 100% K or 100% gray fills, strokes and characters, to within half a percent, overprint in the printed copy, gradients when every stop is (every point of a freeform one); rich, RGB, spot-linked and lighter blacks are not marked, and paints already set to overprint keep it; composite ignores it), inks: [{name: \"Cyan\"|…|a spot swatch, print: true, frequency (lpi, default 60), angle (screen angle, degrees counter-clockwise as PostScript setscreen takes it; default C 15, M 75, Y 0, K 45, spots 45)}]}, graphics: {autoFlatness: true, flatness: 1 (0.2–100), fonts: none|subset|complete}, color: {intent: perceptual|relativeColorimetric|saturation|absoluteColorimetric, preserveNumbers: true (CMYK colors keep their values), profile: \"\" (the printer profile, an RGB or CMYK one: composite PDF colors are converted to it with the intent, separations separate with a CMYK one; empty: as they are)}, advanced: {printAsBitmap (composite pages print as one image each, at the document's raster effects resolution, or lower for a page larger than 64 Mpx or 32,768 px a side), overprints: preserve|discard|simulate (composite output; preserve writes them to overprint (/OP), simulate prints them as Overprint Preview shows them; separations always keep them), flattenerPreset: \"\" (a flattener preset, built-in or saved: transparency is flattened before printing; empty: it prints live; PostScript defaults to medium)}, tileOrigin: {placed: false, x, y} (where the Print Tiling tool put the pages: print.tiling.set)}} store the print settings with the document, over the ones it has or the preset's (null keeps a value), as one undo step; no settings or preset → {settings} (the current ones, defaults if never set up)",
"{preset?: name ([Default] or a saved print preset, any case: print.presets.list; its settings replace the document's, as choosing it in the Print dialog does), settings?: {copies: 1 (1–999), collate: true, reverse, artboards: all|range|ignore (all the art as one page), range: \"1-3, 5\" (1-based, with artboards: range), skipBlank (leave out artboards with no art that prints), media: letter|legal|tabloid|a3|a4|a5|a6|b4|b5|b4 (jis)|b5 (jis)|b6 (jis)|japanese postcard|japanese double postcard|japanese envelope #3|japanese envelope #4|kaku #2|kaku #3|yonroku-ban|custom (a paper is named by its id or its dialog label, any case and spacing, so `B5 (JIS)` works; b4 and b5 stay the ISO 216 sizes, 250 × 353 and 176 × 250 mm, and the JIS sizes are b4 (jis) 257 × 364 mm, b5 (jis) 182 × 257 mm and b6 (jis) 128 × 182 mm), width, height (custom paper, 72–14400 pt), orientation: portrait|landscape|portraitFlipped|landscapeFlipped, autoRotate: true (turn the paper to each artboard; orientation ignored), transverse (the page a quarter turn on the paper), printLayers: visiblePrintable|visible|all (template layers never print), placement: {origin: topLeft|top|topRight|left|center|right|bottomLeft|bottom|bottomRight (the point of the printed area, the artboard with its bleed and marks, on the same point of the imageable area), x, y (pt, right and down)}, scaling: none|fit|custom|tileFull|tileImageable, scale: {width: 100, height: 100 (1–1000 % with custom and tiling), linked: true (width and height stay equal: give one and the other follows, and turning it on sets the height to the width; a different width and height without linked turn it off, and with linked: true, or linked: null over a linked scale, are an error; a saved scale without linked reads it as false)}, overlap: 0 (pt between tiles), tileRange: \"\" (1-based tiles across then down; empty: all), copiesPerSheet: false (not with tiling: as many copies of each artboard, with its bleed and marks, as fit the imageable area, across then down, not turned; the placement places the grid; an artboard that doesn't fit prints one copy per sheet, with a warning), gutter: 0 (pt between copies, 0–720), margin: 0 (pt the device can't print around the paper: the imageable area is inside it), marks: {trim, registration, colorBars, pageInfo, kind: roman|japanese, weight: 0.25, offset: 6} (as document.exportPdf, at the paper's scale; page information adds the tile and the ink), bleed: {useDocument: true (the document's bleed, document.setup), top, bottom, left, right} (pt), output: {mode: composite|separations (one gray page per ink that prints), emulsion: up|down (down mirrors), image: positive|negative, spotsToProcess, overprintBlack: false (separations: solid 100% K or 100% gray fills, strokes and characters, to within half a percent, overprint in the printed copy, gradients when every stop is (every point of a freeform one); rich, RGB, spot-linked and lighter blacks are not marked, and paints already set to overprint keep it; composite ignores it), inks: [{name: \"Cyan\"|…|a spot swatch, print: true, frequency (lpi, default 60), angle (screen angle, degrees counter-clockwise as PostScript setscreen takes it; default C 15, M 75, Y 0, K 45, spots 45), convertToProcess: false (a spot ink only: it prints on the process plates, with no plate of its own, and its print, frequency and angle are kept for when it prints as a spot ink again; spotsToProcess converts every spot ink whatever it says)}]}, graphics: {autoFlatness: true, flatness: 1 (0.2–100), fonts: none|subset|complete}, color: {intent: perceptual|relativeColorimetric|saturation|absoluteColorimetric, preserveNumbers: true (CMYK colors keep their values), profile: \"\" (the printer profile, an RGB or CMYK one: composite PDF colors are converted to it with the intent, separations separate with a CMYK one; empty: as they are)}, advanced: {printAsBitmap (composite pages print as one image each, at the document's raster effects resolution, or lower for a page larger than 64 Mpx or 32,768 px a side), overprints: preserve|discard|simulate (composite output; preserve writes them to overprint (/OP), simulate prints them as Overprint Preview shows them; separations always keep them), flattenerPreset: \"\" (a flattener preset, built-in or saved: transparency is flattened before printing; empty: it prints live; PostScript defaults to medium)}, tileOrigin: {placed: false, x, y} (where the Print Tiling tool put the pages: print.tiling.set)}} store the print settings with the document, over the ones it has or the preset's (null keeps a value), as one undo step; no settings or preset → {settings} (the current ones, defaults if never set up)",
has_doc,
setup
),
@@ -32,7 +32,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Print Preview",
[],
None,
"{preset?: name (as print.setup's: its settings instead of the document's), settings?: {…settings of print.setup} (over the document's or the preset's)} → {pages (copies included), sheets: [{artboard (0-based; null with artboards ignored), tile? (1-based), ink? (separations), width, height (pt, the page), orientation, scale: [width %, height %], transform: [a, b, c, d, e, f] (document space → the page, pt, y down), area: [x0, y0, x1, y1] (the document region the page prints), trim: [x0, y0, x1, y1] (the artboard on the page; with copies per sheet, the box around every copy's), copies?: [[x0, y0, x1, y1]…] (copies per sheet: each copy's artboard on the page, across then down)}] (one copy, in order), tiles: [{artboard, columns, rows, printed: [1-based tiles], tiles: [[x0, y0, x1, y1]…] (document space)}], inks: [{name, spot, print, frequency, angle}] (separations), warnings (art larger than the imageable area, type that prints in the fallback font, type that doesn't fit its frame, options not applied yet…), settings} without printing",
"{preset?: name (as print.setup's: its settings instead of the document's), settings?: {…settings of print.setup} (over the document's or the preset's)} → {pages (copies included), sheets: [{artboard (0-based; null with artboards ignored), tile? (1-based), ink? (separations), width, height (pt, the page), orientation, scale: [width %, height %], transform: [a, b, c, d, e, f] (document space → the page, pt, y down), area: [x0, y0, x1, y1] (the document region the page prints), trim: [x0, y0, x1, y1] (the artboard on the page; with copies per sheet, the box around every copy's), copies?: [[x0, y0, x1, y1]…] (copies per sheet: each copy's artboard on the page, across then down)}] (one copy, in order), tiles: [{artboard, columns, rows, printed: [1-based tiles], tiles: [[x0, y0, x1, y1]…] (document space)}], inks: [{name, spot, print, frequency, angle}] (separations: the plates), documentInks: [{name, spot, print, frequency, angle, convertToProcess?: true (a spot ink printing as process, with no plate)}] (separations: every ink of the document), warnings (art larger than the imageable area, type that prints in the fallback font, type that doesn't fit its frame, options not applied yet…), settings} without printing",
has_doc,
preview
),
+300
View File
@@ -45,6 +45,15 @@ pub fn specs() -> Vec<CommandSpec> {
has_doc,
preview
),
cmd!(
query "webExport.optimizeToFileSize",
"Optimize to File Size",
[],
None,
"{desiredK: the desired file size in K (1024 bytes; above 0, at most 1048576), startWith?: current (default: the format given, its JPEG quality or GIF/PNG-8 colors lowered; GIF then takes lossy 100)|auto (GIF for art with transparency or at most 256 colors (blended over the matte without transparency), else JPEG; the other one when the first can't reach the size and the art is opaque), use?: allSlices (default: the image, or the image slices' files together)|eachSlice (every image slice's file)|currentSlice (the `slice` given, else the selected image slice, else the first), slice?: n (1-based, from slice.list), preset?, …the settings of document.exportForWeb} the settings whose files fit in the size, searched by encoding at most 32 trial settings (each one encodes every image it measures); slices share one setting, which every scope changes → {targetBytes, achieved (false: no setting tried fits, and settings are the smallest one found), bytes (as use measures them), format, settings, trials, images, warnings}; writes nothing and changes no remembered setting",
has_doc,
optimize_to_file_size
),
cmd!(
query "webExport.settings",
"Save for Web Settings",
@@ -1054,6 +1063,297 @@ fn preview(s: &mut Session, p: &Value) -> Result<Value> {
Ok(out)
}
// ---------- Optimize to File Size ----------
/// The most trial settings `webExport.optimizeToFileSize` encodes. Each trial encodes every image
/// it measures once.
pub const OPTIMIZE_TRIALS: usize = 32;
/// The largest desired file size, in K (1 GiB).
pub const MAX_DESIRED_K: f64 = 1_048_576.0;
/// Where Optimize to File Size starts.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum StartWith {
/// The current format, with its JPEG quality or palette colors lowered.
Current,
/// GIF or JPEG, by the image's content.
Auto,
}
/// The pixels `px` (`[x0, y0, x1, y1]`) of `r` as an image: borrowed when `px` is the whole render,
/// else a copy.
fn file_pixels(r: &WebRender, px: [u32; 4]) -> std::borrow::Cow<'_, [u8]> {
if px == [0, 0, r.width, r.height] { std::borrow::Cow::Borrowed(r.rgba.as_slice()) } else { std::borrow::Cow::Owned(crop(r, px)) }
}
/// The settings Optimize to File Size found.
#[derive(Clone, Debug)]
pub struct SizeFit {
pub settings: WebSettings,
/// The size the settings give the measured images.
pub bytes: usize,
/// Whether `bytes` is within the target.
pub achieved: bool,
/// The trial settings encoded.
pub trials: usize,
}
/// The files a search measures and the trials it has left.
struct Trials<'a> {
doc: &'a Document,
r: &'a WebRender,
/// The pixels (`[x0, y0, x1, y1]`) of each file in `r`.
files: &'a [[u32; 4]],
/// Measure the largest file (else the files together).
each: bool,
left: usize,
used: usize,
}
impl Trials<'_> {
/// The size `s` gives the files, encoded one at a time; `None` when no trial is left.
fn size(&mut self, s: &WebSettings) -> std::result::Result<Option<usize>, String> {
if self.left == 0 {
return Ok(None);
}
self.left -= 1;
self.used += 1;
let mut out = 0usize;
for &px in self.files {
let n = optimize(self.doc, &file_pixels(self.r, px), px[2] - px[0], px[3] - px[1], s)?.bytes.len();
out = if self.each { out.max(n) } else { out.saturating_add(n) };
}
Ok(Some(out))
}
}
/// `(settings, bytes)` of a trial.
pub type Trial = (WebSettings, usize);
/// Keep `(s, n)` in `smallest` when it is the smallest trial so far.
fn keep_smallest(smallest: &mut Option<Trial>, s: WebSettings, n: usize) {
if smallest.as_ref().is_none_or(|(_, b)| n < *b) {
*smallest = Some((s, n));
}
}
/// The values [`highest_within`] measures spread over its range before it narrows a step.
pub const OPTIMIZE_SAMPLES: u16 = 6;
/// Measures the size a setting gives; `None` when no trial is left.
pub type MeasureSize<'a> = dyn FnMut(&WebSettings) -> std::result::Result<Option<usize>, String> + 'a;
/// The highest value in `lo..hi` that `set` gives `start` whose size is within `target`, when the
/// value `hi` is over it. A lower value can give a larger file, so the search measures up to
/// [`OPTIMIZE_SAMPLES`] values spread over the range, from `hi - 1` down, stops at the first that
/// fits, and halves the step between it and the measured value above it, keeping the highest value
/// measured within `target`. `None` when no value measured fits or no trial is left; the trials over
/// the target go to `smallest`.
pub fn highest_within(
size: &mut MeasureSize,
start: &WebSettings,
(lo, hi): (u16, u16),
set: fn(&mut WebSettings, u16),
target: usize,
smallest: &mut Option<Trial>,
) -> std::result::Result<Option<Trial>, String> {
let with = |v: u16| {
let mut s = start.clone();
set(&mut s, v);
s
};
if lo >= hi {
return Ok(None);
}
let span = u32::from(hi - lo);
let samples = u32::from(OPTIMIZE_SAMPLES).min(span);
let (mut above, mut found) = (hi, None);
for i in (0..samples).rev() {
let step = if samples == 1 { 0 } else { (span - 1) * i / (samples - 1) };
let v = lo.saturating_add(u16::try_from(step).unwrap_or(0));
let s = with(v);
let Some(n) = size(&s)? else { return Ok(None) };
if n <= target {
found = Some((v, (s, n)));
break;
}
keep_smallest(smallest, s, n);
above = v;
}
let Some((mut lo, mut best)) = found else { return Ok(None) };
let mut hi = above;
while hi - lo > 1 {
let mid = lo + (hi - lo) / 2;
let s = with(mid);
let Some(n) = size(&s)? else { break };
if n <= target {
lo = mid;
best = (s, n);
} else {
keep_smallest(smallest, s, n);
hi = mid;
}
}
Ok(Some(best))
}
/// Sets the JPEG quality, for [`highest_within`].
pub fn set_quality(s: &mut WebSettings, v: u16) {
s.quality = u8::try_from(v).unwrap_or(100);
}
/// Sets the palette colors, for [`highest_within`].
pub fn set_colors(s: &mut WebSettings, v: u16) {
s.colors = v;
}
/// The best settings of `start`'s format within `target`: `start` when it fits, else the highest
/// JPEG quality or the most palette colors [`highest_within`] finds that fit, and for GIF, when none
/// is found, lossy 100 with the most colors that fit. When nothing tried fits, the smallest trial, not achieved.
/// `None` when no trial is left.
fn search_format(t: &mut Trials, start: &WebSettings, target: usize) -> std::result::Result<Option<SizeFit>, String> {
let fit = |(settings, bytes): Trial, achieved: bool| SizeFit { settings, bytes, achieved, trials: 0 };
let Some(n) = t.size(start)? else { return Ok(None) };
if n <= target {
return Ok(Some(fit((start.clone(), n), true)));
}
let mut smallest = Some((start.clone(), n));
let found = match start.format {
WebFormat::Jpg => highest_within(&mut |s: &WebSettings| t.size(s), start, (1, u16::from(start.quality)), set_quality, target, &mut smallest)?,
WebFormat::Gif | WebFormat::Png8 => {
match highest_within(&mut |s: &WebSettings| t.size(s), start, (2, start.colors), set_colors, target, &mut smallest)? {
None if start.format == WebFormat::Gif && start.lossy < 100 => {
let lossy = WebSettings { lossy: 100, ..start.clone() };
match t.size(&lossy)? {
Some(n) if n <= target => Some((lossy, n)),
Some(n) => {
keep_smallest(&mut smallest, lossy.clone(), n);
highest_within(&mut |s: &WebSettings| t.size(s), &lossy, (2, lossy.colors), set_colors, target, &mut smallest)?
}
None => None,
}
}
found => found,
}
}
WebFormat::Png24 => None,
};
Ok(match (found, smallest) {
(Some(f), _) => Some(fit(f, true)),
(None, Some(s)) => Some(fit(s, false)),
(None, None) => None,
})
}
/// The format Auto Select GIF/JPEG starts with, and whether the files (`[x0, y0, x1, y1]` of `r`)
/// are opaque: GIF for files with transparent pixels (when `transparency` keeps them) or at most
/// 256 colors, else JPEG. The colors counted are the ones the files are written with: without
/// `transparency`, the pixels blended over `matte`.
fn auto_format(r: &WebRender, files: &[[u32; 4]], transparency: bool, matte: [u8; 3]) -> (WebFormat, bool) {
let stride = r.width as usize * 4;
let row =
move |y: u32, x0: u32, x1: u32| r.rgba.get(y as usize * stride + x0 as usize * 4..y as usize * stride + x1 as usize * 4).unwrap_or_default();
let pixels = || files.iter().flat_map(move |&[x0, y0, x1, y1]| (y0..y1).flat_map(move |y| row(y, x0, x1).as_chunks::<4>().0.iter()));
let opaque = !transparency || pixels().all(|p| p[3] == 255);
if !opaque {
return (WebFormat::Gif, false);
}
let mut seen = HashSet::new();
// An opaque pixel blends to itself.
let few = pixels().all(|p| {
seen.insert(flatten(p, matte).next().unwrap_or_default());
seen.len() <= 256
});
(if few { WebFormat::Gif } else { WebFormat::Jpg }, true)
}
/// Optimize to File Size: the settings, from `s`, whose files (the pixels `[x0, y0, x1, y1]` of
/// `r`) fit in `target` bytes, measured together, or with `each` the largest one. At most
/// [`OPTIMIZE_TRIALS`] trial settings are encoded, and a trial encodes the files one at a time.
pub fn optimize_to_size(
doc: &Document,
r: &WebRender,
files: &[[u32; 4]],
s: &WebSettings,
start: StartWith,
each: bool,
target: usize,
) -> std::result::Result<SizeFit, String> {
let mut t = Trials { doc, r, files, each, left: OPTIMIZE_TRIALS, used: 0 };
let with = |format: WebFormat| WebSettings { format, ..s.clone() };
let found = match start {
_ if files.is_empty() => None,
StartWith::Current => search_format(&mut t, s, target)?,
StartWith::Auto => {
let (first, opaque) = auto_format(r, files, s.transparency, s.matte_rgb()?.unwrap_or([255; 3]));
let other = if first == WebFormat::Gif { WebFormat::Jpg } else { WebFormat::Gif };
match search_format(&mut t, &with(first), target)? {
Some(a) if !a.achieved && opaque => match search_format(&mut t, &with(other), target)? {
Some(b) if b.achieved || b.bytes < a.bytes => Some(b),
_ => Some(a),
},
a => a,
}
}
};
let mut best = found.ok_or("Optimize to File Size: there is no image to measure")?;
best.trials = t.used;
Ok(best)
}
fn optimize_to_file_size(s: &mut Session, p: &Value) -> Result<Value> {
const O: &str = "webExport.optimizeToFileSize";
let k = p
.get("desiredK")
.and_then(Value::as_f64)
.filter(|k| k.is_finite() && *k > 0.0 && *k <= MAX_DESIRED_K)
.ok_or_else(|| bad(O, "give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576"))?;
let target = ((k * 1024.0).floor() as usize).max(1);
let start = match p.get("startWith").map(Value::as_str) {
None | Some(Some("current")) => StartWith::Current,
Some(Some("auto")) => StartWith::Auto,
Some(_) => return Err(bad(O, "`startWith` is `current` or `auto`")),
};
let scope = match p.get("use").map(Value::as_str) {
None if p.get("slice").is_some() => "currentSlice",
None => "allSlices",
Some(Some(u @ ("allSlices" | "eachSlice" | "currentSlice"))) => u,
Some(_) => return Err(bad(O, "`use` is `allSlices`, `eachSlice` or `currentSlice`")),
};
let slice = match p.get("slice").map(|v| v.as_u64().filter(|n| *n >= 1 && scope == "currentSlice")) {
None => None,
Some(Some(n)) => Some(n),
Some(None) => return Err(bad(O, "`slice` is a slice number from `slice.list`, with `use: currentSlice`")),
};
let settings = s.web_settings(p).map_err(|e| bad(O, e))?;
let st = s.doc()?;
let doc = &st.doc;
let failed = vectorcraft_render::decode_failures();
let r = render(doc, &settings).map_err(|e| bad(O, e))?;
let warnings = undecoded(failed);
let areas = doc.slice_layout();
let selected = super::slices::selected_slices(doc, &st.selection);
let cells = cells(&areas, &selected, &settings, &r).map_err(|e| bad(O, e))?;
let image_cells: Vec<&Cell> =
cells.iter().filter(|c| c.area.id.and_then(|id| doc.slice_options(id)).is_none_or(|o| o.kind == SliceKind::Image)).collect();
let picked: Vec<&Cell> = match (scope, slice) {
("currentSlice", Some(n)) => {
let c = image_cells.iter().find(|c| c.area.number as u64 == n);
vec![*c.ok_or_else(|| bad(O, format!("no slice {n} in the image (see slice.list)")))?]
}
("currentSlice", None) => {
image_cells.iter().find(|c| c.area.id.is_some_and(|id| selected.contains(&id))).or(image_cells.first()).copied().into_iter().collect()
}
_ => image_cells,
};
let files: Vec<[u32; 4]> = if cells.is_empty() { vec![[0, 0, r.width, r.height]] } else { picked.iter().map(|c| c.px).collect() };
let fit = optimize_to_size(doc, &r, &files, &settings, start, scope == "eachSlice", target).map_err(|e| bad(O, e))?;
Ok(json!({
"targetBytes": target, "achieved": fit.achieved, "bytes": fit.bytes, "format": fit.settings.format.id(),
"settings": fit.settings.to_json(), "trials": fit.trials, "images": files.len(), "warnings": warnings,
}))
}
fn settings(s: &mut Session, p: &Value) -> Result<Value> {
const S: &str = "webExport.settings";
let base = if bool_or(p, "reset", false) { WebSettings::default() } else { s.last_web_settings() };
+18
View File
@@ -391,3 +391,21 @@ fn for_a_printer_a_landscape_page_is_written_upright() {
assert_eq!(size(&spooled), [(612.0, 792.0)]);
assert_eq!(v["pages"], 1);
}
#[test]
fn a_spot_ink_converted_to_process_is_saved_and_listed_without_a_plate() {
let (mut s, _) = session();
s.execute("swatch.new", &json!({"name": "Gold", "color": {"model": "cmyk", "c": 0, "m": 0.2, "y": 0.8, "k": 0.1}, "spot": true})).unwrap();
let ink = json!({"name": "Gold", "convertToProcess": true});
let v = s.execute("print.setup", &json!({"settings": {"output": {"mode": "separations", "inks": [ink]}}})).unwrap();
assert_eq!(v["settings"]["output"]["inks"], json!([{"name": "Gold", "print": true, "convertToProcess": true}]));
let doc = &s.doc().unwrap().doc;
let back = vectorcraft_format::load(&vectorcraft_format::save(doc, false)).unwrap();
assert_eq!(back.print_setup.as_ref().map(|p| p["output"]["inks"][0]["convertToProcess"].clone()), Some(json!(true)), "kept in the file");
let pv = s.execute("print.preview", &json!({})).unwrap();
let names = |list: &Value| list.as_array().unwrap().iter().map(|i| i["name"].as_str().unwrap().to_string()).collect::<Vec<_>>();
assert_eq!(names(&pv["inks"]), ["Cyan", "Magenta", "Yellow", "Black"], "no Gold plate");
assert_eq!(names(&pv["documentInks"]), ["Cyan", "Magenta", "Yellow", "Black", "Gold"]);
assert_eq!(pv["documentInks"][4]["convertToProcess"], json!(true));
assert_eq!(pv["documentInks"][0].get("convertToProcess"), None, "written only when on");
}
+212
View File
@@ -523,3 +523,215 @@ fn setting_keys_are_their_json_values() {
.unwrap();
assert_eq!(serde_json::from_value::<cmd::webexport::WebSettings>(custom.to_json()).unwrap(), custom);
}
fn optimize_to(s: &mut Session, p: Value) -> Value {
run(s, "webExport.optimizeToFileSize", p)
}
/// The size of the file the settings `p` write (the whole image, or slice `slice`).
fn written(s: &mut Session, p: &Value) -> usize {
run(s, "document.exportForWeb.preview", p.clone())["bytes"].as_u64().unwrap() as usize
}
/// 20×20: 400 one-point squares of different colors (more than a palette holds).
fn photo_like() -> Session {
let mut s = session(20.0, 20.0);
for i in 0..400 {
let (x, y) = ((i % 20) as f64, (i / 20) as f64);
rect(&mut s, [x, y, 1.0, 1.0], &format!("#{:02x}{:02x}{:02x}", (i % 20) * 12, (i / 20) * 12, (i * 7) % 256));
}
s
}
#[test]
fn optimize_to_file_size_takes_the_highest_jpeg_quality_that_fits() {
let mut s = many_colours();
let start = json!({"format": "jpg", "quality": 90});
let full = written(&mut s, &start);
let k = (full * 3 / 4) as f64 / 1024.0;
let r = optimize_to(&mut s, merge(&start, json!({"desiredK": k})));
let target = r["targetBytes"].as_u64().unwrap() as usize;
assert_eq!(target, (k * 1024.0).floor() as usize);
assert_eq!((r["achieved"].as_bool(), r["format"].as_str(), r["images"].as_u64()), (Some(true), Some("jpg"), Some(1)), "{r}");
let q = r["settings"]["quality"].as_u64().unwrap();
assert!(q < 90, "{r}");
let bytes = r["bytes"].as_u64().unwrap() as usize;
assert!(bytes <= target, "{r}");
// The size is the size of the file Save writes with the settings.
assert_eq!(written(&mut s, &r["settings"]), bytes);
assert_eq!(one(&mut s, r["settings"].clone()).len(), bytes);
// One quality step up is over the size.
assert!(written(&mut s, &merge(&r["settings"], json!({"quality": q + 1}))) > target);
assert!(r["trials"].as_u64().unwrap() as usize <= cmd::webexport::OPTIMIZE_TRIALS);
// The other settings stay.
assert_eq!(r["settings"]["matte"], json!("white"));
assert_eq!(r["settings"]["metadata"], json!("copyright"));
}
#[test]
fn optimize_to_file_size_lowers_palette_colors() {
let mut s = many_colours();
for format in ["gif", "png8"] {
let start = json!({"format": format, "dither": "none", "colors": 128});
let full = written(&mut s, &start);
let r = optimize_to(&mut s, merge(&start, json!({"desiredK": (full * 3 / 4) as f64 / 1024.0})));
let target = r["targetBytes"].as_u64().unwrap() as usize;
assert_eq!((r["achieved"].as_bool(), r["format"].as_str()), (Some(true), Some(format)), "{r}");
let colors = r["settings"]["colors"].as_u64().unwrap();
assert!(colors < 64, "{format}: {r}");
assert_eq!((r["settings"]["lossy"].as_u64(), r["settings"]["dither"].as_str()), (Some(0), Some("none")), "{format}: {r}");
let bytes = r["bytes"].as_u64().unwrap() as usize;
assert!(bytes <= target && written(&mut s, &r["settings"]) == bytes, "{format}: {r}");
assert!(written(&mut s, &merge(&r["settings"], json!({"colors": colors + 1}))) > target, "{format}: {r}");
}
}
#[test]
fn optimize_to_file_size_auto_selects_gif_or_jpeg_by_content() {
// Flat, opaque art: GIF, from a JPEG start.
let mut flat = two_colours();
let r = optimize_to(&mut flat, json!({"format": "jpg", "desiredK": 100, "startWith": "auto"}));
assert_eq!((r["format"].as_str(), r["achieved"].as_bool()), (Some("gif"), Some(true)), "{r}");
// More colors than a palette holds: JPEG, from a GIF start.
let mut photo = photo_like();
let r = optimize_to(&mut photo, json!({"format": "gif", "desiredK": 100, "startWith": "auto"}));
assert_eq!((r["format"].as_str(), r["achieved"].as_bool()), (Some("jpg"), Some(true)), "{r}");
// Transparent pixels: GIF, which keeps them.
let mut clear = session(40.0, 30.0);
rect(&mut clear, [0.0, 0.0, 10.0, 10.0], "#000000");
for (k, transparency, format) in [(100.0, true, "gif"), (100.0, false, "gif"), (0.01, true, "gif")] {
let r = optimize_to(&mut clear, json!({"format": "jpg", "desiredK": k, "startWith": "auto", "transparency": transparency}));
assert_eq!(r["format"].as_str(), Some(format), "{k} {transparency}: {r}");
}
// The current format stays without auto.
let r = optimize_to(&mut photo, json!({"format": "png8", "desiredK": 100}));
assert_eq!(r["format"].as_str(), Some("png8"));
}
#[test]
fn optimize_to_file_size_auto_counts_the_colors_blended_over_the_matte() {
// Three colors at 100 opacities: without transparency, 300 colors once blended over the matte.
let mut s = session(20.0, 15.0);
for i in 0..300 {
let (x, y) = ((i % 20) as f64, (i / 20) as f64);
let id = rect(&mut s, [x, y, 1.0, 1.0], ["#000000", "#ff0000", "#0000ff"][i % 3]);
run(&mut s, "transparency.set", json!({"ids": [id], "opacity": i / 3 + 1}));
}
let r = optimize_to(&mut s, json!({"format": "gif", "desiredK": 100, "startWith": "auto", "transparency": false, "antiAlias": "none"}));
assert_eq!((r["format"].as_str(), r["achieved"].as_bool()), (Some("jpg"), Some(true)), "{r}");
// With transparency the pixels stay transparent: GIF.
let r = optimize_to(&mut s, json!({"format": "jpg", "desiredK": 100, "startWith": "auto", "antiAlias": "none"}));
assert_eq!(r["format"].as_str(), Some("gif"), "{r}");
}
#[test]
fn optimize_to_file_size_says_when_no_setting_fits() {
let mut s = many_colours();
for format in ["jpg", "gif", "png8"] {
let start = json!({"format": format});
let r = optimize_to(&mut s, merge(&start, json!({"desiredK": 0.01})));
assert_eq!((r["targetBytes"].as_u64(), r["achieved"].as_bool(), r["format"].as_str()), (Some(10), Some(false), Some(format)), "{r}");
let bytes = r["bytes"].as_u64().unwrap() as usize;
assert!(bytes > 10 && bytes <= written(&mut s, &start), "{format}: the smallest setting tried: {r}");
assert_eq!(written(&mut s, &r["settings"]), bytes);
assert!(r["trials"].as_u64().unwrap() as usize <= cmd::webexport::OPTIMIZE_TRIALS);
}
// GIF tries lossy when 2 colors are over.
let r = optimize_to(&mut s, json!({"format": "gif", "desiredK": 0.01}));
assert_eq!(r["settings"]["lossy"], json!(100), "{r}");
// PNG-24 has nothing to lower.
let r = optimize_to(&mut s, json!({"format": "png24", "desiredK": 0.01}));
assert_eq!((r["achieved"].as_bool(), r["trials"].as_u64()), (Some(false), Some(1)), "{r}");
assert_eq!(r["settings"], s.web_settings(&json!({"format": "png24"})).unwrap().to_json());
// Settings that fit stay as they are.
let p = json!({"format": "jpg", "quality": 80, "desiredK": 1000});
let r = optimize_to(&mut s, p.clone());
assert_eq!((r["achieved"].as_bool(), r["trials"].as_u64()), (Some(true), Some(1)), "{r}");
assert_eq!(r["settings"], s.web_settings(&p).unwrap().to_json());
}
#[test]
fn optimize_to_file_size_refuses_bad_params_and_changes_nothing() {
let mut s = many_colours();
run(&mut s, "webExport.settings", json!({"format": "jpg", "quality": 77}));
let remembered = s.last_web_settings();
for p in [
json!({}),
json!({"desiredK": 0}),
json!({"desiredK": -5}),
json!({"desiredK": "10"}),
json!({"desiredK": null}),
json!({"desiredK": 2_000_000}),
json!({"desiredK": 10, "startWith": "gif"}),
json!({"desiredK": 10, "startWith": 1}),
json!({"desiredK": 10, "use": "all"}),
json!({"desiredK": 10, "slice": 0}),
json!({"desiredK": 10, "slice": "1"}),
json!({"desiredK": 10, "slice": 1, "use": "eachSlice"}),
json!({"desiredK": 10, "slice": 99}),
json!({"desiredK": 10, "percent": 0}),
] {
assert!(s.execute("webExport.optimizeToFileSize", &p).is_err(), "{p}");
}
optimize_to(&mut s, json!({"desiredK": 0.5, "format": "jpg"}));
assert_eq!(s.last_web_settings(), remembered, "the search changes no remembered setting");
}
#[test]
fn optimize_to_file_size_measures_the_slices_as_use_says() {
let mut s = session(300.0, 200.0);
rect(&mut s, [0.0, 0.0, 300.0, 200.0], "#336699");
for i in 0..40 {
rect(&mut s, [f64::from(i) * 7.0, f64::from(i) * 4.0, 30.0, 20.0], &format!("#{:02x}{:02x}40", i * 6, 255 - i * 6));
}
let a = rect(&mut s, [20.0, 20.0, 100.0, 60.0], "#ff8800");
run(&mut s, "object.slice.make", json!({"ids": [a]}));
let layout = run(&mut s, "slice.list", json!({}))["slices"].as_array().unwrap().clone();
let start = json!({"format": "jpg", "quality": 95});
let sizes = |s: &mut Session, p: &Value| files(&run(s, "document.exportForWeb", p.clone())).iter().map(|(_, b)| b.len()).collect::<Vec<_>>();
let all = sizes(&mut s, &start);
assert_eq!(all.len(), layout.len());
let total: usize = all.iter().sum();
let r = optimize_to(&mut s, merge(&start, json!({"desiredK": (total * 3 / 4) as f64 / 1024.0})));
assert_eq!((r["achieved"].as_bool(), r["images"].as_u64()), (Some(true), Some(layout.len() as u64)), "{r}");
let after = sizes(&mut s, &r["settings"]);
assert_eq!(after.iter().sum::<usize>(), r["bytes"].as_u64().unwrap() as usize, "the slice files together");
let largest = *all.iter().max().unwrap();
let r = optimize_to(&mut s, merge(&start, json!({"desiredK": (largest * 3 / 4) as f64 / 1024.0, "use": "eachSlice"})));
let after = sizes(&mut s, &r["settings"]);
assert_eq!(*after.iter().max().unwrap(), r["bytes"].as_u64().unwrap() as usize, "the largest slice file");
assert!(r["achieved"].as_bool().unwrap() && after.iter().all(|n| *n <= r["targetBytes"].as_u64().unwrap() as usize), "{r}");
let n = layout[0]["number"].as_u64().unwrap();
let one_slice = written(&mut s, &merge(&start, json!({"slice": n})));
let r = optimize_to(&mut s, merge(&start, json!({"desiredK": (one_slice / 2) as f64 / 1024.0, "slice": n})));
assert_eq!(r["images"].as_u64(), Some(1));
assert_eq!(written(&mut s, &merge(&r["settings"], json!({"slice": n}))), r["bytes"].as_u64().unwrap() as usize, "{r}");
}
#[test]
fn optimize_to_file_size_finds_a_fit_when_a_lower_setting_gives_a_larger_file() {
use cmd::webexport::{OPTIMIZE_SAMPLES, WebSettings, highest_within, set_quality};
// Sizes that do not fall with the quality: 1 to 20 give 900 bytes, 21 to 70 give 400 to 449,
// and 71 and up give over 1000.
let size_of = |q: u8| match q {
..=20 => 900,
21..=70 => 400 + usize::from(q - 21),
_ => 1000 + usize::from(q),
};
let start = WebSettings { quality: 90, ..WebSettings::default() };
let mut measured = Vec::new();
let mut smallest = None;
let mut size = |s: &WebSettings| {
measured.push(s.quality);
Ok(Some(size_of(s.quality)))
};
let found = highest_within(&mut size, &start, (1, 90), set_quality, 500, &mut smallest).unwrap();
let (settings, bytes) = found.expect("a quality within 500 bytes");
assert_eq!((settings.quality, bytes), (70, 449), "measured {measured:?}");
assert!(measured.len() <= usize::from(OPTIMIZE_SAMPLES) + 7, "measured {measured:?}");
// Nothing fits: the smallest size measured is kept.
let mut smallest = None;
let mut size = |s: &WebSettings| Ok(Some(size_of(s.quality)));
assert!(highest_within(&mut size, &start, (1, 90), set_quality, 100, &mut smallest).unwrap().is_none());
assert_eq!(smallest.map(|(s, n)| (s.quality, n)), Some((36, 415)));
}
+7 -3
View File
@@ -991,7 +991,7 @@ impl<'p> Builder<'p> {
self.flush_type3();
if let (Some(s), Some(line)) = (&look.stroke, &mut self.text)
&& look.fill.is_none()
&& line.stroke_last(font_key, at, s.clone(), overprint)
&& line.stroke_filled(font_key, at, opacity, &text, s.clone(), overprint)
{
return true;
}
@@ -1153,9 +1153,13 @@ impl<'p> Builder<'p> {
// A stroke over the glyph just filled (fill and stroke rendering).
if let (Some(s), Some(line)) = (&look.stroke, &mut self.text)
&& look.fill.is_none()
&& line.stroke_last(key, at, s.clone(), overprint)
&& line.stroke_filled(key, at, opacity, &text, s.clone(), overprint)
{
self.keep_glyph(o, m, drawn, opacity, scale, overprint);
// Upright glyphs aren't kept as outlines (nor, below, are those filled only): a
// vertical line that came in as its outlines would lose the ones filled only.
if top.is_none() {
self.keep_glyph(o, m, drawn, opacity, scale, overprint);
}
return true;
}
if !self.text.as_mut().is_some_and(place) {
+215 -6
View File
@@ -61,6 +61,17 @@ impl Placement {
fn up(&self) -> Vec2 {
Vec2::new(self.dir.y, -self.dir.x)
}
/// Is a glyph placed with `other` drawn where this one is, the same size, width, slant and
/// direction (a stroke the reader draws over a glyph it filled has the very same placement;
/// the tolerances only allow for rounding)?
fn same_as(&self, other: &Placement) -> bool {
(self.origin - other.origin).hypot() < self.size * 1e-3
&& (self.size - other.size).abs() <= self.size * 1e-3
&& (self.h_scale - other.h_scale).abs() < 0.05
&& (self.slant - other.slant).abs() < 1e-3
&& self.dir.dot(other.dir) > 1.0 - 1e-6
}
}
/// A glyph set vertically (WMode 1: no horizontal advance) and the top centre of its em box: a
@@ -219,6 +230,17 @@ pub(crate) struct TextLine {
authored: Vec<bool>,
/// Fill callbacks in an authored span, for the reader's later stroke pass.
actual_fills: HashMap<(u128, u64, u64), Option<usize>>,
/// The glyphs filled without a stroke, in drawing order, for a stroke drawn over them later
/// ([`stroke_filled`](Self::stroke_filled)).
filled: Vec<Filled>,
/// The first of [`filled`](Self::filled) a stroke may still be drawn over: a stroke matches
/// glyphs in the order they were filled, and each at most once.
stroked: usize,
/// Glyphs stroked so far that are still to be restyled: a stroke pass over a word restyles it
/// once, as a whole ([`flush_stroke`](Self::flush_stroke)).
pending: Option<PendingStroke>,
/// The last glyph's placement.
last_at: Placement,
/// The first glyph was set vertically ([`Upright`]).
upright: Option<Upright>,
/// The glyphs make a column (vertical type), each below the last.
@@ -251,6 +273,28 @@ struct Slot {
advance: Option<f64>,
}
/// A glyph filled without a stroke: its font and placement, and where its text is in the line's
/// runs (the run's index, the text's byte offset in it and its length).
#[derive(Clone, Copy, Debug)]
struct Filled {
font: u128,
at: Placement,
run: usize,
start: usize,
len: usize,
}
/// Glyphs next to each other in one run that a stroke is drawn over, not yet restyled
/// ([`TextLine::stroke_filled`]): the run's index, the text's byte range in it, and the stroke.
#[derive(Clone, Debug)]
struct PendingStroke {
run: usize,
start: usize,
end: usize,
stroke: TypeStroke,
overprint: bool,
}
/// What a finished line of type tells beyond its text object (see [`crate::import_lines`]).
#[derive(Clone, Debug, Default)]
pub(crate) struct LineFacts {
@@ -283,6 +327,10 @@ impl TextLine {
slots: vec![],
authored: vec![],
actual_fills: HashMap::new(),
filled: vec![],
stroked: 0,
pending: None,
last_at: at,
upright: None,
column: false,
ink: vec![],
@@ -313,12 +361,15 @@ impl TextLine {
}
pub fn push_upright_content(&mut self, look: &Look, at: Placement, opacity: f32, upright: Upright, content: TextContent<'_>) -> bool {
self.flush_stroke();
let text = content.text();
if !text.is_empty() && self.authored.is_empty() && self.upright.is_some() {
// Suppressed vertical glyphs likewise provide no text anchor.
self.at = at;
self.opacity = opacity;
self.runs.clear();
self.filled.clear();
self.stroked = 0;
self.column = false;
}
let down = -self.at.up();
@@ -327,8 +378,9 @@ impl TextLine {
self.runs.push((look.clone(), 0.0, text.to_string()));
self.last_start = 0;
self.record_actual_fill(look, at, content);
self.record_filled(look, at, content);
self.authored.extend(text.chars().map(|_| content.authored()));
(self.upright, self.next, self.last) = (Some(upright), at.origin + down * at.size, at.origin);
(self.upright, self.next, self.last, self.last_at) = (Some(upright), at.origin + down * at.size, at.origin, at);
return true;
};
let across = (at.origin - self.at.origin).dot(self.at.dir);
@@ -364,9 +416,11 @@ impl TextLine {
self.last_start = 0;
}
self.record_actual_fill(look, at, content);
self.record_filled(look, at, content);
self.authored.extend(text.chars().map(|_| content.authored()));
self.next = at.origin + down * at.size;
self.last = at.origin;
self.last_at = at;
true
}
@@ -377,6 +431,7 @@ impl TextLine {
}
pub fn push_content(&mut self, look: &Look, at: Placement, opacity: f32, advance: f64, content: TextContent<'_>) -> bool {
self.flush_stroke();
let text = content.text();
let pen = matches!(content, TextContent::Pen);
// A vertical line (even a single upright glyph) takes no horizontal glyphs.
@@ -394,6 +449,8 @@ impl TextLine {
self.last_size = at.size;
self.baseline.clear();
self.runs.clear();
self.filled.clear();
self.stroked = 0;
}
let bytes = self.text_bytes;
let glyph = self.baseline.len();
@@ -461,6 +518,7 @@ impl TextLine {
self.last_start = 0;
}
self.record_actual_fill(look, at, content);
self.record_filled(look, at, content);
self.text_bytes = self.text_bytes.saturating_add(text.len());
if !pen {
let one = text.chars().count() == 1 && !content.authored();
@@ -475,6 +533,7 @@ impl TextLine {
self.visible = self.next;
}
self.last = at.origin;
self.last_at = at;
self.last_dir = at.dir;
self.last_size = at.size;
self.baseline.push(at.origin);
@@ -488,10 +547,22 @@ impl TextLine {
}
}
/// Note glyph `content` just added to the last run, filled without a stroke, for a stroke
/// drawn over it later.
fn record_filled(&mut self, look: &Look, at: Placement, content: TextContent<'_>) {
let len = content.text().len();
if content.authored() || len == 0 || look.fill.is_none() || look.stroke.is_some() {
return;
}
let run = self.runs.len().saturating_sub(1);
self.filled.push(Filled { font: look.font, at, run, start: self.last_start, len });
}
/// The reader fills a whole Tj/TJ before replaying its glyphs as strokes. A replay
/// must neither consume the replacement nor rewind the pen. Only the first glyph's
/// style belongs to the replacement; suppressed glyphs have no text to restyle.
pub fn stroke_actual(&mut self, font: u128, at: Placement, stroke: TypeStroke, overprint: bool) -> bool {
self.flush_stroke();
let key = (font, at.origin.x.to_bits(), at.origin.y.to_bits());
let Some(run) = self.actual_fills.remove(&key) else { return false };
if let Some((look, ..)) = run.and_then(|i| self.runs.get_mut(i)) {
@@ -529,19 +600,156 @@ impl TextLine {
Some(bp)
}
/// A stroke (`stroke`: paint, width, cap, join and miter limit) over the glyph just drawn at
/// `at` in `font` (fill and stroke rendering), which `overprint`s or not: that glyph is
/// stroked. `false`: it isn't that glyph.
/// A stroke (`stroke`: paint, width, cap, join and miter limit) over glyph `text` drawn at
/// `at` in `font` at `opacity`, which `overprint`s or not, after the glyph was filled (fill
/// and stroke rendering): that glyph is stroked. `false`: no glyph on the line was filled so.
///
/// The reader fills all the glyphs a text-showing operator (`Tj`, `TJ`, `'`, `"`) draws
/// before it strokes them (#8015), or fills and strokes glyph by glyph: either way each
/// stroke is matched to the next glyph filled with the same placement (where, how large, how
/// wide, slanted and turned), in the same font with the same text, in order. Only that
/// glyph's text takes the stroke; strokes over glyphs next to each other in a run gather and
/// restyle their text as one run, so a word filled whole and stroked whole stays one run. The
/// glyphs around them keep their own stroke or none (#7741).
///
/// Only opaque type takes its stroke: the file composites a translucent fill and stroke
/// apiece, darker where they overlap, while one object's opacity applies to its fill and
/// stroke together. Translucent fill and stroke stay type objects of their own, as do a fill
/// and stroke at different opacities.
pub fn stroke_filled(&mut self, font: u128, at: Placement, opacity: f32, text: &str, stroke: TypeStroke, overprint: bool) -> bool {
// A stroke at another opacity than the fill's (`CA` and `ca` differ), or over a
// translucent fill, is type of its own.
let opaque = opacity >= 0.999 && self.opacity >= 0.999;
let rest = if opaque { self.filled.get(self.stroked..) } else { None };
let found = rest.and_then(|rest| {
rest.iter().position(|g| {
g.font == font
&& g.at.same_as(&at)
&& self.runs.get(g.run).and_then(|(.., t)| t.get(g.start..g.start.saturating_add(g.len))) == Some(text)
})
});
let Some(index) = found.map(|i| self.stroked.saturating_add(i)) else {
// Stroked text of its own (stroke rendering): no later stroke goes back over the
// glyphs filled before it, so no stroke looks through them again.
self.stroked = self.filled.len();
// Nor does a translucent stroke join the glyph just filled.
return opaque && self.stroke_last(font, at, text, stroke, overprint);
};
let continues = self
.pending
.as_ref()
.zip(self.filled.get(index))
.is_some_and(|(p, g)| p.run == g.run && p.end == g.start && p.stroke == stroke && p.overprint == overprint);
if continues {
let end = self.filled.get(index).map(|g| g.start.saturating_add(g.len));
if let (Some(p), Some(end)) = (&mut self.pending, end) {
p.end = end;
}
} else {
// Restyling what was gathered can move this glyph's text to another run: look it up after.
self.flush_stroke();
if let Some(g) = self.filled.get(index) {
self.pending = Some(PendingStroke { run: g.run, start: g.start, end: g.start.saturating_add(g.len), stroke, overprint });
}
}
self.stroked = index.saturating_add(1);
true
}
/// Restyle the glyphs gathered for a stroke ([`stroke_filled`](Self::stroke_filled)): their
/// text becomes a run of its own with the stroke, unless the run is stroked so already, and the
/// text before and after it in the run keeps its stroke. A run they make up whole is stroked
/// whole; text that comes right after a run drawn alike joins it.
fn flush_stroke(&mut self) {
let Some(PendingStroke { run, start, end, stroke, overprint }) = self.pending.take() else { return };
let last = run.saturating_add(1) == self.runs.len();
let previous = run.checked_sub(1).and_then(|i| self.runs.get(i)).map(|(l, sh, t)| (l.clone(), *sh, t.len()));
let Some((look, shift, text)) = self.runs.get_mut(run) else { return };
if look.stroke.as_ref() == Some(&stroke) && look.overprint_stroke == overprint {
return;
}
if !(start < end && end <= text.len() && text.is_char_boundary(start) && text.is_char_boundary(end)) {
return;
}
if start == 0 && end == text.len() {
(look.stroke, look.overprint_stroke) = (Some(stroke), overprint);
return;
}
let tail = text.split_off(end);
let glyphs = text.split_off(start);
let head = std::mem::take(text);
let mut own = look.clone();
(own.stroke, own.overprint_stroke) = (Some(stroke), overprint);
let (old, shift) = (look.clone(), *shift);
// The stroked text joins the run before when nothing is left before it in its own run and
// that run is drawn alike.
let joins = match &previous {
Some((l, sh, _)) => head.is_empty() && *l == own && (sh - shift).abs() < 1e-3,
None => false,
};
let joined_at = previous.as_ref().map_or(0, |(.., len)| *len);
let mut pieces = vec![];
if !head.is_empty() {
pieces.push((old.clone(), shift, head.clone()));
}
// Where each part of the run's text goes: its run and how far its new run's text starts
// before it (bytes), for the head, the stroked glyphs and the tail.
let head_at = (run, 0usize);
let glyphs_at = if joins {
(run.saturating_sub(1), joined_at)
} else {
pieces.push((own, shift, glyphs.clone()));
(run.saturating_add(pieces.len()).saturating_sub(1), 0)
};
if !tail.is_empty() {
pieces.push((old, shift, tail));
}
let tail_at = run.saturating_add(pieces.len()).saturating_sub(1);
let count = pieces.len();
if joins && let Some((.., t)) = run.checked_sub(1).and_then(|i| self.runs.get_mut(i)) {
t.push_str(&glyphs);
}
self.runs.splice(run..run.saturating_add(1), pieces);
let moved = |r: usize, at: usize| -> (usize, usize) {
if r > run {
(r.saturating_add(count).saturating_sub(1), at)
} else if r < run {
(r, at)
} else if at < start {
(head_at.0, at)
} else if at < end {
(glyphs_at.0, at.saturating_sub(start).saturating_add(glyphs_at.1))
} else {
(tail_at, at.saturating_sub(end))
}
};
let from = self.stroked.min(self.filled.len());
for g in self.filled.iter_mut().skip(from) {
(g.run, g.start) = moved(g.run, g.start);
}
for i in self.actual_fills.values_mut().flatten() {
*i = moved(*i, 0).0;
}
if last {
self.last_start = moved(run, self.last_start).1;
}
}
/// A stroke over glyph `glyph` just drawn at `at` in `font`, which `overprint`s or not: that
/// glyph is stroked. `false`: it isn't that glyph (another place, font or text).
///
/// A filled glyph joins a run of the same fill whatever its stroke ([`Look::takes`]), so the
/// run can hold glyphs before it that are stroked otherwise or not at all: then the glyph's
/// text becomes a run of its own with this stroke, and the glyphs before it keep theirs
/// (#7741). The line's text is the same either way, so the characters' slots, gaps and
/// authored flags, kept along the whole line, still line up.
pub fn stroke_last(&mut self, font: u128, at: Placement, stroke: TypeStroke, overprint: bool) -> bool {
fn stroke_last(&mut self, font: u128, at: Placement, glyph: &str, stroke: TypeStroke, overprint: bool) -> bool {
self.flush_stroke();
let start = self.last_start;
let last_at = self.last_at;
// The glyph just filled, in the same font and placement, with the same text.
let Some((look, shift, text)) =
self.runs.last_mut().filter(|(l, ..)| l.font == font && (at.origin - self.last).hypot() < self.at.size * 1e-3)
self.runs.last_mut().filter(|(l, _, t)| l.font == font && last_at.same_as(&at) && t.get(start..) == Some(glyph))
else {
return false;
};
@@ -563,6 +771,7 @@ impl TextLine {
/// The point type object, its opacity and what else the line tells.
pub fn finish(mut self) -> Option<(TextObject, f32, LineFacts)> {
self.flush_stroke();
let mut facts = LineFacts { ink: std::mem::take(&mut self.ink), ..LineFacts::default() };
// Turned along a curve: type on a path through the glyphs.
let path = if self.curved() { self.baseline_path() } else { None };
+12 -4
View File
@@ -12,7 +12,8 @@
//! - Marks and bleed as PDF export draws them ([`crate::MarkSettings`], [`crate::BleedSettings`]),
//! around the artboard on the paper, at the paper's scale.
//! - Output: composite, or separations, one page per ink that prints ([`print_inks`]) in the
//! grey of its coverage (overprints honoured, spot colours as process if asked), emulsion down
//! gray of its coverage (overprints honored, every spot color or chosen ones as process if
//! asked), emulsion down
//! (mirrored), negative (inverted).
//! - Colour management: the printer profile composite colours are converted to (and
//! separations separate with), the rendering intent, and whether CMYK colours keep their
@@ -43,7 +44,7 @@ use vectorcraft_doc::overprint::{OverprintBlack, clear_overprints, darken_overpr
use vectorcraft_doc::{ColorMode, Document, Node, NodeKind};
pub use layout::{MAX_COPIES_PER_SHEET, MAX_TILES, TileGrid};
pub use plates::print_inks;
pub use plates::{document_inks, print_inks};
pub use settings::*;
pub use tiling::{TilingPage, tiling};
@@ -132,6 +133,9 @@ pub struct PrintPreview {
pub tiles: Vec<TileGrid>,
/// The inks of a separation (empty for composite output).
pub inks: Vec<PrintInk>,
/// Every ink of the document as a separation lists it, the spot inks printing as process
/// (which `inks` leaves out) included ([`document_inks`]); empty for composite output.
pub document_inks: Vec<PrintInk>,
/// What the job leaves out of the document or prints differently.
pub warnings: Vec<String>,
/// Notes on the options: one the job doesn't apply or applies another way. They aren't
@@ -148,6 +152,8 @@ struct Job<'a> {
tiles: Vec<TileGrid>,
/// The inks of a separation (every one, printed or not).
inks: Vec<PrintInk>,
/// Every ink of the document, the spot inks printing as process included.
document_inks: Vec<PrintInk>,
/// The inks that print (indices into `inks`): each a plate.
plates: Vec<usize>,
/// One copy's pages: (layout, plate).
@@ -444,8 +450,9 @@ impl<'a> Job<'a> {
let (mut warnings, mut setting_notes) = (vec![], vec![]);
let (layouts, tiles) = layout::layout(&doc, set, &mut warnings, &mut setting_notes)?;
let separations = set.output.mode == OutputMode::Separations;
let (inks, more) = if separations { print_inks(&doc, set) } else { Default::default() };
let (document_inks, more) = if separations { document_inks(&doc, set) } else { Default::default() };
setting_notes.extend(more);
let inks: Vec<PrintInk> = document_inks.iter().filter(|i| !i.convert_to_process).cloned().collect();
let plates: Vec<usize> = (0..inks.len()).filter(|i| inks[*i].print).collect();
let printed: Vec<Option<usize>> = if separations { (0..plates.len()).map(Some).collect() } else { vec![None] };
if printed.is_empty() {
@@ -474,7 +481,7 @@ impl<'a> Job<'a> {
if !postscript && !set.graphics.auto_flatness {
setting_notes.push("a fixed flatness is not written yet: the output device flattens curves".into());
}
Ok(Self { doc, layouts, tiles, inks, plates, sheets, warnings, setting_notes })
Ok(Self { doc, layouts, tiles, inks, document_inks, plates, sheets, warnings, setting_notes })
}
/// The ink of plate `plate` (`None`: composite).
@@ -526,6 +533,7 @@ pub fn preview(doc: &Document, set: &PrintSettings) -> Result<PrintPreview, PdfE
sheets,
tiles: job.tiles,
inks: job.inks,
document_inks: job.document_inks,
warnings: job.warnings,
setting_notes: job.setting_notes,
})
+65 -36
View File
@@ -2,7 +2,7 @@
//! colour (and image pixel) replaced by the grey of that ink's coverage. An image placed from a
//! DCS file prints its own plates ([`vectorcraft_doc::separated`]).
use std::collections::{BTreeMap, BTreeSet};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::sync::Arc;
use vectorcraft_color::cms::{self, Cms, Model, ProfileKind};
@@ -12,48 +12,70 @@ use vectorcraft_doc::inks::{Link, StopPlates, inks, plates, spot_color, stop_ink
use vectorcraft_doc::overprint::{darken_overprints, is_black_ink, is_white};
use vectorcraft_doc::{AppearanceItem, ColorMode, Document, ImageBlob, Node, NodeKind};
use super::{DEFAULT_FREQUENCY, PrintInk, PrintSettings};
use super::{DEFAULT_FREQUENCY, InkSettings, PrintInk, PrintSettings};
/// The inks of a separation of `doc`: the process inks, then one per spot swatch (none when
/// spots print as process), with the options of [`super::PrintOutput::inks`]; and a warning
/// naming the options that name no ink.
pub fn print_inks(doc: &Document, set: &PrintSettings) -> (Vec<PrintInk>, Vec<String>) {
let out = &set.output;
// Options by ink name, the first for a name winning: looked up, not searched for each ink.
let mut options = std::collections::HashMap::new();
for o in &out.inks {
/// The options of [`super::PrintOutput::inks`] by ink name, the first for a name winning: looked
/// up, not searched for each ink.
fn ink_options(set: &PrintSettings) -> HashMap<&str, &InkSettings> {
let mut options = HashMap::new();
for o in &set.output.inks {
options.entry(o.name.as_str()).or_insert(o);
}
options
}
/// The inks of a separation of `doc`: the process inks, then one per spot swatch (none for a spot
/// ink that prints as process, [`document_inks`]), with the options of
/// [`super::PrintOutput::inks`]; and the notes of [`document_inks`].
pub fn print_inks(doc: &Document, set: &PrintSettings) -> (Vec<PrintInk>, Vec<String>) {
let (mut list, notes) = document_inks(doc, set);
list.retain(|p| !p.convert_to_process);
(list, notes)
}
/// Every ink of `doc` as a separation lists it: the process inks, then one per spot swatch, with
/// the options of [`super::PrintOutput::inks`]. A spot ink prints as process inks
/// ([`PrintInk::convert_to_process`]) with Convert All Spot Colors to Process or its own
/// `convertToProcess`; its other options are kept for when it prints as a spot ink again. Notes:
/// one warning naming the options that name no ink, and one naming the process inks whose
/// options ask for a conversion they don't take.
pub fn document_inks(doc: &Document, set: &PrintSettings) -> (Vec<PrintInk>, Vec<String>) {
let out = &set.output;
let options = ink_options(set);
let list: Vec<PrintInk> = plates(doc)
.into_iter()
.filter(|p| !(p.spot && out.spots_to_process))
.map(|p| {
let o = options.get(p.name.as_str()).copied();
PrintInk {
print: o.is_none_or(|o| o.print),
frequency: o.and_then(|o| o.frequency).unwrap_or(DEFAULT_FREQUENCY),
angle: o.and_then(|o| o.angle).unwrap_or_else(|| PrintInk::default_angle(&p.name)),
convert_to_process: p.spot && (out.spots_to_process || o.is_some_and(|o| o.convert_to_process)),
spot: p.spot,
name: p.name,
}
})
.collect();
let few = |all: Vec<&str>| {
let more = all.len().saturating_sub(MAX_NAMED);
let shown = all.into_iter().take(MAX_NAMED).map(|n| format!("`{n}`")).collect::<Vec<_>>().join(", ");
if more > 0 { format!("{shown} and {more} more") } else { shown }
};
// One warning for all the options naming no ink, each list cut short: the options and the
// inks both come from the file.
// inks both come from the file. A spot ink printing as process is still an ink of the job.
let names: BTreeSet<&str> = list.iter().map(|p| p.name.as_str()).collect();
let unknown: Vec<&str> = out.inks.iter().map(|i| i.name.as_str()).filter(|n| !names.contains(n)).collect();
let warnings = if unknown.is_empty() {
vec![]
} else {
let few = |all: Vec<&str>| {
let more = all.len().saturating_sub(MAX_NAMED);
let shown = all.into_iter().take(MAX_NAMED).map(|n| format!("`{n}`")).collect::<Vec<_>>().join(", ");
if more > 0 { format!("{shown} and {more} more") } else { shown }
};
let mut notes = vec![];
if !unknown.is_empty() {
let inks = few(list.iter().map(|p| p.name.as_str()).collect());
vec![format!("there is no ink named {} to print (inks: {inks})", few(unknown))]
};
(list, warnings)
notes.push(format!("there is no ink named {} to print (inks: {inks})", few(unknown)));
}
let process: Vec<&str> =
list.iter().filter(|p| !p.spot && options.get(p.name.as_str()).is_some_and(|o| o.convert_to_process)).map(|p| p.name.as_str()).collect();
if !process.is_empty() {
notes.push(format!("{} print as process inks already: only spot inks convert to process", few(process)));
}
(list, notes)
}
/// The most names a warning of [`print_inks`] lists.
@@ -78,20 +100,30 @@ pub(crate) struct Separator<'a> {
pub doc: &'a Document,
cms: Arc<Cms>,
set: &'a PrintSettings,
/// The inks whose own options convert them to process ([`InkSettings::convert_to_process`]).
converted: HashSet<&'a str>,
/// The plates are written as PostScript, which has no blending modes.
postscript: bool,
}
impl<'a> Separator<'a> {
pub fn new(doc: &'a Document, set: &'a PrintSettings, postscript: bool) -> Self {
Self { doc, cms: separation_cms(doc, set), set, postscript }
let converted = ink_options(set).into_iter().filter(|(_, o)| o.convert_to_process).map(|(name, _)| name).collect();
Self { doc, cms: separation_cms(doc, set), set, converted, postscript }
}
/// Whether colors linked to swatch `name` print as process inks: every swatch but
/// Registration with Convert All Spot Colors to Process, else the inks converted one by one.
/// A link to a process swatch separates as its color either way.
fn converts(&self, name: &str) -> bool {
name != REGISTRATION && (self.set.output.spots_to_process || self.converted.contains(name))
}
/// How much of ink `plate` colour `c` (with swatch link `link`) prints, 0..1.
fn ink(&self, plate: &str, c: &Color, link: Link) -> f32 {
let color = &self.set.color;
// Spot colours as process: only Registration keeps its link.
let link = link.filter(|(name, _)| !self.set.output.spots_to_process || *name == REGISTRATION);
// Spot colors as process lose their link; Registration always keeps its.
let link = link.filter(|(name, _)| !self.converts(name));
// Without Preserve Numbers, CMYK colours are separated again from their appearance.
let lab;
let c = if !color.preserve_numbers && matches!(c, Color::Cmyk { .. }) {
@@ -104,15 +136,16 @@ impl<'a> Separator<'a> {
}
/// [`Self::ink`] of a colour that prints process plates `plates` with its spot tint
/// ([`stop_inks`]): the spot plate prints the tint and the process plates print `plates`. With
/// spots as process, each process plate prints `plates` layered with the spot tint's process
/// equivalent, as a separated image's plates layer ([`vectorcraft_doc::separated::Separated::coverage_as`]).
/// ([`stop_inks`]): the spot plate prints the tint and the process plates print `plates`. When
/// its spot ink prints as process, each process plate prints `plates` layered with the spot
/// tint's process equivalent, as a separated image's plates layer
/// ([`vectorcraft_doc::separated::Separated::coverage_as`]).
fn stop_ink(&self, plate: &str, c: &Color, link: Link, plates: StopPlates) -> f32 {
let own = stop_inks(self.doc, &self.cms, c, link, plates, self.set.color.intent);
let (Some(_), Some((name, tint))) = (plates, own.spot.as_ref()) else {
return self.ink(plate, c, link);
};
if !self.set.output.spots_to_process {
if !self.converts(name) {
return own.on_plate(plate);
}
let Some(i) = cms::PROCESS_PLATES.iter().position(|p| *p == plate) else {
@@ -218,12 +251,8 @@ impl<'a> Separator<'a> {
}
}
// A DCS file's image prints its own plates: a spot plate on its ink when the job prints
// that ink, else as its process equivalent.
let spots: BTreeSet<String> = if self.set.output.spots_to_process {
BTreeSet::new()
} else {
plates(self.doc).into_iter().filter(|p| p.spot).map(|p| p.name).collect()
};
// that ink as a spot ink, else as its process equivalent.
let spots: BTreeSet<String> = plates(self.doc).into_iter().filter(|p| p.spot && !self.converts(&p.name)).map(|p| p.name).collect();
let own = |name: &str| spots.contains(name);
// A spot plate printing as process prints as the document's swatch of its ink does, when
// there is one; else as the process equivalent its file gives.
+12 -2
View File
@@ -462,15 +462,21 @@ pub struct InkSettings {
/// Halftone screen angle (degrees); `None`: the ink's default.
#[serde(skip_serializing_if = "Option::is_none")]
pub angle: Option<f64>,
/// A spot ink prints as process inks: no plate of its own, its color on the process plates.
/// Off by default. [`PrintOutput::spots_to_process`] converts every spot ink whatever this
/// says; process inks and Registration ignore it.
#[serde(skip_serializing_if = "std::ops::Not::not")]
pub convert_to_process: bool,
}
impl Default for InkSettings {
fn default() -> Self {
Self { name: String::new(), print: true, frequency: None, angle: None }
Self { name: String::new(), print: true, frequency: None, angle: None, convert_to_process: false }
}
}
/// An ink of a separation, with its options resolved ([`super::inks`]).
/// An ink of a separation, with its options resolved ([`super::print_inks`],
/// [`super::document_inks`]).
#[derive(Clone, Debug, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PrintInk {
@@ -479,6 +485,10 @@ pub struct PrintInk {
pub print: bool,
pub frequency: f64,
pub angle: f64,
/// A spot ink printing as process inks (its own option or Convert All Spot Colors to
/// Process): it has no plate.
#[serde(skip_serializing_if = "std::ops::Not::not")]
pub convert_to_process: bool,
}
/// The default halftone screen ruling (lpi).
+37
View File
@@ -423,6 +423,43 @@ fn a_dcs_spot_plate_printing_as_process_takes_the_documents_swatch() {
assert_eq!(get(&own, "Yellow"), Some(vec![0, 0]));
}
/// A DCS image's spot plate converted to process on its own prints as the document's swatch of
/// its ink, while its other spot plate keeps printing on its ink.
#[test]
fn a_dcs_image_converts_only_the_spot_ink_chosen() {
use vectorcraft_doc::separated::{InkPlate, Separated};
let plate = |name: &str, cmyk: [f32; 4], data: [u8; 2]| InkPlate { name: name.into(), cmyk, data: data.to_vec() };
let s = Separated::new(
2,
1,
vec![
plate("Cyan", [0.0; 4], [0, 0]),
plate("Spot Orange", [0.0, 0.6, 1.0, 0.0], [128, 0]),
plate("Spot Green", [0.0, 0.0, 1.0, 0.0], [0, 128]),
],
)
.unwrap();
let mut d = image_doc(ImageBlob::separated_tiff(&s, None, &[]).unwrap(), 2, 1);
d.swatches.push(Swatch { name: "Spot Orange".into(), paint: Paint::solid(Color::cmyk(0.0, 0.6, 1.0, 0.0)), global: true, spot: true });
// The document's Spot Green is cyan, where its file says yellow.
d.swatches.push(Swatch { name: "Spot Green".into(), paint: Paint::solid(Color::cmyk(1.0, 0.0, 0.0, 0.0)), global: true, spot: true });
let settings: PrintSettings =
serde_json::from_value(json!({"output": {"mode": "separations", "inks": [{"name": "Spot Green", "convertToProcess": true}]}})).unwrap();
let names: Vec<String> = print_inks(&d, &settings).0.into_iter().map(|i| i.name).collect();
assert_eq!(names, ["Cyan", "Magenta", "Yellow", "Black", "Spot Orange"]);
let job = plan(&d, &PrintOptions { settings, ..Default::default() }).unwrap();
let coverage = job.plates.iter().map(|p| {
let NodeKind::Image(im) = &p.layers[0].children().unwrap()[0].kind else { panic!("an image") };
p.image_blob(im).and_then(|b| b.coverage()).unwrap().2
});
let all: Vec<(String, Vec<u8>)> = names.into_iter().zip(coverage).collect();
let get = |name: &str| all.iter().find(|(n, _)| n == name).map(|(_, c)| c.clone());
assert_eq!(get("Cyan"), Some(vec![0, 128]), "the swatch's cyan");
assert_eq!(get("Yellow"), Some(vec![0, 0]), "not the file's yellow");
assert_eq!(get("Magenta"), Some(vec![0, 0]), "Spot Orange stays on its own plate");
assert_eq!(get("Spot Orange"), Some(vec![128, 0]));
}
#[test]
fn the_output_settings_convert_cmyk_images_and_compression_recompresses_them_in_cmyk() {
let ink = [0u8, 102, 255, 0];
+87
View File
@@ -637,6 +637,91 @@ fn cmyk_and_a_spot_separate_into_five_plates() {
assert_eq!(inks(&p[2]), [0.0, 40.0], "the gold's yellow");
}
/// A CMYK document with spot swatches Gold and Pine, and three 50 pt squares left to right: Gold
/// at 50%, Pine at 100% and Registration.
fn gold_and_pine() -> Document {
let mut d = doc(200.0, 100.0, &[]);
d.color_mode = vectorcraft_doc::ColorMode::Cmyk;
d.swatches.push(Swatch { name: "Gold".into(), paint: Paint::solid(Color::cmyk(0.0, 0.2, 0.8, 0.1)), global: true, spot: true });
d.swatches.push(Swatch { name: "Pine".into(), paint: Paint::solid(Color::cmyk(0.8, 0.0, 0.3, 0.0)), global: true, spot: true });
let layer = d.default_layer().unwrap();
let linked = |color: Color, swatch: &str, tint: f32| Paint::Solid { color, swatch: Some(swatch.into()), tint };
let squares = [
(0.0, linked(Color::cmyk(0.0, 0.1, 0.4, 0.05), "Gold", 0.5)),
(60.0, linked(Color::cmyk(0.8, 0.0, 0.3, 0.0), "Pine", 1.0)),
(120.0, linked(Color::cmyk(1.0, 1.0, 1.0, 1.0), vectorcraft_color::swatch::REGISTRATION, 1.0)),
];
for (x, p) in squares {
let id = d.alloc_id();
d.insert(Some(layer), 0, Node::path(id, shapes::rectangle(Rect::new(x, 0.0, x + 50.0, 50.0)), Appearance::basic(p, Paint::None, 0.0)))
.unwrap();
}
d
}
/// The ink of each 50 pt square on a plate, left to right, in percent.
fn square_inks(page: &Page) -> Vec<f32> {
page.1
.iter()
.filter(|(b, _)| (b.width() - 50.0).abs() < 1.0 && (b.height() - 50.0).abs() < 1.0)
.map(|(_, p)| match p.color() {
Some(Color::Gray { k }) => (k * 100.0).round(),
c => panic!("{c:?}"),
})
.collect()
}
#[test]
fn one_spot_ink_converts_to_process_and_the_others_keep_their_plates() {
let d = gold_and_pine();
// Gold prints as process even with its plate turned off: converting is not leaving it out.
let set = json!({"output": {"mode": "separations", "inks": [{"name": "Gold", "convertToProcess": true, "print": false, "frequency": 100}]}});
let pv = preview(&d, &settings(set.clone())).unwrap();
assert_eq!(pv.inks.iter().map(|i| i.name.as_str()).collect::<Vec<_>>(), ["Cyan", "Magenta", "Yellow", "Black", "Pine"]);
let all: Vec<(&str, bool)> = pv.document_inks.iter().map(|i| (i.name.as_str(), i.convert_to_process)).collect();
assert_eq!(all, [("Cyan", false), ("Magenta", false), ("Yellow", false), ("Black", false), ("Gold", true), ("Pine", false)]);
let gold = &pv.document_inks[4];
assert_eq!((gold.print, gold.frequency), (false, 100.0), "its plate options are kept");
assert!(pv.setting_notes.iter().all(|n| !n.contains("no ink named") && !n.contains("only spot inks")), "{:?}", pv.setting_notes);
let p = pages(&job(&d, set).bytes);
assert_eq!(p.len(), 5);
// (Gold, Pine, Registration) on Cyan, Magenta, Yellow, Black and Pine.
assert_eq!(
p.iter().map(square_inks).collect::<Vec<_>>(),
[[0.0, 0.0, 100.0], [10.0, 0.0, 100.0], [40.0, 0.0, 100.0], [5.0, 0.0, 100.0], [0.0, 100.0, 100.0]]
);
}
#[test]
fn converting_every_spot_ink_overrides_and_keeps_each_inks_own_choice() {
let d = gold_and_pine();
let inks = json!([{"name": "Gold", "convertToProcess": false, "angle": 30}, {"name": "Pine", "convertToProcess": true}]);
let pv = preview(&d, &settings(json!({"output": {"mode": "separations", "spotsToProcess": true, "inks": inks}}))).unwrap();
assert_eq!(pv.inks.iter().map(|i| i.name.as_str()).collect::<Vec<_>>(), ["Cyan", "Magenta", "Yellow", "Black"]);
let spots: Vec<(&str, bool, f64)> = pv.document_inks[4..].iter().map(|i| (i.name.as_str(), i.convert_to_process, i.angle)).collect();
assert_eq!(spots, [("Gold", true, 30.0), ("Pine", true, 45.0)]);
// The options of the converted inks still name inks of the document.
assert!(pv.setting_notes.iter().all(|n| !n.contains("no ink named")), "{:?}", pv.setting_notes);
// Without the option, each ink's own choice applies again.
let pv = preview(&d, &settings(json!({"output": {"mode": "separations", "inks": inks}}))).unwrap();
assert_eq!(pv.inks.iter().map(|i| i.name.as_str()).collect::<Vec<_>>(), ["Cyan", "Magenta", "Yellow", "Black", "Gold"]);
// A process ink doesn't convert: it keeps its plate, and a note says so.
let pv = preview(&d, &settings(json!({"output": {"mode": "separations", "inks": [{"name": "Cyan", "convertToProcess": true}]}}))).unwrap();
assert_eq!(pv.inks.len(), 6);
assert!(pv.document_inks.iter().all(|i| !i.convert_to_process));
assert_eq!(pv.setting_notes, ["`Cyan` print as process inks already: only spot inks convert to process"]);
}
#[test]
fn an_ink_option_without_convert_to_process_keeps_its_spot_plate() {
let set = settings(json!({"output": {"inks": [{"name": "Gold", "angle": 30}]}}));
assert!(!set.output.inks[0].convert_to_process);
let back = serde_json::to_value(&set.output.inks[0]).unwrap();
assert_eq!(back, json!({"name": "Gold", "print": true, "angle": 30.0}), "off is not written");
let on = InkSettings { convert_to_process: true, ..set.output.inks[0].clone() };
assert_eq!(serde_json::to_value(&on).unwrap()["convertToProcess"], json!(true));
}
/// A 200 × 100 pt CMYK document filled with cyan, with spot swatch `Ink` (100% K) and the objects
/// `art` over the cyan.
fn over_cyan(art: Vec<Node>) -> Document {
@@ -988,6 +1073,8 @@ fn a_spot_gradient_stop_prints_its_process_plates() {
assert_eq!(first(json!({"output": {"mode": "separations"}})), [25.0, 0.0, 40.0, 0.0, 50.0], "Cyan, Magenta, Yellow, Black, Gold");
// Spots as process: the plates layered with the gold tint's process inks (0, 10, 40, 5).
assert_eq!(first(json!({"output": {"mode": "separations", "spotsToProcess": true}})), [25.0, 10.0, 64.0, 5.0]);
// Gold converted on its own: the same.
assert_eq!(first(json!({"output": {"mode": "separations", "inks": [{"name": "Gold", "convertToProcess": true}]}})), [25.0, 10.0, 64.0, 5.0]);
}
#[test]
+6 -1
View File
@@ -81,8 +81,13 @@ fn form_resource_scopes_keep_scanned_overprint_in_step_with_interpretation() {
}
pub(crate) fn text_pdf(content: &str) -> Vec<u8> {
text_pdf_with("/ca 0.25 /CA 0.75", content)
}
/// [`text_pdf`] with graphics state `/G` set by `state` (its entries, such as `/ca 0.5 /CA 0.5`).
pub(crate) fn text_pdf_with(state: &str, content: &str) -> Vec<u8> {
page(
"/Font << /F1 5 0 R >> /ExtGState << /G << /ca 0.25 /CA 0.75 >> >>",
&format!("/Font << /F1 5 0 R >> /ExtGState << /G << {state} >> >>"),
content.as_bytes(),
&[
b"<< /Type /Font /Subtype /TrueType /BaseFont /Inter-Regular /Encoding /WinAnsiEncoding /FirstChar 65 /LastChar 67 /Widths [600 600 600] /FontDescriptor 6 0 R >>".to_vec(),
+25 -1
View File
@@ -38,6 +38,11 @@ fn page(drawn: &[char], sign_width: Option<f64>) -> Vec<u8> {
/// graphics state, to set between glyphs or before them, with `objects` it refers to (the first
/// is object `first_extra(1) + 4`).
fn page_with(ops: impl Fn(&dyn Fn(char) -> String) -> String, extra: &str, objects: &[String], sign_width: Option<f64>) -> Vec<u8> {
page_in("Identity-H", ops, extra, objects, sign_width)
}
/// [`page_with`] with the Type 0 font's encoding `encoding` (`Identity-V`: vertical writing).
fn page_in(encoding: &str, ops: impl Fn(&dyn Fn(char) -> String) -> String, extra: &str, objects: &[String], sign_width: Option<f64>) -> Vec<u8> {
FontDb::global().add_font(matra_font().expect("the test font builds"));
let program = matra_font().unwrap();
let hex: String = program.iter().map(|b| format!("{b:02X}")).collect::<String>() + ">";
@@ -66,7 +71,7 @@ fn page_with(ops: impl Fn(&dyn Fn(char) -> String) -> String, extra: &str, objec
];
let refs: Vec<&str> = objs.iter().chain(objects).map(String::as_str).collect();
let resources = format!(
"/Font << /F1 << /Type /Font /Subtype /Type0 /BaseFont /MatratestSans-Regular /Encoding /Identity-H /DescendantFonts [{} 0 R] /ToUnicode {} 0 R >> >> {extra}",
"/Font << /F1 << /Type /Font /Subtype /Type0 /BaseFont /MatratestSans-Regular /Encoding /{encoding} /DescendantFonts [{} 0 R] /ToUnicode {} 0 R >> >> {extra}",
n + 2,
n + 3
);
@@ -218,3 +223,22 @@ fn outlined_glyphs_under_a_varying_soft_mask_are_masked_one_by_one() {
assert_eq!(outlines(&report.document), 3, "a path each");
assert_eq!(masked_outlines(&report.document), 3, "each path has its own mask");
}
/// A vertical line (upright glyphs) with one glyph filled and stroked: its glyphs aren't kept as
/// outlines, so it can't come in as the outlines of that glyph alone, losing the glyph filled
/// only. Every glyph comes in filled (#8015).
#[test]
fn a_vertical_line_with_one_glyph_filled_and_stroked_keeps_every_glyph_filled() {
let bytes = page_in("Identity-V", |id| format!("1 0 0 rg 0 0 1 RG 2 w {} Tj 2 Tr {} Tj 0 Tr", id(KA), id(SIGN_I)), "", &[], None);
let report = open(&bytes);
let mut runs = vec![];
report.document.walk(|n| {
if let NodeKind::Text(t) = &n.kind {
runs.extend(t.runs.iter().map(|r| (r.text.clone(), !r.style.fill.is_none(), !r.style.stroke.is_none())));
}
});
let filled: String = runs.iter().filter(|r| r.1).map(|r| r.0.as_str()).collect();
assert_eq!(filled, format!("{KA}{SIGN_I}"), "every glyph filled: {runs:?}");
let stroked: String = runs.iter().filter(|r| r.2).map(|r| r.0.as_str()).collect();
assert_eq!(stroked, SIGN_I.to_string(), "{runs:?}");
}
+16
View File
@@ -758,3 +758,19 @@ fn perf_text_heavy_open() {
println!("4000 lines: {n} text objects in {took:?} (as outlines: {:?})", start.elapsed());
}
}
/// Vertical type filled, then stroked (fill and stroke rendering draws a whole operator's glyphs
/// filled before it strokes them): one column, each glyph filled and stroked (#8015).
#[test]
fn a_vertical_column_filled_then_stroked_is_one_filled_and_stroked_type() {
for mode in ["2", "6"] {
let content = format!("0 0 1 RG 1 0 0 rg 2 w BT {mode} Tr /F6 24 Tf 150 180 Td {} Tj 0 Tr ET", gids("§±×"));
let t = texts(&open_as(&page(&content, ""), TextAs::Text));
assert_eq!(t.len(), 1, "{content}: {t:#?}");
assert_eq!(t[0].plain_text(), "§±×");
for r in &t[0].runs {
assert!(!r.style.fill.is_none() && !r.style.stroke.is_none(), "{content}: {:?}", t[0].runs);
assert!((r.style.stroke_width - 2.0).abs() < 1e-6, "{content}");
}
}
}
+175
View File
@@ -122,3 +122,178 @@ fn imported_stroked_type_keeps_the_files_cap_join_and_miter_limit() {
assert_eq!(joins, [Some(LineJoin::Round), Some(LineJoin::Miter)], "{content}: {runs:?}");
}
}
/// Fill and stroke rendering (mode 2, or 6 with a clip) draws a text-showing operator's glyphs
/// filled, then the same glyphs stroked: the type comes in once, filled and stroked, whether the
/// operator shows one glyph or a word, or a TJ array of strings with kerning between them, in an
/// outline font, with or without replacement text (`ActualText`). Stroke rendering (modes 1 and 5) stays stroke only. A Type 3 glyph is filled in
/// every one of those modes, once (#8015).
#[test]
fn a_word_filled_then_stroked_imports_as_one_filled_and_stroked_type() {
use vectorcraft_testkit::pdf::{PdfPage, first_extra, pdf_with};
// `/T3`: a Type 3 font whose glyphs take the text's paint (`d1`), `W A V E` mapped by ToUnicode.
let t3 = first_extra(1);
let glyph = crate::tests_import_fidelity::stream("", "600 0 0 0 600 700 d1 0 0 m 600 0 l 300 700 l h f");
let to_unicode = crate::tests_import_fidelity::stream(
"",
"/CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def /CMapName /T3-UCS def /CMapType 2 def 1 begincodespacerange <00> <FF> endcodespacerange 4 beginbfchar\n<41> <0041>\n<45> <0045>\n<56> <0056>\n<57> <0057>\nendbfchar endcmap CMapName currentdict /CMap defineresource pop end end",
);
let font = format!(
"<< /Type /Font /Subtype /Type3 /FontBBox [0 0 600 700] /FontMatrix [0.001 0 0 0.001 0 0] /CharProcs << /g {} 0 R >> /Encoding << /Type /Encoding /Differences [65 /g 69 /g 86 /g 87 /g] >> /FirstChar 65 /LastChar 87 /Widths [600 0 0 0 600 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 600 600] /ToUnicode {} 0 R /Resources << >> >>",
t3 + 1,
t3 + 2
);
let page = |content: &str| {
let resources = format!("/Font << /F1 << /Type /Font /Subtype /Type1 /BaseFont /Helvetica >> /T3 {t3} 0 R >>");
pdf_with(&[PdfPage { resources, ..PdfPage::new(300.0, 200.0, content) }], &[&font, &glyph, &to_unicode], None)
};
let objects = |content: &str| {
let d = import(&page(content)).unwrap();
let mut types = vec![];
d.walk(|n| {
if let NodeKind::Text(t) = &n.kind {
types.push((**t).clone());
}
});
types
};
let cream = Paint::solid(Color::rgb8(0xff, 0xff, 0xcc));
let black = Paint::solid(Color::BLACK);
let shows =
["(WAVE) Tj", "[(WA) -50 (VE)] TJ", "(WA) Tj (VE) Tj", "(W) Tj (A) Tj (V) Tj (E) Tj", "/Span << /ActualText (WAVE) >> BDC (WAVE) Tj EMC"];
for font in ["F1", "T3"] {
for show in shows {
for mode in ["0", "1", "2", "4", "5", "6"] {
let content = format!("0 0 0 RG 1 1 0.8 rg 3 w 1 J 1 j BT {mode} Tr /{font} 60 Tf 40 110 Td {show} 0 Tr ET");
let types = objects(&content);
assert_eq!(types.len(), 1, "{content}: one type object: {types:#?}");
let t = &types[0];
assert_eq!(t.plain_text(), "WAVE", "{content}");
// A Type 3 glyph paints itself: the reader fills it whatever the mode.
let (fill, stroke) = match mode {
_ if font == "T3" => (true, false),
"0" | "4" => (true, false),
"1" | "5" => (false, true),
_ => (true, true),
};
for r in &t.runs {
let s = &r.style;
assert_eq!(s.fill, if fill { cream.clone() } else { Paint::None }, "{content}: fill: {:?}", t.runs);
if stroke {
assert_eq!(s.stroke, black, "{content}: stroke: {:?}", t.runs);
assert!((s.stroke_width - 3.0).abs() < 1e-6, "{content}: width {}", s.stroke_width);
assert_eq!((s.stroke_cap, s.stroke_join), (LineCap::Round, LineJoin::Round), "{content}");
} else {
assert!(s.stroke.is_none(), "{content}: no stroke: {:?}", t.runs);
}
}
}
}
}
// A word filled, then stroked with another join part way through (one operator each):
// each part keeps its own join, all of it filled.
let content = "0 0 0 RG 1 1 0.8 rg 3 w BT 2 Tr /F1 60 Tf 40 110 Td 1 j (WA) Tj 0 j (VE) Tj 0 Tr ET";
let types = objects(content);
assert_eq!(types.len(), 1, "{content}: {types:#?}");
let joins: Vec<_> = types[0].runs.iter().map(|r| (r.text.as_str(), r.style.fill == cream, r.style.stroke_join)).collect();
assert_eq!(joins, [("WA", true, LineJoin::Round), ("VE", true, LineJoin::Miter)], "{content}");
// Filled type, then stroked type of its own elsewhere: a stroke over no filled glyph.
let content = "0 0 0 RG 1 1 0.8 rg 3 w BT 0 Tr /F1 60 Tf 40 110 Td (WAVE) Tj 1 Tr 0 -70 Td (WAVE) Tj 0 Tr ET";
let types = objects(content);
assert_eq!(types.len(), 2, "{content}: {types:#?}");
let looks: Vec<_> = types.iter().flat_map(|t| &t.runs).map(|r| (r.style.fill == cream, !r.style.stroke.is_none())).collect();
assert_eq!(looks, [(true, false), (false, true)], "{content}");
}
/// Helvetica PDF page drawing `content`, imported: each run of type as its text, size, and
/// whether it is filled and stroked, in text order.
fn word_runs(content: &str) -> Vec<(String, f64, bool, bool)> {
use vectorcraft_testkit::pdf::{PdfPage, pdf};
let resources = "/Font << /F1 << /Type /Font /Subtype /Type1 /BaseFont /Helvetica >> >>";
let bytes = pdf(&[PdfPage { resources: resources.into(), ..PdfPage::new(300.0, 200.0, content) }], None);
let d = import(&bytes).unwrap();
let mut runs = vec![];
d.walk(|n| {
if let NodeKind::Text(t) = &n.kind {
runs.extend(t.runs.iter().map(|r| (r.text.clone(), r.style.size, !r.style.fill.is_none(), !r.style.stroke.is_none())));
}
});
runs.sort_by(|a, b| a.0.cmp(&b.0).then(a.1.total_cmp(&b.1)));
runs
}
/// A stroke goes only over a glyph filled with the very same placement: a word filled, then its
/// first glyph stroked at another size from the same origin, is two pieces of type, the word
/// unstroked and the glyph at its own size (#8015).
#[test]
fn a_stroke_at_another_size_does_not_go_over_the_filled_glyph() {
for mode in ["1", "2"] {
let content = format!("0 0 0 RG 1 1 0.8 rg 3 w BT /F1 60 Tf 40 110 Td (WAVE) Tj ET BT {mode} Tr /F1 30 Tf 40 110 Td (W) Tj 0 Tr ET");
let filled = mode == "2";
assert_eq!(word_runs(&content), [("W".to_string(), 30.0, filled, true), ("WAVE".to_string(), 60.0, true, false)], "{content}");
}
}
/// A stroke over one glyph of a filled word strokes that glyph alone, not the rest of the word
/// (#8015).
#[test]
fn a_stroke_over_one_glyph_of_a_filled_word_strokes_only_that_glyph() {
// W alone stroked at the same size from the same origin: W is stroked, AVE not.
let content = "0 0 0 RG 1 1 0.8 rg 3 w BT /F1 60 Tf 40 110 Td (WAVE) Tj ET BT 1 Tr /F1 60 Tf 40 110 Td (W) Tj 0 Tr ET";
assert_eq!(word_runs(content), [("AVE".to_string(), 60.0, true, false), ("W".to_string(), 60.0, true, true)], "{content}");
// Filled and stroked there instead: that W is drawn again, over the word, as type of its own.
let content = "0 0 0 RG 1 1 0.8 rg 3 w BT /F1 60 Tf 40 110 Td (WAVE) Tj ET BT 2 Tr /F1 60 Tf 40 110 Td (W) Tj 0 Tr ET";
assert_eq!(word_runs(content), [("W".to_string(), 60.0, true, true), ("WAVE".to_string(), 60.0, true, false)], "{content}");
}
/// A glyph filled at one opacity and stroked at another (`ca` and `CA` differ) stays two pieces
/// of type, each at its own opacity, also when it is shown on its own, so the stroke is drawn
/// right after its fill (#8015). Two such operators are four pieces in the order they are drawn,
/// the second glyph's fill over the first one's stroke.
#[test]
fn a_glyph_stroked_at_another_opacity_than_its_fill_stays_its_own_type() {
let (fill, stroke) = ((64.0 / 255.0, true, false), (191.0 / 255.0, false, true));
for (show, want) in [("(A) Tj", vec![fill, stroke]), ("(A) Tj (B) Tj", vec![fill, stroke, fill, stroke])] {
let content = format!("/G gs 1 0 0 rg 0 0 1 RG 2 w BT /F1 20 Tf 2 Tr 1 0 0 1 10 20 Tm {show} 0 Tr ET");
let d = import(&crate::tests::reader_compat::text_pdf(&content)).unwrap();
let mut texts = vec![];
d.walk(|n| {
if let NodeKind::Text(t) = &n.kind {
let st = t.first_style();
texts.push((n.opacity, !st.fill.is_none(), !st.stroke.is_none()));
}
});
assert_eq!(texts, want, "{content}");
}
}
/// Type filled and stroked at the same opacity below 1 stays a filled object and a stroked one:
/// the file composites the fill and the stroke apiece (darker where they overlap), while an
/// object's opacity applies to its fill and stroke together. Opaque, it is one object (#8015).
#[test]
fn translucent_fill_and_stroke_text_stays_two_objects() {
let half = |fill, stroke| (128.0 / 255.0, fill, stroke);
for show in ["(A) Tj", "(AB) Tj"] {
let content = format!("/G gs 1 0 0 rg 0 0 1 RG 2 w BT /F1 20 Tf 2 Tr 1 0 0 1 10 20 Tm {show} 0 Tr ET");
for (state, want) in [("/ca 0.5 /CA 0.5", vec![half(true, false), half(false, true)]), ("/ca 1 /CA 1", vec![(1.0, true, true)])] {
let d = import(&crate::tests::reader_compat::text_pdf_with(state, &content)).unwrap();
let mut texts = vec![];
d.walk(|n| {
if let NodeKind::Text(t) = &n.kind {
let st = t.first_style();
texts.push((n.opacity, !st.fill.is_none(), !st.stroke.is_none()));
}
});
assert_eq!(texts, want, "{state}: {content}");
}
}
}
/// A stroke goes only over a glyph filled with the same text: "AB" filled, its "A" stroked, then
/// an "X" stroked where the "B" stands is type of its own, and the "B" stays unstroked (#8015).
#[test]
fn a_stroke_of_another_glyph_where_one_was_filled_stays_its_own_type() {
let content = "0 0 0 RG 1 1 0.8 rg 3 w BT /F1 60 Tf 1 0 0 1 40 110 Tm (AB) Tj 1 Tr 1 0 0 1 40 110 Tm (A) Tj (X) Tj 0 Tr ET";
let want = [("A".to_string(), 60.0, true, true), ("B".to_string(), 60.0, true, false), ("X".to_string(), 60.0, false, true)];
assert_eq!(word_runs(content), want, "{content}");
}
+26 -5
View File
@@ -454,18 +454,23 @@ fn check_spaced_harakat(db: &FontDb, family: &str) {
}
/// Right to left, with harakat coloured apart, Optical kerning keeps the Tsume of each letter's
/// cluster as it does in "HOH": the glyphs move as far with Optical kerning as without it.
/// cluster as it does in "HOH": the glyphs move as far with Optical kerning as without it. The test
/// font leaves blank space beside both letters' ink, so its Tsume must move something; an installed
/// face may not (#7821: Arial's initial beh and its fatha fill its cell), and there the Tsume takes
/// nothing, with or without Optical kerning.
#[test]
fn optical_kerning_keeps_the_tsume_of_a_letter_with_coloured_harakat() {
let db = FontDb::with_font_dirs(vec![]);
assert_eq!(db.add_font(crate::test_fonts::lam_alef_font(b"rlig").unwrap()), 1);
check_optical_tsume(&db, crate::test_fonts::lam_alef_family(b"rlig"));
check_optical_tsume(&db, crate::test_fonts::lam_alef_family(b"rlig"), true);
if let Some(face) = arabic_face("optical_kerning_keeps_the_tsume_of_a_letter_with_coloured_harakat") {
check_optical_tsume(FontDb::global(), &face.family);
check_optical_tsume(FontDb::global(), &face.family, false);
}
}
fn check_optical_tsume(db: &FontDb, family: &str) {
/// `strict`: every letter's cluster must leave blank space beside its ink, so its Tsume must move
/// or narrow something.
fn check_optical_tsume(db: &FontDb, family: &str, strict: bool) {
const WORD: &str = "بَبَ"; // ب 0, fatha 2, ب 4, fatha 6
let set = |optical: bool, letter: Option<usize>| {
let mut t = text_with_harakat(WORD, family, Some(red()));
@@ -479,11 +484,27 @@ fn check_optical_tsume(db: &FontDb, family: &str) {
// Tsume of the line's first cluster only narrows its advance and moves no glyph.
let xs = |t: &TextObject| layout(db, t).glyphs.iter().flat_map(|g| [g.xf.as_coeffs()[4], g.advance]).collect::<Vec<_>>();
assert!(xs(&set(true, None)).iter().zip(xs(&set(false, None))).any(|(a, b)| (a - b).abs() > 1e-6), "{family}: Optical moves the pair");
// The blank space Tsume shares out: between the letter's cluster's cell (from its glyphs'
// shared origin, as long as their advances) and its glyphs' ink, on each side, without Tsume.
let plain = layout(db, &set(false, None));
let blank = |letter: usize| {
let cluster: Vec<_> = plain.glyphs.iter().filter(|g| g.byte == letter).collect();
let start = cluster.iter().map(|g| g.origin.x).fold(f64::INFINITY, f64::min);
let end = start + cluster.iter().map(|g| g.advance).sum::<f64>();
let ink = cluster.iter().filter(|g| !g.outline.elements().is_empty()).map(|g| g.outline.bounding_box());
let (lo, hi) = ink.fold((f64::INFINITY, f64::NEG_INFINITY), |(lo, hi), b| (lo.min(b.x0), hi.max(b.x1)));
(lo - start).clamp(0.0, end - start) + (end - hi).clamp(0.0, end - start)
};
// Each letter in turn: the first one's cluster ends the pair, the second one's starts it.
for letter in [0, 4] {
let moved = |optical: bool| xs(&set(optical, Some(letter))).iter().zip(xs(&set(optical, None))).map(|(a, b)| a - b).collect::<Vec<_>>();
let (without, with_optical) = (moved(false), moved(true));
assert!(without.iter().any(|m| m.abs() > 1e-3), "{family} {letter}: Tsume moves or narrows the glyphs: {without:?}");
let blank = blank(letter);
if strict || blank > 1e-6 {
assert!(without.iter().any(|m| m.abs() > 1e-6), "{family} {letter}: Tsume moves or narrows the glyphs ({blank} blank): {without:?}");
} else {
assert!(without.iter().all(|m| m.abs() < 1e-6), "{family} {letter}: no blank space ({blank}), Tsume takes nothing: {without:?}");
}
assert!(
without.len() == with_optical.len() && without.iter().zip(&with_optical).all(|(a, b)| (a - b).abs() < 1e-6),
"{family} {letter}: {without:?} {with_optical:?}"
+65 -7
View File
@@ -746,13 +746,19 @@ fn general(app: &VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) {
let on = scaling == PrintScaling::Custom || tiles;
let linked = get(d, SCALE_LINKED).as_bool() == Some(true);
ui.label(tl!("W:"));
if let Some(w) = percent(ui, d, "scale.width", on).filter(|_| linked) {
let w = percent(ui, d, "scale.width", on);
if let Some(w) = w.filter(|_| linked) {
set(d, "scale.height", json!(w));
}
ui.label(tl!("H:"));
if let Some(h) = percent(ui, d, "scale.height", on).filter(|_| linked) {
let h = percent(ui, d, "scale.height", on);
if let Some(h) = h.filter(|_| linked) {
set(d, "scale.width", json!(h));
}
// A typed W or H is what the next `ui.dialog.set` changes from.
if w.is_some() || h.is_some() {
see_scale(&mut d.fields);
}
ui.add_enabled_ui(on, |ui| scale_link(ui, d, linked));
});
row(ui, tl!("Overlap:"), |ui| length(ui, d, "overlap", unit, tiles));
@@ -779,11 +785,13 @@ fn output(ui: &mut egui::Ui, d: &mut Dialog, pv: &Result<Value, String>) {
flag(ui, d, "output.spotsToProcess", tl!("Convert All Spot Colors to Process"), separations);
flag(ui, d, "output.overprintBlack", tl!("Overprint Black"), separations);
heading(ui, tl!("Document Ink Options"));
let inks = pv.as_ref().ok().and_then(|v| v["inks"].as_array()).map(Vec::as_slice).unwrap_or_default();
// Every ink of the document, the spot inks printing as process (no plate) included.
let inks = pv.as_ref().ok().and_then(|v| v["documentInks"].as_array()).map(Vec::as_slice).unwrap_or_default();
if !separations || inks.is_empty() {
note(ui, tl!("Separations list the document's inks here: one page per ink that prints."));
return;
}
let all_spots = get(d, "output.spotsToProcess").as_bool() == Some(true);
let t = Tokens::get(ui.ctx());
egui::Grid::new("print-inks").num_columns(4).spacing([12.0, 4.0]).show(ui, |ui| {
for h in [tl!("Print"), tl!("Ink"), tl!("Frequency"), tl!("Angle")] {
@@ -792,17 +800,31 @@ fn output(ui: &mut egui::Ui, d: &mut Dialog, pv: &Result<Value, String>) {
ui.end_row();
for ink in inks {
let name = ink["name"].as_str().unwrap_or_default();
// A spot ink printing as process has no plate: its plate options wait, dimmed, for it
// to print as a spot ink again.
let process = ink["convertToProcess"] == true;
let on = ink["print"].as_bool().unwrap_or(true);
if widgets::check_box(ui, name, on, true) {
if widgets::check_box(ui, name, on, !process) {
set_ink(d, name, "print", json!(!on));
}
let spot = if ink["spot"] == true { format!(" ({})", tl!("spot")) } else { String::new() };
ui.label(egui::RichText::new(format!("{name}{spot}")).color(t.text));
ui.horizontal(|ui| {
if ink["spot"] == true {
if ink_kind_button(ui, name, process, !all_spots) {
set_ink(d, name, "convertToProcess", json!(!process));
}
} else {
ui.add_space(INK_KIND);
}
let spot = if ink["spot"] == true { format!(" ({})", tl!("spot")) } else { String::new() };
ui.label(egui::RichText::new(format!("{name}{spot}")).color(t.text));
});
for (k, suffix) in [("frequency", " lpi"), ("angle", "°")] {
let v = ink[k].as_f64().unwrap_or(0.0);
let heading = if k == "frequency" { tl!("Frequency") } else { tl!("Angle") };
let field_name = format!("{heading} {name}");
if let Some(x) = widgets::plain_field_named(ui, ("print-ink", name, k), Some(&field_name), v, suffix, 2, 72.0) {
let typed =
ui.add_enabled_ui(!process, |ui| widgets::plain_field_named(ui, ("print-ink", name, k), Some(&field_name), v, suffix, 2, 72.0));
if let Some(x) = typed.inner {
set_ink(d, name, k, json!(x));
}
}
@@ -812,6 +834,42 @@ fn output(ui: &mut egui::Ui, d: &mut Dialog, pv: &Result<Value, String>) {
note(ui, tl!("Frequencies and angles are the output device's to apply."));
}
/// The size of the spot or process icon before a spot ink's name.
const INK_KIND: f32 = 18.0;
/// The icon before spot ink `name`'s name: a spot icon while it prints as a spot ink, the four
/// process inks while it prints as process (`process`). A click switches it; dimmed (`enabled`
/// off) while Convert All Spot Colors to Process converts every spot ink. Whether it was clicked.
fn ink_kind_button(ui: &mut egui::Ui, name: &str, process: bool, enabled: bool) -> bool {
let label = if process {
crate::i18n::fmt(tl!("Keep {name} as spot"), &[("name", name)])
} else {
crate::i18n::fmt(tl!("Convert {name} to process"), &[("name", name)])
};
let sense = if enabled { egui::Sense::click() } else { egui::Sense::hover() };
let (rect, resp) = ui.allocate_exact_size(egui::Vec2::splat(INK_KIND), sense);
let t = Tokens::get(ui.ctx());
if enabled && resp.hovered() {
ui.painter().rect_filled(rect, 3.0, t.hover);
}
let icon = rect.shrink(4.0);
if process {
let q = icon.size() / 2.0;
for (i, c) in crate::panels::swatches::CMYK_INKS.into_iter().enumerate() {
let c = if enabled { c } else { c.gamma_multiply(0.4) };
let at = icon.min + egui::vec2((i % 2) as f32 * q.x, (i / 2) as f32 * q.y);
ui.painter().rect_filled(egui::Rect::from_min_size(at, q), 0.0, c);
}
} else {
let color = if enabled { t.icon } else { t.text_disabled };
ui.painter().circle_stroke(icon.center(), icon.width() / 2.0, egui::Stroke::new(1.0, color));
ui.painter().circle_filled(icon.center(), icon.width() / 5.0, color);
}
resp.widget_info(|| widgets::icon_button_info(enabled, false, &label));
let resp = resp.on_hover_text(label);
enabled && resp.clicked()
}
/// Set option `key` of ink `name` in `output.inks` (the ink gets its own entry the first time).
fn set_ink(d: &mut Dialog, name: &str, key: &str, value: Value) {
let mut inks = get(d, "output.inks").as_array().cloned().unwrap_or_default();
+184 -9
View File
@@ -9,7 +9,10 @@
//! `ui.dialog.set`, or `preset` to load a preset), plus the dialog's own: `__view` (`original`,
//! `optimized`, `2up`, `4up`), `__zoom` (`fit` or a percentage), `__kbps` (connection speed),
//! `__color` (the colour table's selected colour, by source), `__presetName` (shown while saving a
//! preset) and `__hasSlices`. Save… remembers
//! preset) and `__hasSlices`. Optimize to File Size… (`__optimizeOpen: true`) shows `__optimizeK` (the desired size in K),
//! `__optimizeStart` (`current`, `auto`) and with slices `__optimizeUse` (`allSlices`,
//! `eachSlice`, `currentSlice`); `__optimizeGo: true` runs `webExport.optimizeToFileSize` and
//! takes the settings it finds, and `__optimized` holds its result. Save… remembers
//! the settings and writes the files (`file.saveForWeb`); Done only remembers them; Preview in
//! Browser opens the HTML page (`file.saveForWeb.browser`). While Alt (Option on macOS) is held,
//! Cancel reads Reset, which puts the remembered settings back and leaves the dialog open
@@ -71,6 +74,11 @@ const MATTES: [&str; 3] = ["none", "white", "black"];
const MATTE_LABELS: [&str; 4] = ["None", "White", "Black", "Other"];
/// JPEG quality steps: (label, quality).
const QUALITIES: [(&str, u8); 5] = [("Low", 10), ("Medium", 30), ("High", 60), ("Very High", 80), ("Maximum", 100)];
/// Optimize to File Size's Start With (`__optimizeStart`) and Use (`__optimizeUse`) choices.
const START_WITH: [(&str, &str); 2] = [("current", "Current Settings"), ("auto", "Auto Select GIF/JPEG")];
const SIZE_USE: [(&str, &str); 3] = [("allSlices", "Total of All Slices"), ("eachSlice", "Each Slice"), ("currentSlice", "Current Slice")];
/// The fields of Optimize to File Size's rows.
const OPTIMIZE_FIELDS: [&str; 3] = ["__optimizeK", "__optimizeStart", "__optimizeUse"];
/// Open on the document's active artboard, keeping the other remembered settings.
pub fn open(app: &mut VectorcraftApp) -> Result<Value, String> {
@@ -412,13 +420,11 @@ fn texture(ctx: &egui::Context, name: &str, px: &[u8], [w, h]: [u32; 2]) -> egui
ctx.load_texture(name, img, opts)
}
/// The rendering for `s` and the optimised image for each of `panes`, from the cache when nothing
/// they depend on changed.
fn previews(app: &VectorcraftApp, ctx: &egui::Context, s: &WebSettings, panes: &[WebSettings]) -> (Result<Shot, String>, Vec<Result<Shot, String>>) {
let Some(st) = app.session.active() else { return (Err("no document".into()), vec![]) };
let doc = &st.doc;
let mut cache: Cache = ctx.data(|m| m.get_temp(cache_id())).unwrap_or_default();
let render_key = format!(
/// What the rendering for `s` depends on: the active document, its revision and the settings that
/// change the image's pixels.
fn render_key(app: &VectorcraftApp, s: &WebSettings) -> Option<String> {
let st = app.session.active()?;
Some(format!(
"{}:{}:{:?}:{:?}:{:?}:{}:{}:{:?}:{:?}",
st.uid,
st.revision,
@@ -429,7 +435,15 @@ fn previews(app: &VectorcraftApp, ctx: &egui::Context, s: &WebSettings, panes: &
s.clip_to_artboard,
s.artboard,
(!s.clip_to_artboard).then_some(s.slices)
);
))
}
/// The rendering for `s` and the optimised image for each of `panes`, from the cache when nothing
/// they depend on changed.
fn previews(app: &VectorcraftApp, ctx: &egui::Context, s: &WebSettings, panes: &[WebSettings]) -> (Result<Shot, String>, Vec<Result<Shot, String>>) {
let (Some(st), Some(render_key)) = (app.session.active(), render_key(app, s)) else { return (Err("no document".into()), vec![]) };
let doc = &st.doc;
let mut cache: Cache = ctx.data(|m| m.get_temp(cache_id())).unwrap_or_default();
if cache.render_key != render_key || cache.render.is_none() {
let r = webexport::render(doc, s).map(Arc::new);
cache.original = r.as_ref().ok().map(|r| Shot {
@@ -508,6 +522,14 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
if let Err(e) = apply_preset(app, d) {
app.status(e);
}
if d.fields.remove("__optimizeOpen").is_some_and(|v| v == json!(true)) {
open_optimize_rows(app, ui, d);
}
if d.fields.remove("__optimizeGo").is_some_and(|v| v == json!(true))
&& let Err(e) = optimize_to_size(app, d)
{
app.status(e);
}
let settings = settings_of(app, d);
let mut browser = false;
ui.horizontal_top(|ui| {
@@ -521,6 +543,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
side(app, ui, d, settings.as_ref().ok());
});
});
optimize_on_enter(ui.ctx(), d);
if browser && let Err(e) = app.run("file.saveForWeb.browser", params(d)) {
app.status(e);
}
@@ -704,6 +727,7 @@ fn pairs<T: Copy>(all: &[T], key: fn(T) -> &'static str, label: fn(T) -> &'stati
fn side(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>) {
presets_row(app, ui, d, s);
optimize_rows(ui, d, s, &art_key(app));
widgets::divider(ui);
egui::ScrollArea::vertical().id_salt("sfw-settings").max_height(PREVIEW_H - 40.0).auto_shrink([false, true]).show(ui, |ui| {
let choice = |ui: &mut egui::Ui, d: &mut Dialog, key: &str, label: &str, options: &[(&str, &str)]| {
@@ -805,6 +829,157 @@ fn presets_row(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog, s: O
}
}
/// The optimized file size of the settings `s` on the active document as it is now: from the preview
/// cache when the cache holds that document at its current revision, else made through [`previews`],
/// which keeps the image for the preview drawn later in the same frame.
fn previewed_bytes(app: &VectorcraftApp, ui: &egui::Ui, s: &WebSettings) -> Option<usize> {
let key = s.to_json().to_string();
let cache: Option<Cache> = ui.ctx().data(|m| m.get_temp(cache_id()));
let cached = cache
.filter(|c| Some(&c.render_key) == render_key(app, s).as_ref())
.and_then(|c| c.shots.into_iter().find(|(k, _)| *k == key))
.and_then(|(_, shot)| shot.ok())
.and_then(|shot| shot.bytes);
cached.or_else(|| previews(app, ui.ctx(), s, std::slice::from_ref(s)).1.into_iter().next()?.ok()?.bytes)
}
/// Optimize to File Size…: the button opens rows ([`open_optimize_rows`]) for the desired size in
/// K, Start With and, with slices, Use; OK or Enter runs [`optimize_to_size`] and Cancel
/// closes the rows. A line gives the size it found and whether that is within the desired size
/// ([`optimized_result`]).
fn optimize_rows(ui: &mut egui::Ui, d: &mut Dialog, s: Option<&WebSettings>, art: &str) {
if d.fields.contains_key("__optimizeK") {
widgets::label_row(ui, tl!("Desired File Size:"), LABEL_W, |ui| {
let k = d.f64("__optimizeK", 32.0);
if let Some(v) = widgets::range_field(ui, "sfw-optimize-k", k, 0.001..=webexport::MAX_DESIRED_K, "K", 3, 100.0) {
d.fields.insert("__optimizeK".into(), json!(v));
}
});
form::choice(ui, d, "__optimizeStart", tl!("Start With:"), (LABEL_W, FIELD_W), &START_WITH);
if d.bool("__hasSlices") {
form::choice(ui, d, "__optimizeUse", tl!("Use:"), (LABEL_W, FIELD_W), &SIZE_USE);
}
widgets::label_row(ui, "", LABEL_W, |ui| {
if widgets::flat_button(ui, tl!("OK"), 64.0).clicked() {
d.fields.insert("__optimizeGo".into(), json!(true));
}
if widgets::flat_button(ui, tl!("Cancel"), 64.0).clicked() {
for k in OPTIMIZE_FIELDS {
d.fields.remove(k);
}
}
});
} else {
widgets::label_row(ui, "", LABEL_W, |ui| {
if widgets::flat_button(ui, tl!("Optimize to File Size…"), FIELD_W).clicked() {
d.fields.insert("__optimizeOpen".into(), json!(true));
}
});
}
if let Some(r) = optimized_result(d, s, art) {
let size = size_label(r["bytes"].as_u64().unwrap_or(0) as usize);
let target = size_label(r["targetBytes"].as_u64().unwrap_or(0) as usize);
let text = if r["achieved"] == json!(true) {
crate::i18n::fmt(tl!("{size}, within {target}"), &[("size", &size), ("target", &target)])
} else {
crate::i18n::fmt(tl!("No setting tried fits in {target}; the smallest is {size}"), &[("size", &size), ("target", &target)])
};
widgets::label_row(ui, "", LABEL_W, |ui| {
widgets::dim_label(ui, &text);
});
}
}
/// An Enter while the Optimize to File Size rows ([`optimize_rows`]) are open is their OK: it does
/// not save. Run after every control of the dialog has drawn, it runs the search unless a control
/// took the press (an open dropdown), a field refused the value typed in it, or Ctrl, Cmd or Alt was
/// held, which the size field does not commit.
pub(super) fn optimize_on_enter(ctx: &egui::Context, d: &mut Dialog) {
if !d.fields.contains_key("__optimizeK") || !crate::shortcuts::pressed_anew(ctx, egui::Key::Enter) {
return;
}
let held = ctx.input(|i| {
i.events.iter().any(|e| matches!(e, egui::Event::Key { key: egui::Key::Enter, pressed: true, modifiers, .. } if modifiers.ctrl || modifiers.command || modifiers.alt))
});
let refused = ctx.data(|m| m.get_temp::<bool>(widgets::dialog_reject_commit_flag())).unwrap_or(false);
widgets::reject_dialog_commit(ctx);
if !held && !refused {
d.fields.insert("__optimizeGo".into(), json!(true));
ctx.request_repaint();
}
}
/// The last Optimize to File Size result (`__optimized`) while it still holds: the settings are the
/// ones it found and the art (`art`, from [`art_key`]) is the art it measured.
pub(super) fn optimized_result<'a>(d: &'a Dialog, s: Option<&WebSettings>, art: &str) -> Option<&'a Value> {
d.fields.get("__optimized").filter(|r| r["art"] == json!(art) && s.is_some_and(|s| r["settings"] == s.to_json()))
}
/// The active document, its revision and its selected objects and slices, which an Optimize to File
/// Size result was measured on. The selection decides the slices Save writes with `slices: selected`
/// and the slice Current Slice measures, and a selection made on the canvas or with the Slice
/// Selection tool leaves the revision as it is.
pub(super) fn art_key(app: &VectorcraftApp) -> String {
app.session.active().map_or_else(String::new, |st| format!("{}:{}:{:?}:{:?}", st.uid, st.revision, st.selection.objects, st.selection.slices))
}
/// `bytes` in K, rounded up to the Desired File Size field's 0.001 K so the size it asks for holds
/// them. The product is taken in `u128`, which holds any `usize` times 1000 on every target.
pub(super) fn size_k(bytes: usize) -> f64 {
(bytes as u128 * 1000).div_ceil(1024).max(1) as f64 / 1000.0
}
/// Optimize to File Size… (`__optimizeOpen`): opens the rows with Current Settings and Total of All
/// Slices, the desired size starting at the size the current settings give what that Use measures:
/// the image slices' files together when there are slices, else the preview's file (32 K when it
/// cannot be measured).
fn open_optimize_rows(app: &mut VectorcraftApp, ui: &egui::Ui, d: &mut Dialog) {
let bytes = if d.bool("__hasSlices") {
let mut p = params(d);
if let Some(o) = p.as_object_mut() {
o.insert("desiredK".into(), json!(webexport::MAX_DESIRED_K));
o.insert("use".into(), json!("allSlices"));
}
let r = app.run("webExport.optimizeToFileSize", p).ok();
r.filter(|r| r["achieved"] == json!(true)).and_then(|r| r["bytes"].as_u64()).map(|b| b as usize)
} else {
settings_of(app, d).ok().and_then(|s| previewed_bytes(app, ui, &s))
};
let k = bytes.map_or(32.0, size_k);
d.fields.insert("__optimizeK".into(), json!(k));
d.fields.insert("__optimizeStart".into(), json!("current"));
d.fields.insert("__optimizeUse".into(), json!("allSlices"));
}
/// Optimize to File Size's OK: `webExport.optimizeToFileSize` with the dialog's settings and the
/// rows' values; the settings it finds replace the dialog's, the rows close and `__optimized`
/// keeps the result. An error leaves the settings and the rows as they are.
pub(super) fn optimize_to_size(app: &mut VectorcraftApp, d: &mut Dialog) -> Result<Value, String> {
let mut p = params(d);
if let Some(o) = p.as_object_mut() {
o.insert("desiredK".into(), d.fields.get("__optimizeK").cloned().unwrap_or(Value::Null));
let start = d.str("__optimizeStart");
if !start.is_empty() {
o.insert("startWith".into(), json!(start));
}
let scope = d.str("__optimizeUse");
if d.bool("__hasSlices") && !scope.is_empty() {
o.insert("use".into(), json!(scope));
}
}
let r = app.run("webExport.optimizeToFileSize", p)?;
if let Some(found) = r["settings"].as_object() {
d.fields.extend(found.clone());
}
for k in OPTIMIZE_FIELDS {
d.fields.remove(k);
}
let result =
json!({ "settings": r["settings"], "bytes": r["bytes"], "targetBytes": r["targetBytes"], "achieved": r["achieved"], "art": art_key(app) });
d.fields.insert("__optimized".into(), result);
Ok(r)
}
/// Two checkboxes side by side.
fn check_pair(ui: &mut egui::Ui, d: &mut Dialog, (a, a_label): (&str, &str), (b, b_label): (&str, &str)) {
widgets::label_row(ui, "", LABEL_W, |ui| {
+88
View File
@@ -422,6 +422,54 @@ fn a_scale_set_through_the_dialog_keeps_the_percentage_it_changes() {
assert_eq!(saved["scale"], json!({"width": 250.0, "height": 250.0, "linked": true}));
}
/// An accessibility action on the node `target_node`.
fn request(action: egui::accesskit::Action, target_node: egui::accesskit::NodeId) -> egui::Event {
use egui::accesskit::{ActionRequest, TreeId};
egui::Event::AccessKitActionRequest(ActionRequest { action, target_node, target_tree: TreeId::ROOT, data: None })
}
/// Type `typed` into Scale W, which shows `shown` (the first field that does, before H), and Tab out.
fn type_w(screen: &mut Screen, app: &mut VectorcraftApp, shown: &str, typed: &str) {
let key = |key, modifiers| egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers };
screen.run(app, vec![]);
let out = screen.run(app, vec![]);
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
let w = nodes.iter().find(|(_, n)| n.role() == egui::accesskit::Role::TextInput && n.value().is_some_and(|v| v.starts_with(shown)));
screen.run(app, vec![request(egui::accesskit::Action::Focus, w.expect("the Scale W field").0)]);
screen.run(app, vec![key(egui::Key::A, egui::Modifiers::COMMAND), egui::Event::Text(typed.into())]);
screen.run(app, vec![key(egui::Key::Tab, egui::Modifiers::NONE)]);
}
#[test]
fn a_scale_set_after_a_typed_percentage_follows_the_link() {
let (mut app, _) = app();
app.run("file.print", json!({})).unwrap();
let mut screen = Screen::new();
set(&mut app, "scaling", json!("custom"));
dialog(&mut app).fields["scale"]["width"] = json!(40);
screen.run(&mut app, vec![]);
assert_eq!(scale(&mut app), (40.0, 40.0, true));
// W typed with the link on sets H as well.
type_w(&mut screen, &mut app, "40", "60");
assert_eq!(scale(&mut app), (60.0, 60.0, true));
// A new H set before the next frame: W follows it, and Done saves both.
dialog(&mut app).fields["scale"]["height"] = json!(50);
set(&mut app, "discard", json!(true));
super::confirm(&mut app).unwrap();
let saved = app.session.active().unwrap().doc.print_setup.clone().unwrap();
assert_eq!(saved["scale"], json!({"width": 50.0, "height": 50.0, "linked": true}));
// W typed with the link off changes W alone; turning the link on then sets H to W.
app.run("file.print", json!({})).unwrap();
let (link, _, _) = screen.link(&mut app);
screen.run(&mut app, vec![request(egui::accesskit::Action::Click, link)]);
assert_eq!(scale(&mut app), (50.0, 50.0, false));
type_w(&mut screen, &mut app, "50", "70");
assert_eq!(scale(&mut app), (70.0, 50.0, false));
screen.run(&mut app, vec![request(egui::accesskit::Action::Click, link)]);
screen.run(&mut app, vec![]);
assert_eq!(scale(&mut app), (70.0, 70.0, true));
}
#[test]
fn the_dimmed_scale_link_ignores_the_keyboard() {
use egui::accesskit::{Action, ActionRequest, TreeId};
@@ -440,3 +488,43 @@ fn the_dimmed_scale_link_ignores_the_keyboard() {
screen.run(&mut app, vec![]);
assert_eq!(scale(&mut app), (100.0, 100.0, true));
}
/// The node screen readers call `label` with role `role`, and whether it is dimmed.
fn node(screen: &mut Screen, app: &mut VectorcraftApp, label: &str, role: egui::accesskit::Role) -> Option<(egui::accesskit::NodeId, bool)> {
screen.run(app, vec![]);
let out = screen.run(app, vec![]);
let nodes = &out.platform_output.accesskit_update.as_ref().expect("an accessibility tree").nodes;
nodes.iter().find(|(_, n)| n.label() == Some(label) && n.role() == role).map(|(id, n)| (*id, n.is_disabled()))
}
#[test]
fn a_spot_inks_icon_converts_it_to_process_and_back() {
use egui::accesskit::{Action, ActionRequest, Role, TreeId};
let (mut app, _) = app();
app.run("swatch.new", json!({"name": "Gold", "color": {"model": "cmyk", "c": 0, "m": 0.2, "y": 0.8, "k": 0.1}, "spot": true})).unwrap();
app.run("file.print", json!({})).unwrap();
set(&mut app, "__section", json!("Output"));
set(&mut app, "output", json!({"mode": "separations"}));
let mut screen = Screen::new();
let click = |target_node| {
egui::Event::AccessKitActionRequest(ActionRequest { action: Action::Click, target_node, target_tree: TreeId::ROOT, data: None })
};
// Only the spot ink has the icon.
assert!(node(&mut screen, &mut app, "Convert Cyan to process", Role::Button).is_none());
let (convert, dimmed) = node(&mut screen, &mut app, "Convert Gold to process", Role::Button).expect("Gold's icon");
assert!(!dimmed);
assert_eq!(node(&mut screen, &mut app, "Gold", Role::CheckBox).map(|n| n.1), Some(false));
screen.run(&mut app, vec![click(convert)]);
assert_eq!(dialog(&mut app).fields["output"]["inks"], json!([{"name": "Gold", "print": true, "convertToProcess": true}]));
// Converted, it has no plate: its Print box is dimmed, and the icon turns it back.
assert_eq!(node(&mut screen, &mut app, "Gold", Role::CheckBox).map(|n| n.1), Some(true));
let (keep, _) = node(&mut screen, &mut app, "Keep Gold as spot", Role::Button).expect("the process icon");
screen.run(&mut app, vec![click(keep)]);
assert_eq!(dialog(&mut app).fields["output"]["inks"], json!([{"name": "Gold", "print": true, "convertToProcess": false}]));
// Convert All Spot Colors to Process converts it and dims the icon, keeping its own choice.
dialog(&mut app).fields["output"]["spotsToProcess"] = json!(true);
let (keep, dimmed) = node(&mut screen, &mut app, "Keep Gold as spot", Role::Button).expect("the process icon");
assert!(dimmed);
screen.run(&mut app, vec![click(keep)]);
assert_eq!(dialog(&mut app).fields["output"]["inks"], json!([{"name": "Gold", "print": true, "convertToProcess": false}]));
}
@@ -726,3 +726,192 @@ fn colour_table_buttons_edit_the_lists() {
save_for_web::set_table(&mut d, "sort", json!("hue"));
assert_eq!(d.fields["colorTable"], json!({"locked": [], "webShift": ["#123456"], "sort": "hue"}));
}
#[test]
fn optimize_to_file_size_takes_the_settings_that_fit() {
let dir = vectorcraft_testkit::temp_dir("sfw-optimize");
let (mut app, _) = app(&dir, false);
app.run("file.saveForWeb", json!({})).unwrap();
set(&mut app, "format", json!("jpg"));
set(&mut app, "quality", json!(100));
frame(&mut app);
let full = app.session.execute("document.exportForWeb.preview", &json!({"format": "jpg", "quality": 100})).unwrap()["bytes"].as_u64().unwrap();
let field = |app: &VectorcraftApp, k: &str| app.ui.dialog.as_ref().unwrap().fields.get(k).cloned();
// A size of 0 is refused: the settings and the rows stay.
set(&mut app, "__optimizeK", json!(0));
set(&mut app, "__optimizeStart", json!("current"));
set(&mut app, "__optimizeGo", json!(true));
frame(&mut app);
assert_eq!(field(&app, "quality"), Some(json!(100)));
assert_eq!(field(&app, "__optimizeK"), Some(json!(0)));
assert_eq!((field(&app, "__optimized"), field(&app, "__optimizeGo")), (None, None));
// OK takes the settings found and closes the rows.
set(&mut app, "__optimizeK", json!(full as f64 * 0.8 / 1024.0));
set(&mut app, "__optimizeGo", json!(true));
frame(&mut app);
let found = field(&app, "__optimized").unwrap();
assert_eq!(found["achieved"], json!(true), "{found}");
let quality = field(&app, "quality").unwrap().as_u64().unwrap();
assert!(quality < 100, "{found}");
assert_eq!(field(&app, "__optimizeK"), None);
// The result holds for the settings found on the art it measured.
let settings = app.session.web_settings(&found["settings"]).unwrap();
let shown = |app: &VectorcraftApp| {
save_for_web::optimized_result(app.ui.dialog.as_ref().unwrap(), Some(&settings), &save_for_web::art_key(app)).is_some()
};
assert!(shown(&app));
// The result line draws, and Save writes the size found.
frame(&mut app);
let r = confirm(&mut app).unwrap();
let written = std::fs::read(r["path"].as_str().unwrap()).unwrap();
assert_eq!(written.len() as u64, found["bytes"].as_u64().unwrap());
assert!(written.len() as u64 <= found["targetBytes"].as_u64().unwrap());
assert_eq!(app.session.last_web_settings().quality as u64, quality);
// A change to the art drops the result.
app.run("file.saveForWeb", json!({})).unwrap();
app.ui.dialog.as_mut().unwrap().fields.insert("__optimized".into(), found.clone());
assert!(shown(&app));
app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 5, "height": 5})).unwrap();
assert!(!shown(&app));
// So does a change to the selection, which decides the slices Save writes with `slices: selected`,
// also one that leaves the revision as it is (a click on the canvas).
let mut current = found.clone();
current["art"] = json!(save_for_web::art_key(&app));
app.ui.dialog.as_mut().unwrap().fields.insert("__optimized".into(), current);
assert!(shown(&app));
let st = app.session.active_mut().unwrap();
assert!(!st.selection.objects.is_empty());
st.selection.objects.clear();
assert!(!shown(&app));
// And a change to the selected slices alone (the Slice Selection tool).
let mut current = found.clone();
current["art"] = json!(save_for_web::art_key(&app));
app.ui.dialog.as_mut().unwrap().fields.insert("__optimized".into(), current);
assert!(shown(&app));
let st = app.session.active_mut().unwrap();
let any = st.doc.layers[0].id;
st.selection.slices.push(any);
assert!(!shown(&app));
}
/// Enter while the Optimize to File Size rows are open runs the search and writes nothing; once the
/// search has closed the rows, Enter saves with the settings it found.
#[test]
fn enter_in_the_optimize_rows_runs_the_search_and_saves_nothing() {
let dir = vectorcraft_testkit::temp_dir("sfw-optimize-enter");
let (mut app, _) = app(&dir, false);
app.run("file.saveForWeb", json!({})).unwrap();
set(&mut app, "format", json!("jpg"));
set(&mut app, "quality", json!(100));
frame(&mut app);
let full = app.session.execute("document.exportForWeb.preview", &json!({"format": "jpg", "quality": 100})).unwrap()["bytes"].as_u64().unwrap();
set(&mut app, "__optimizeK", json!(full as f64 * 0.8 / 1024.0));
set(&mut app, "__optimizeStart", json!("current"));
let files = |dir: &std::path::Path| std::fs::read_dir(dir).map_or(0, |r| r.count());
let enter_with = |app: &mut VectorcraftApp, modifiers: egui::Modifiers| {
let key = egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers };
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let mut out = ctx.run_ui(egui::RawInput { events: vec![key], ..Default::default() }, |ui| show(app, ui.ctx()));
out.textures_delta.clear();
};
let enter = |app: &mut VectorcraftApp| enter_with(app, egui::Modifiers::NONE);
// Ctrl+Enter, which the size field does not commit, neither searches nor saves.
enter_with(&mut app, egui::Modifiers::CTRL);
frame(&mut app);
assert_eq!(kind(&app), Some(save_for_web::KIND), "Ctrl+Enter in the rows does not save");
assert!(app.ui.dialog.as_ref().unwrap().fields.contains_key("__optimizeK"), "the rows stay open");
assert!(!app.ui.dialog.as_ref().unwrap().fields.contains_key("__optimized"));
assert_eq!(files(&dir), 0);
enter(&mut app);
assert_eq!(kind(&app), Some(save_for_web::KIND), "Enter in the rows does not save");
assert_eq!(files(&dir), 0);
frame(&mut app);
let d = app.ui.dialog.as_ref().unwrap();
let found = d.fields.get("__optimized").cloned().unwrap();
assert_eq!(found["achieved"], json!(true), "{found}");
assert!(!d.fields.contains_key("__optimizeK"), "the search closed the rows");
enter(&mut app);
assert!(app.ui.dialog.is_none());
assert_eq!(files(&dir), 1);
}
/// An Enter in the Optimize to File Size rows runs no search when a field of the dialog, one drawn
/// after the rows included, refused the value typed in it on that press, or when a control drawn
/// after the rows (an open dropdown) took the press.
#[test]
fn enter_in_the_optimize_rows_runs_nothing_when_a_later_control_refused_or_took_it() {
// `before` stands for the controls drawn after the rows, which act on the press first.
let go = |before: fn(&egui::Context)| {
let mut d = Dialog::new(save_for_web::KIND, json!({"__optimizeK": 10}));
let key = egui::Event::Key { key: egui::Key::Enter, physical_key: None, pressed: true, repeat: false, modifiers: Default::default() };
let ctx = egui::Context::default();
let mut out = ctx.run_ui(egui::RawInput { events: vec![key], ..Default::default() }, |ui| {
before(ui.ctx());
save_for_web::optimize_on_enter(ui.ctx(), &mut d);
});
out.textures_delta.clear();
assert!(d.fields.contains_key("__optimizeK"), "the rows stay open");
d.fields.contains_key("__optimizeGo")
};
assert!(go(|_| {}), "a plain Enter runs the search");
assert!(!go(crate::widgets::reject_dialog_commit), "a refused value runs nothing");
assert!(!go(|ctx| ctx.input_mut(|i| _ = i.consume_key(egui::Modifiers::NONE, egui::Key::Enter))), "a taken press runs nothing");
}
#[test]
fn optimize_to_file_size_starts_at_the_size_of_the_slices_files() {
let dir = vectorcraft_testkit::temp_dir("sfw-optimize-slices");
let (mut app, _) = app(&dir, false);
app.run("object.slice.create", json!({"x": 0, "y": 0, "width": 30, "height": 20})).unwrap();
app.run("file.saveForWeb", json!({})).unwrap();
set(&mut app, "format", json!("png24"));
frame(&mut app);
let slices = app.session.execute("webExport.optimizeToFileSize", &json!({"format": "png24", "desiredK": 1048576})).unwrap();
let whole = app.session.execute("document.exportForWeb.preview", &json!({"format": "png24"})).unwrap()["bytes"].as_u64().unwrap();
let k = |b: u64| json!(save_for_web::size_k(b as usize));
assert_ne!(k(slices["bytes"].as_u64().unwrap()), k(whole), "{slices}");
// The size asked for holds the files measured.
let b = slices["bytes"].as_u64().unwrap();
assert!((save_for_web::size_k(b as usize) * 1024.0).floor() as u64 >= b);
set(&mut app, "__optimizeOpen", json!(true));
frame(&mut app);
let d = app.ui.dialog.as_ref().unwrap();
assert_eq!(d.fields.get("__optimizeK"), Some(&k(slices["bytes"].as_u64().unwrap())));
assert_eq!((d.fields.get("__optimizeUse"), d.fields.get("__optimizeOpen")), (Some(&json!("allSlices")), None));
}
#[test]
fn optimize_to_file_size_starts_at_the_size_of_the_art_as_it_is_now() {
let dir = vectorcraft_testkit::temp_dir("sfw-optimize-revision");
let (mut app, _) = app(&dir, false);
// One context for every frame, so the preview cache of the first frame is still there.
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let frame = |app: &mut VectorcraftApp| ctx.run_ui(Default::default(), |ui| show(app, ui.ctx())).textures_delta.clear();
app.run("file.saveForWeb", json!({})).unwrap();
set(&mut app, "format", json!("png24"));
frame(&mut app);
let bytes = |app: &mut VectorcraftApp| {
app.session.execute("document.exportForWeb.preview", &json!({"format": "png24"})).unwrap()["bytes"].as_u64().unwrap()
};
let before = bytes(&mut app);
// The art changes after the preview drew and before the button's click is handled.
app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 60, "height": 40})).unwrap();
app.run("paint.setFill", json!({"color": "#3366ff"})).unwrap();
let after = bytes(&mut app);
assert_ne!(save_for_web::size_k(before as usize), save_for_web::size_k(after as usize));
set(&mut app, "__optimizeOpen", json!(true));
frame(&mut app);
let d = app.ui.dialog.as_ref().unwrap();
assert_eq!(d.fields.get("__optimizeK"), Some(&json!(save_for_web::size_k(after as usize))));
}
#[test]
fn size_in_k_holds_sizes_past_4_mib_on_every_target() {
assert_eq!(save_for_web::size_k(5 * 1024 * 1024), 5120.0);
assert_eq!(save_for_web::size_k(0), 0.001);
assert_eq!(save_for_web::size_k(1), 0.001);
// The largest size a target can hold still rounds up to a size that holds it.
assert!(save_for_web::size_k(usize::MAX) * 1024.0 >= usize::MAX as f64 * 0.999);
}
+19
View File
@@ -603,6 +603,8 @@ font-technology Variable Променливи
Control Контрол
Convert Конвертиране
Convert All Spot Colors to Process Конвертиране на всички спот цветове в трихромни
Convert {name} to process Конвертиране на {name} в трихромен
Keep {name} as spot Запазване на {name} като спот
Convert All Strokes to Outlines Конвертиране на всички щрихове в контури
Convert All Text to Outlines Конвертиране на целия текст в контури
Convert Anchor Point Преобразуване на опорна точка
@@ -2635,6 +2637,18 @@ font-technology Variable Променливи
Preview: Преглед:
Preview All Layers Преглед на всички слоеве
Preview in Browser Преглед в браузър
Optimize to File Size… Оптимизиране до размер на файла…
Optimize to File Size Оптимизиране до размер на файла
Desired File Size: Желан размер на файла:
Start With: Начало с:
Use: Използване:
Current Settings Текущи настройки
Auto Select GIF/JPEG Автоматичен избор на GIF/JPEG
Total of All Slices Общо за всички откъси
Each Slice Всеки откъс
Current Slice Текущ откъс
{size}, within {target} {size}, в рамките на {target}
No setting tried fits in {target}; the smallest is {size} Никоя изпробвана настройка не се побира в {target}; най-малкият размер е {size}
Preview in Browser needs the desktop app (the web downloads files instead) Прегледът в браузър изисква настолното приложение (уеб версията изтегля файловете вместо това)
Preview Mode Режим на преглед
Preview the document as it is now Преглед на документа в текущия му вид
@@ -4376,6 +4390,11 @@ axis Both И двете
@msg PDF writer error: {0} Грешка на PDF записа: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Пакетиран е {n} файл в {folder} ({note})|Пакетирани са {n} файла в {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Прегледът в браузър изисква настолното приложение (уеб версията изтегля файловете вместо това)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 задайте `desiredK`, желания размер на файла в K (1024 байта): число над 0 и най-много 1048576
@msg `startWith` is `current` or `auto` `startWith` е `current` или `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` е `allSlices`, `eachSlice` или `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` е номер на откъс от `slice.list`, заедно с `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Оптимизиране до размер на файла: няма изображение за измерване
@msg Release Guides: no guides Освобождаване на водачи: няма водачи
@msg Release: no layer to put the rectangle in Освобождаване: няма слой, в който да се постави правоъгълникът
@msg Replace Spine: select a blend and a path Замяна на оста: изберете плавно преливане и път
Can't render this file because it is too large.
+19
View File
@@ -1170,6 +1170,18 @@ lighting Light Svjetlo
Placement Options… Opcije postavljanja…
Plug-in… Dodatak…
Preview in Browser Pregledaj u pregledniku
Optimize to File Size… Optimiziraj na veličinu datoteke…
Optimize to File Size Optimiziraj na veličinu datoteke
Desired File Size: Željena veličina datoteke:
Start With: Počni sa:
Use: Koristi:
Current Settings Trenutne postavke
Auto Select GIF/JPEG Automatski odaberi GIF/JPEG
Total of All Slices Ukupno svih isječaka
Each Slice Svaki isječak
Current Slice Trenutni isječak
{size}, within {target} {size}, unutar {target}
No setting tried fits in {target}; the smallest is {size} Nijedna isprobana postavka ne stane u {target}; najmanja je {size}
Printer Setup… Podešavanje štampača…
Printers Štampači
Recent File Nedavna datoteka
@@ -2844,6 +2856,8 @@ digits Malayalam Malajalam
Collate Složi po kopijama
Composite colours are converted to it; separations separate with it when it is a CMYK profile. Kompozitne boje se pretvaraju u njega; separacije se razdvajaju njime kad je CMYK profil.
Convert All Spot Colors to Process Pretvori sve spot boje u procesne
Convert {name} to process Pretvori {name} u procesnu
Keep {name} as spot Zadrži {name} kao spot
Overprint Black Pretisak crne
Default Printer Zadani štampač
Document Ink Options Opcije tinti dokumenta
@@ -4754,6 +4768,11 @@ imageTrace Outline Obris
@msg PDF writer error: {0} greška PDF zapisivača: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Upakovano datoteka u {folder}: {n} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Pregledaj u pregledniku zahtijeva desktop aplikaciju (web umjesto toga preuzima datoteke)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 navedite `desiredK`, željenu veličinu datoteke u K (1024 bajta): broj veći od 0 i najviše 1048576
@msg `startWith` is `current` or `auto` `startWith` je `current` ili `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` je `allSlices`, `eachSlice` ili `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` je broj isječka iz `slice.list`, uz `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimiziraj na veličinu datoteke: nema slike za mjerenje
@msg Release Guides: no guides Oslobodi vodilice: nema vodilica
@msg Release: no layer to put the rectangle in Oslobodi: nema sloja u koji bi se stavio pravougaonik
@msg Replace Spine: select a blend and a path Zamijeni kičmu: odaberite stapanje i putanju
Can't render this file because it contains an unexpected character in line 2 and column 73.
+19
View File
@@ -897,6 +897,8 @@ antiAlias Sharp Nítid
Conté Crayon… Llapis Conté…
Convert Converteix
Convert All Spot Colors to Process Converteix tots els colors directes a quadricromia
Convert {name} to process Converteix {name} a quadricromia
Keep {name} as spot Mantén {name} com a color directe
Convert All Strokes to Outlines Converteix tots els traços en contorns
Convert All Text to Outlines Converteix tot el text en contorns
Convert Anchor Point Converteix el punt d’ancoratge
@@ -3423,6 +3425,18 @@ digits Malayalam Malaiàlam
Preview (1 inch on the page) Previsualització (1 polzada a la pàgina)
Preview All Layers Previsualitza totes les capes
Preview in Browser Previsualitza al navegador
Optimize to File Size… Optimitza segons la mida del fitxer…
Optimize to File Size Optimitza segons la mida del fitxer
Desired File Size: Mida de fitxer desitjada:
Start With: Comença amb:
Use: Utilitza:
Current Settings Configuració actual
Auto Select GIF/JPEG Selecció automàtica GIF/JPEG
Total of All Slices Total de tots els talls
Each Slice Cada tall
Current Slice Tall actual
{size}, within {target} {size}, dins de {target}
No setting tried fits in {target}; the smallest is {size} Cap configuració provada no cap a {target}; la més petita és {size}
Preview in Browser needs the desktop app (the web downloads files instead) La previsualització al navegador necessita l’aplicació d’escriptori (al web, en canvi, es descarreguen els fitxers)
Preview Mode Mode de previsualització
Preview the document as it is now Previsualitza el document tal com és ara
@@ -6326,6 +6340,11 @@ liquify-list-end {0}, {1} {0} i {1}
@msg plug-in trapped: {0} el complement ha quedat atrapat: {0}
@msg precision must be from 0.001 to 10 pt precision ha de ser d’entre 0,001 i 10 pt
@msg Preview in Browser needs the desktop app (the web downloads files instead) La previsualització al navegador necessita l’aplicació d’escriptori (a la web es baixen els fitxers)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 indica `desiredK`, la mida de fitxer desitjada en K (1024 bytes): un nombre més gran que 0 i com a màxim 1048576
@msg `startWith` is `current` or `auto` `startWith` és `current` o `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` és `allSlices`, `eachSlice` o `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` és un número de tall de `slice.list`, amb `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimitza segons la mida del fitxer: no hi ha cap imatge per mesurar
@msg print settings are not an object la configuració d’impressió no és un objecte
@msg printing isn't available here la impressió no està disponible aquí
@msg range `{s}` is empty el rang `{s}` és buit
Can't render this file because it contains an unexpected character in line 2 and column 73.
+19
View File
@@ -1194,6 +1194,18 @@ lighting Light Světlo
Placement Options… Možnosti umístění…
Plug-in… Zásuvný modul…
Preview in Browser Náhled v prohlížeči
Optimize to File Size… Optimalizovat na velikost souboru…
Optimize to File Size Optimalizovat na velikost souboru
Desired File Size: Požadovaná velikost souboru:
Start With: Začít s:
Use: Použít:
Current Settings Aktuální nastavení
Auto Select GIF/JPEG Automaticky vybrat GIF/JPEG
Total of All Slices Součet všech řezů
Each Slice Každý řez
Current Slice Aktuální řez
{size}, within {target} {size}, v rámci {target}
No setting tried fits in {target}; the smallest is {size} Žádné vyzkoušené nastavení se nevejde do {target}; nejmenší má {size}
Printer Setup… Nastavení tiskárny…
Printers Tiskárny
Recent File Nedávný soubor
@@ -2928,6 +2940,8 @@ digits Malayalam Malajálamské
Collate Kompletovat
Composite colours are converted to it; separations separate with it when it is a CMYK profile. Kompozitní barvy se na něj převádějí; separace podle něj separují, pokud je to profil CMYK.
Convert All Spot Colors to Process Převést všechny přímé barvy na procesní
Convert {name} to process Převést {name} na procesní
Keep {name} as spot Ponechat {name} jako přímou barvu
Default Printer Výchozí tiskárna
Document Ink Options Možnosti inkoustů dokumentu
Download: Stahování:
@@ -5010,6 +5024,11 @@ liquify-list-end {0}, {1} {0} a {1}
@msg PDF writer error: {0} chyba zápisu PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Zabalen {n} soubor do {folder} ({note})|Zabaleny {n} soubory do {folder} ({note})|Zabaleno {n} souborů do {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Náhled v prohlížeči vyžaduje desktopovou aplikaci (webová verze místo toho stahuje soubory)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 zadejte `desiredK`, požadovanou velikost souboru v K (1024 bajtů): číslo větší než 0 a nejvýše 1048576
@msg `startWith` is `current` or `auto` `startWith` je `current` nebo `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` je `allSlices`, `eachSlice` nebo `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` je číslo řezu ze `slice.list`, s `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimalizovat na velikost souboru: není žádný obraz k měření
@msg Release Guides: no guides Uvolnit vodítka: žádná vodítka
@msg Release: no layer to put the rectangle in Uvolnit: chybí vrstva, do které by šel obdélník umístit
@msg Replace Spine: select a blend and a path Nahradit páteř: vyberte prolnutí a cestu
Can't render this file because it is too large.
+19
View File
@@ -3791,6 +3791,18 @@ lighting Light Lys
Placement Options… Placeringsindstillinger…
Plug-in… Plug-in…
Preview in Browser Forhåndsvis i browser
Optimize to File Size… Optimer til filstørrelse…
Optimize to File Size Optimer til filstørrelse
Desired File Size: Ønsket filstørrelse:
Start With: Start med:
Use: Brug:
Current Settings Aktuelle indstillinger
Auto Select GIF/JPEG Vælg GIF/JPEG automatisk
Total of All Slices Alle udsnit i alt
Each Slice Hvert udsnit
Current Slice Aktuelt udsnit
{size}, within {target} {size}, inden for {target}
No setting tried fits in {target}; the smallest is {size} Ingen afprøvet indstilling passer i {target}; den mindste er {size}
Printer Setup… Printeropsætning…
Printers Printere
Recent File Seneste fil
@@ -5396,6 +5408,8 @@ digits Malayalam Malayalam
Collate Sortér
Composite colours are converted to it; separations separate with it when it is a CMYK profile. Kompositfarver konverteres til den; separationer separeres med den, når det er en CMYK-profil.
Convert All Spot Colors to Process Konvertér alle spotfarver til procesfarver
Convert {name} to process Konvertér {name} til procesfarve
Keep {name} as spot Behold {name} som spotfarve
Default Printer Standardprinter
Document Ink Options Indstillinger for dokumentblæk
Download: Download:
@@ -7241,6 +7255,11 @@ imageTrace Outline Kontur
@msg PDF writer error: {0} PDF-skriverfejl: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Pakkede {n} fil i {folder} ({note})|Pakkede {n} filer i {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Forhåndsvisning i browser kræver skrivebordsappen (webversionen downloader filer i stedet)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 angiv `desiredK`, den ønskede filstørrelse i K (1024 byte): et tal over 0 og højst 1048576
@msg `startWith` is `current` or `auto` `startWith` er `current` eller `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` er `allSlices`, `eachSlice` eller `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` er et udsnitsnummer fra `slice.list`, med `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimer til filstørrelse: der er intet billede at måle
@msg Release Guides: no guides Frigiv hjælpelinjer: ingen hjælpelinjer
@msg Release: no layer to put the rectangle in Frigiv: intet lag at lægge rektanglet i
@msg Replace Spine: select a blend and a path Erstat rygrad: markér en blanding og en kurve
Can't render this file because it is too large.
+19
View File
@@ -598,6 +598,8 @@ font-technology Variable Variabel
Control Steuerung
Convert Konvertieren
Convert All Spot Colors to Process Alle Volltonfarben in Prozessfarben konvertieren
Convert {name} to process {name} in Prozessfarbe konvertieren
Keep {name} as spot {name} als Volltonfarbe beibehalten
Convert All Strokes to Outlines Alle Konturen in Pfade umwandeln
Convert All Text to Outlines Gesamten Text in Pfade umwandeln
Convert Anchor Point Ankerpunkt umwandeln
@@ -2683,6 +2685,18 @@ diagnostics ui Oberfläche
Preview: Vorschau:
Preview All Layers Vorschau aller Ebenen
Preview in Browser Vorschau im Browser
Optimize to File Size… Auf Dateigröße optimieren…
Optimize to File Size Auf Dateigröße optimieren
Desired File Size: Gewünschte Dateigröße:
Start With: Beginnen mit:
Use: Verwenden:
Current Settings Aktuelle Einstellungen
Auto Select GIF/JPEG GIF/JPEG automatisch wählen
Total of All Slices Summe aller Slices
Each Slice Jedes Slice
Current Slice Aktuelles Slice
{size}, within {target} {size}, innerhalb von {target}
No setting tried fits in {target}; the smallest is {size} Keine getestete Einstellung passt in {target}; die kleinste ist {size}
Preview in Browser needs the desktop app (the web downloads files instead) „Vorschau im Browser“ erfordert die Desktop-App (im Web werden stattdessen Dateien heruntergeladen)
Preview Mode Vorschaumodus
Preview the document as it is now Vorschau des Dokuments im aktuellen Zustand
@@ -4610,6 +4624,11 @@ liquify-list-end {0}, {1} {0} und {1}
@msg PDF writer error: {0} Fehler beim Schreiben der PDF-Datei: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} {n} Datei in {folder} verpackt ({note})|{n} Dateien in {folder} verpackt ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) „Vorschau im Browser“ erfordert die Desktop-App (im Web werden stattdessen Dateien heruntergeladen)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 Geben Sie `desiredK` an, die gewünschte Dateigröße in K (1024 Byte): eine Zahl über 0 und höchstens 1048576
@msg `startWith` is `current` or `auto` `startWith` ist `current` oder `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` ist `allSlices`, `eachSlice` oder `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` ist eine Slice-Nummer aus `slice.list`, mit `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Auf Dateigröße optimieren: Es gibt kein Bild zum Messen
@msg Release Guides: no guides Hilfslinien zurückwandeln: keine Hilfslinien
@msg Release: no layer to put the rectangle in Zurückwandeln: keine Ebene, die das Rechteck aufnehmen könnte
@msg Replace Spine: select a blend and a path Achse ersetzen: Wählen Sie eine Angleichung und einen Pfad aus
Can't render this file because it is too large.
+19
View File
@@ -577,6 +577,8 @@ font-technology Variable Μεταβλητές
Control Έλεγχος
Convert Μετατροπή
Convert All Spot Colors to Process Μετατροπή όλων των πλακάτων χρωμάτων σε χρώματα τετραχρωμίας
Convert {name} to process Μετατροπή του {name} σε χρώμα τετραχρωμίας
Keep {name} as spot Διατήρηση του {name} ως πλακάτου χρώματος
Convert All Strokes to Outlines Μετατροπή όλων των περιγραμμάτων σε διαδρομές
Convert All Text to Outlines Μετατροπή όλου του κειμένου σε περιγράμματα
Convert Anchor Point Μετατροπή σημείου αγκύρωσης
@@ -2662,6 +2664,11 @@ liquify-list-end {0}, {1} {0} και {1}
@msg PDF writer error: {0} Σφάλμα εγγραφής PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Συσκευάστηκε {n} αρχείο στον φάκελο {folder} ({note})|Συσκευάστηκαν {n} αρχεία στον φάκελο {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Η προεπισκόπηση σε πρόγραμμα περιήγησης απαιτεί την εφαρμογή υπολογιστή (η έκδοση ιστού πραγματοποιεί λήψη αρχείων)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 δώστε `desiredK`, το επιθυμητό μέγεθος αρχείου σε K (1024 byte): αριθμό πάνω από 0 και το πολύ 1048576
@msg `startWith` is `current` or `auto` το `startWith` είναι `current` ή `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` το `use` είναι `allSlices`, `eachSlice` ή `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` το `slice` είναι αριθμός τομής από το `slice.list`, με `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Βελτιστοποίηση σε μέγεθος αρχείου: δεν υπάρχει εικόνα για μέτρηση
@msg Release Guides: no guides Αποδέσμευση οδηγών: δεν υπάρχουν οδηγοί
@msg Release: no layer to put the rectangle in Αποδέσμευση: δεν υπάρχει επίπεδο για να τοποθετηθεί το ορθογώνιο
@msg Replace Spine: select a blend and a path Αντικατάσταση κεντρικής καμπύλης: επιλέξτε ανάμειξη και διαδρομή
@@ -3571,6 +3578,18 @@ theme Appearance Εμφάνιση
Presets you save with the Save Preset button appear here. Οι προεπιλογές που αποθηκεύετε με το κουμπί Αποθήκευση προεπιλογής εμφανίζονται εδώ.
Preview All Layers Προεπισκόπηση όλων των επιπέδων
Preview in Browser Προεπισκόπηση στο πρόγραμμα περιήγησης
Optimize to File Size… Βελτιστοποίηση σε μέγεθος αρχείου…
Optimize to File Size Βελτιστοποίηση σε μέγεθος αρχείου
Desired File Size: Επιθυμητό μέγεθος αρχείου:
Start With: Έναρξη με:
Use: Χρήση:
Current Settings Τρέχουσες ρυθμίσεις
Auto Select GIF/JPEG Αυτόματη επιλογή GIF/JPEG
Total of All Slices Σύνολο όλων των τομών
Each Slice Κάθε τομή
Current Slice Τρέχουσα τομή
{size}, within {target} {size}, εντός {target}
No setting tried fits in {target}; the smallest is {size} Καμία ρύθμιση που δοκιμάστηκε δεν χωρά σε {target}· η μικρότερη είναι {size}
Preview in Browser needs the desktop app (the web downloads files instead) Η προεπισκόπηση στο πρόγραμμα περιήγησης απαιτεί την εφαρμογή υπολογιστή (στο web πραγματοποιείται λήψη αρχείων)
Preview Mode Λειτουργία προεπισκόπησης
Preview the document as it is now Προεπισκόπηση του εγγράφου στην τρέχουσα κατάστασή του
Can't render this file because it is too large.
+19
View File
@@ -618,6 +618,8 @@ font-technology Variable Variables
Control Control
Convert Convertir
Convert All Spot Colors to Process Convertir todas las tintas planas en cuatricromía
Convert {name} to process Convertir {name} en cuatricromía
Keep {name} as spot Mantener {name} como tinta plana
Convert All Strokes to Outlines Convertir todos los trazos en contornos
Convert All Text to Outlines Convertir todo el texto en contornos
Convert Anchor Point Convertir punto de ancla
@@ -2724,6 +2726,18 @@ font-technology Variable Variables
Preview: Vista previa:
Preview All Layers Previsualizar todas las capas
Preview in Browser Previsualizar en el navegador
Optimize to File Size… Optimizar según tamaño de archivo…
Optimize to File Size Optimizar según tamaño de archivo
Desired File Size: Tamaño de archivo deseado:
Start With: Empezar con:
Use: Usar:
Current Settings Ajustes actuales
Auto Select GIF/JPEG Selección automática GIF/JPEG
Total of All Slices Total de todos los sectores
Each Slice Cada sector
Current Slice Sector actual
{size}, within {target} {size}, dentro de {target}
No setting tried fits in {target}; the smallest is {size} Ningún ajuste probado cabe en {target}; el menor es {size}
Preview in Browser needs the desktop app (the web downloads files instead) Previsualizar en el navegador requiere la aplicación de escritorio (la versión web descarga los archivos)
Preview Mode Modo de vista previa
Preview the document as it is now Previsualizar el documento tal como está ahora
@@ -4714,6 +4728,11 @@ liquify-list-end {0}, {1} {0}, {1}
@msg PDF writer error: {0} error del escritor de PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Se empaquetó {n} archivo en {folder} ({note})|Se empaquetaron {n} archivos en {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Previsualizar en el navegador requiere la aplicación de escritorio (la versión web descarga los archivos)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 indica `desiredK`, el tamaño de archivo deseado en K (1024 bytes): un número mayor que 0 y como máximo 1048576
@msg `startWith` is `current` or `auto` `startWith` es `current` o `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` es `allSlices`, `eachSlice` o `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` es un número de sector de `slice.list`, con `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimizar según tamaño de archivo: no hay ninguna imagen que medir
@msg Release Guides: no guides Soltar guías: no hay guías
@msg Release: no layer to put the rectangle in Soltar: no hay ninguna capa donde poner el rectángulo
@msg Replace Spine: select a blend and a path Reemplazar eje: selecciona una fusión y un trazado
Can't render this file because it contains an unexpected character in line 2 and column 73.
+19
View File
@@ -1172,6 +1172,18 @@ lighting Light Valo
Placement Options… Sijoitusasetukset…
Plug-in… Laajennus…
Preview in Browser Esikatsele selaimessa
Optimize to File Size… Optimoi tiedostokokoon…
Optimize to File Size Optimoi tiedostokokoon
Desired File Size: Haluttu tiedostokoko:
Start With: Aloita:
Use: Käytä:
Current Settings Nykyiset asetukset
Auto Select GIF/JPEG Valitse GIF/JPEG automaattisesti
Total of All Slices Kaikki siivut yhteensä
Each Slice Jokainen siivu
Current Slice Nykyinen siivu
{size}, within {target} {size}, enintään {target}
No setting tried fits in {target}; the smallest is {size} Mikään kokeiltu asetus ei mahdu kokoon {target}; pienin on {size}
Printer Setup… Tulostimen asetukset…
Printers Tulostimet
Recent File Viimeisin tiedosto
@@ -2872,6 +2884,8 @@ digits Malayalam Malajalam
Collate Lajittele
Composite colours are converted to it; separations separate with it when it is a CMYK profile. Yhdistelmävärit muunnetaan siihen; erottelut tehdään sen mukaan, kun se on CMYK-profiili.
Convert All Spot Colors to Process Muunna kaikki spottivärit prosessiväreiksi
Convert {name} to process Muunna {name} prosessiväriksi
Keep {name} as spot Säilytä {name} spottivärinä
Default Printer Oletustulostin
Document Ink Options Asiakirjan musteasetukset
Download: Lataus:
@@ -4947,6 +4961,11 @@ liquify-list-end {0}, {1} {0} ja {1}
@msg PDF writer error: {0} PDF-kirjoittimen virhe: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Paketoitiin {n} tiedosto kansioon {folder} ({note})|Paketoitiin {n} tiedostoa kansioon {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Esikatselu selaimessa vaatii työpöytäsovelluksen (verkkoversio lataa tiedostot sen sijaan)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 anna `desiredK`, haluttu tiedostokoko yksikössä K (1024 tavua): luku, joka on yli 0 ja enintään 1048576
@msg `startWith` is `current` or `auto` `startWith` on `current` tai `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` on `allSlices`, `eachSlice` tai `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` on siivun numero luettelosta `slice.list`, kun `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimoi tiedostokokoon: mitattavaa kuvaa ei ole
@msg Release Guides: no guides Vapauta apuviivat: ei apuviivoja
@msg Release: no layer to put the rectangle in Vapauta: ei tasoa, johon suorakulmion voisi sijoittaa
@msg Replace Spine: select a blend and a path Korvaa selkäranka: valitse sulautus ja polku
Can't render this file because it contains an unexpected character in line 2 and column 73.
+19
View File
@@ -619,6 +619,8 @@ font-technology Variable Variables
Control Contrôle
Convert Convertir
Convert All Spot Colors to Process Convertir tous les tons directs en couleurs quadrichromiques
Convert {name} to process Convertir {name} en couleur quadrichromique
Keep {name} as spot Conserver {name} en ton direct
Convert All Strokes to Outlines Vectoriser tous les contours
Convert All Text to Outlines Vectoriser tout le texte
Convert Anchor Point Convertir le point d’ancrage
@@ -2712,6 +2714,18 @@ font-technology Variable Variables
Preview: Aperçu :
Preview All Layers Aperçu de tous les calques
Preview in Browser Aperçu dans le navigateur
Optimize to File Size… Optimiser selon la taille du fichier…
Optimize to File Size Optimiser selon la taille du fichier
Desired File Size: Taille de fichier souhaitée :
Start With: Commencer par :
Use: Utiliser :
Current Settings Réglages actuels
Auto Select GIF/JPEG Sélection automatique GIF/JPEG
Total of All Slices Total de toutes les tranches
Each Slice Chaque tranche
Current Slice Tranche active
{size}, within {target} {size}, dans la limite de {target}
No setting tried fits in {target}; the smallest is {size} Aucun réglage essayé ne tient dans {target}, le plus petit fait {size}
Preview in Browser needs the desktop app (the web downloads files instead) L’aperçu dans le navigateur nécessite l’application de bureau (la version web télécharge les fichiers à la place)
Preview Mode Mode Aperçu
Preview the document as it is now Afficher un aperçu du document dans son état actuel
@@ -4676,6 +4690,11 @@ liquify-list-end {0}, {1} {0} et {1}
@msg PDF writer error: {0} Erreur du générateur PDF : {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} {n} fichier assemblé dans {folder} ({note})|{n} fichiers assemblés dans {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Aperçu dans le navigateur nécessite l’application de bureau (la version web télécharge les fichiers à la place)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 indiquez `desiredK`, la taille de fichier souhaitée en K (1024 octets), un nombre supérieur à 0 et au plus 1048576
@msg `startWith` is `current` or `auto` `startWith` vaut `current` ou `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` vaut `allSlices`, `eachSlice` ou `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` est un numéro de tranche de `slice.list`, avec `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimiser selon la taille du fichier, aucune image à mesurer
@msg Release Guides: no guides Annuler les repères : aucun repère
@msg Release: no layer to put the rectangle in Annuler : aucun calque où placer le rectangle
@msg Replace Spine: select a blend and a path Remplacer la dorsale : sélectionnez un dégradé de formes et un tracé
Can't render this file because it is too large.
+14
View File
@@ -724,6 +724,8 @@
Conté Crayon… કોન્ટે ક્રેયોન…
Convert રૂપાંતર કરો
Convert All Spot Colors to Process બધા સ્પોટ રંગોને પ્રોસેસમાં રૂપાંતર કરો
Convert {name} to process {name} ને પ્રોસેસમાં રૂપાંતર કરો
Keep {name} as spot {name} ને સ્પોટ તરીકે રાખો
Convert All Strokes to Outlines બધા સ્ટ્રોકને આઉટલાઇનમાં રૂપાંતર કરો
Convert All Text to Outlines બધા ટેક્સ્ટને આઉટલાઇનમાં રૂપાંતર કરો
Convert Anchor Point એન્કર પોઇન્ટ રૂપાંતર કરો
@@ -2799,6 +2801,18 @@
Preview All Layers બધા લેયરનું પૂર્વાવલોકન
Preview Mode પૂર્વાવલોકન મોડ
Preview in Browser બ્રાઉઝરમાં પૂર્વાવલોકન
Optimize to File Size… ફાઇલ કદ મુજબ ઑપ્ટિમાઇઝ કરો…
Optimize to File Size ફાઇલ કદ મુજબ ઑપ્ટિમાઇઝ કરો
Desired File Size: ઇચ્છિત ફાઇલ કદ:
Start With: શરૂઆત:
Use: ઉપયોગ:
Current Settings વર્તમાન સેટિંગ્સ
Auto Select GIF/JPEG GIF/JPEG આપમેળે પસંદ કરો
Total of All Slices બધી સ્લાઇસનો કુલ
Each Slice દરેક સ્લાઇસ
Current Slice વર્તમાન સ્લાઇસ
{size}, within {target} {size}, {target} ની અંદર
No setting tried fits in {target}; the smallest is {size} અજમાવેલી કોઈ સેટિંગ {target} માં સમાતી નથી; સૌથી નાની {size} છે
Preview the document as it is now અત્યારે જેમ છે તેમ દસ્તાવેજનું પૂર્વાવલોકન કરો
Previous પાછલું
Previous Artboard પાછલું આર્ટબોર્ડ
Can't render this file because it contains an unexpected character in line 72 and column 5.
+19
View File
@@ -1034,6 +1034,8 @@ antiAlias Sharp शार्प
Control नियंत्रण
Convert कन्वर्ट करें
Convert All Spot Colors to Process सभी स्पॉट कलर्स को प्रोसेस में कनवर्ट करें
Convert {name} to process {name} को प्रोसेस में कनवर्ट करें
Keep {name} as spot {name} को स्पॉट के रूप में रखें
Convert All Strokes to Outlines सभी स्ट्रोक को आउटलाइन में कनवर्ट करें
Convert All Text to Outlines सभी टेक्स्ट को आउटलाइन में कनवर्ट करें
Convert Anchor Point एंकर पॉइंट कनवर्ट करें
@@ -3759,6 +3761,18 @@ antiAlias Sharp शार्प
Preview (1 inch on the page) प्रीव्यू (1 इंच पृष्ठ पर)
Preview All Layers सभी लेयर्स का प्रीव्यू करें
Preview in Browser ब्राउज़र में प्रीव्यू
Optimize to File Size… फ़ाइल आकार के अनुसार ऑप्टिमाइज़ करें…
Optimize to File Size फ़ाइल आकार के अनुसार ऑप्टिमाइज़ करें
Desired File Size: वांछित फ़ाइल आकार:
Start With: शुरुआत:
Use: उपयोग:
Current Settings वर्तमान सेटिंग्स
Auto Select GIF/JPEG GIF/JPEG स्वचालित रूप से चुनें
Total of All Slices सभी स्लाइस का कुल
Each Slice प्रत्येक स्लाइस
Current Slice वर्तमान स्लाइस
{size}, within {target} {size}, {target} के भीतर
No setting tried fits in {target}; the smallest is {size} आज़माई गई कोई भी सेटिंग {target} में नहीं समाती; सबसे छोटा {size} है
Preview in Browser needs the desktop app (the web downloads files instead) ब्राउज़र में प्रीव्यू डेस्कटॉप ऐप (वेब डाउनलोड फ़ाइलों के बजाय) की जरूरत है
Preview Mode प्रीव्यू मोड
Preview the document as it is now डॉक्यूमेंट का प्रीव्यू करें क्योंकि यह अब है
@@ -8050,6 +8064,11 @@ liquify-list-end {0}, {1} {0} और {1}
@msg preset must be standard, diffuse, topLeft or right preset को standard, diffuse, topLeft या right होना चाहिए
@msg preset must be the name of a print preset preset किसी प्रिंट प्रीसेट का नाम होना चाहिए
@msg Preview in Browser needs the desktop app (the web downloads files instead) ब्राउज़र में प्रीव्यू डेस्कटॉप ऐप (वेब डाउनलोड फ़ाइलों के बजाय) की जरूरत है
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 `desiredK` दें, K (1024 बाइट) में वांछित फ़ाइल आकार: 0 से बड़ी और अधिकतम 1048576 संख्या
@msg `startWith` is `current` or `auto` `startWith` का मान `current` या `auto` होना चाहिए
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` का मान `allSlices`, `eachSlice` या `currentSlice` होना चाहिए
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice`, `slice.list` से स्लाइस संख्या है, `use: currentSlice` के साथ
@msg Optimize to File Size: there is no image to measure फ़ाइल आकार के अनुसार ऑप्टिमाइज़ करें: मापने के लिए कोई इमेज नहीं है
@msg previewMode must be default, pixel or overprint previewMode को default, pixel या overprint होना चाहिए
@msg Print Ink Fixes works on CMYK documents: choose File › Document Color Mode › CMYK Color first प्रिंट इंक फिक्स CMYK डॉक्यूमेंट्स पर काम करता है: फ़ाइल चुनें › डॉक्यूमेंट रंग मोड › CMYK कलर फर्स्ट
@msg print settings are not an object प्रिंट सेटिंग एक ऑब्जेक्ट नहीं है
Can't render this file because it is too large.
+19
View File
@@ -811,6 +811,8 @@ font-technology Variable Változó
Control Vezérlősáv
Convert Átalakítás
Convert All Spot Colors to Process Minden direktszín átalakítása skálaszínné
Convert {name} to process {name} átalakítása skálaszínné
Keep {name} as spot {name} megtartása direktszínként
Convert All Strokes to Outlines Minden körvonal útvonallá alakítása
Convert All Text to Outlines Minden szöveg útvonallá alakítása
Convert Anchor Point Horgonypont átalakítása
@@ -3285,6 +3287,18 @@ diagnostics ui felület
Preview: Előnézet:
Preview All Layers Összes réteg előnézetben
Preview in Browser Előnézet böngészőben
Optimize to File Size… Optimalizálás fájlméretre…
Optimize to File Size Optimalizálás fájlméretre
Desired File Size: Kívánt fájlméret:
Start With: Kiindulás:
Use: Használat:
Current Settings Jelenlegi beállítások
Auto Select GIF/JPEG GIF/JPEG automatikus kiválasztása
Total of All Slices Az összes szelet együtt
Each Slice Minden szelet
Current Slice Aktuális szelet
{size}, within {target} {size}, belefér ebbe: {target}
No setting tried fits in {target}; the smallest is {size} Egyik kipróbált beállítás sem fér bele ebbe: {target}; a legkisebb {size}
Preview in Browser needs the desktop app (the web downloads files instead) Az Előnézet böngészőben az asztali alkalmazásban érhető el (a webes változat helyette letölti a fájlokat)
Preview Mode Előnézeti mód
Preview the document as it is now A dokumentum jelenlegi állapotának előnézete
@@ -5833,6 +5847,11 @@ liquify-list-end {0}, {1} {0} és {1}
@msg plug-in parameters: {0} bővítmény paraméterei: {0}
@msg plug-in trapped: {0} a bővítmény futása megszakadt: {0}
@msg Preview in Browser needs the desktop app (the web downloads files instead) Az Előnézet böngészőben az asztali alkalmazásban érhető el (a webes változat helyette letölti a fájlokat)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 adja meg a `desiredK` értéket, a kívánt fájlméretet K-ban (1024 bájt): 0-nál nagyobb, legfeljebb 1048576 szám
@msg `startWith` is `current` or `auto` a `startWith` értéke `current` vagy `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` a `use` értéke `allSlices`, `eachSlice` vagy `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` a `slice` egy szeletszám a `slice.list` listából, `use: currentSlice` mellett
@msg Optimize to File Size: there is no image to measure Optimalizálás fájlméretre: nincs mérhető kép
@msg print settings are not an object a nyomtatási beállítások nem objektumot alkotnak
@msg printing isn't available here itt nem lehet nyomtatni
@msg range `{s}` is empty a tartomány üres: `{s}`
Can't render this file because it is too large.
+19
View File
@@ -1097,6 +1097,18 @@ lighting Light Cahaya
Placement Options… Opsi penempatan…
Plug-in… Plug-in…
Preview in Browser Pratinjau di browser
Optimize to File Size… Optimalkan ke Ukuran File…
Optimize to File Size Optimalkan ke Ukuran File
Desired File Size: Ukuran File yang Diinginkan:
Start With: Mulai Dengan:
Use: Gunakan:
Current Settings Pengaturan Saat Ini
Auto Select GIF/JPEG Pilih Otomatis GIF/JPEG
Total of All Slices Total Semua Slice
Each Slice Setiap Slice
Current Slice Slice Saat Ini
{size}, within {target} {size}, dalam batas {target}
No setting tried fits in {target}; the smallest is {size} Tidak ada pengaturan yang dicoba yang muat dalam {target}; yang terkecil {size}
Printer Setup… Pengaturan printer…
Printers Printer
Recent File File terbaru
@@ -2653,6 +2665,8 @@ digits Malayalam Malayalam
Collate Susun
Composite colours are converted to it; separations separate with it when it is a CMYK profile. Warna komposit dikonversi ke profil ini; separasi memisah dengannya bila merupakan profil CMYK.
Convert All Spot Colors to Process Konversi semua warna spot menjadi proses
Convert {name} to process Konversi {name} menjadi proses
Keep {name} as spot Pertahankan {name} sebagai spot
Default Printer Printer default
Document Ink Options Opsi tinta dokumen
Download: Unduh:
@@ -4497,6 +4511,11 @@ imageTrace Outline Kontur
@msg PDF writer error: {0} Kesalahan penulis PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Berhasil mengemas {n} file di {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Pratinjau di Peramban memerlukan aplikasi desktop (versi web mengunduh file sebagai gantinya)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 berikan `desiredK`, ukuran file yang diinginkan dalam K (1024 byte): angka di atas 0 dan paling banyak 1048576
@msg `startWith` is `current` or `auto` `startWith` adalah `current` atau `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` adalah `allSlices`, `eachSlice` atau `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` adalah nomor slice dari `slice.list`, dengan `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimalkan ke Ukuran File: tidak ada gambar untuk diukur
@msg Release Guides: no guides Lepaskan panduan: tidak ada panduan
@msg Release: no layer to put the rectangle in Lepaskan: tidak ada lapisan untuk menaruh persegi panjangnya
@msg Replace Spine: select a blend and a path Ganti rangka: pilih satu blend dan satu jalur
Can't render this file because it contains an unexpected character in line 2511 and column 5.
+19
View File
@@ -620,6 +620,8 @@ font-technology Variable Variabili
Control Controllo
Convert Converti
Convert All Spot Colors to Process Converti tutti i colori spot in quadricromia
Convert {name} to process Converti {name} in quadricromia
Keep {name} as spot Mantieni {name} come colore spot
Convert All Strokes to Outlines Converti tutte le tracce in contorni
Convert All Text to Outlines Converti tutto il testo in contorni
Convert Anchor Point Converti punto di ancoraggio
@@ -2764,6 +2766,18 @@ diagnostics ui interfaccia
Preview: Anteprima:
Preview All Layers Anteprima di tutti i livelli
Preview in Browser Anteprima nel browser
Optimize to File Size… Ottimizza in base alle dimensioni del file…
Optimize to File Size Ottimizza in base alle dimensioni del file
Desired File Size: Dimensione file desiderata:
Start With: Inizia con:
Use: Usa:
Current Settings Impostazioni correnti
Auto Select GIF/JPEG Selezione automatica GIF/JPEG
Total of All Slices Totale di tutte le sezioni
Each Slice Ogni sezione
Current Slice Sezione corrente
{size}, within {target} {size}, entro {target}
No setting tried fits in {target}; the smallest is {size} Nessuna impostazione provata rientra in {target}; la più piccola è {size}
Preview in Browser needs the desktop app (the web downloads files instead) Anteprima nel browser richiede l'app desktop (la versione web scarica invece i file)
Preview Mode Modalità anteprima
Preview the document as it is now Visualizza l'anteprima del documento nello stato attuale
@@ -4744,6 +4758,11 @@ liquify-list-end {0}, {1} {0} e {1}
@msg PDF writer error: {0} Errore del generatore PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Pacchetto creato con {n} file in {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Anteprima nel browser richiede l'app desktop (sul web i file vengono invece scaricati)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 indica `desiredK`, la dimensione del file desiderata in K (1024 byte): un numero maggiore di 0 e al massimo 1048576
@msg `startWith` is `current` or `auto` `startWith` è `current` o `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` è `allSlices`, `eachSlice` o `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` è un numero di sezione da `slice.list`, con `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Ottimizza in base alle dimensioni del file: non c'è nessuna immagine da misurare
@msg Release Guides: no guides Rilascia guide: nessuna guida
@msg Release: no layer to put the rectangle in Rilascia: nessun livello in cui inserire il rettangolo
@msg Replace Spine: select a blend and a path Sostituisci dorsale: seleziona una fusione e un tracciato
Can't render this file because it is too large.
+19
View File
@@ -1379,6 +1379,8 @@ antiAlias Sharp シャープ
Contextual Alternates 前後関係に依存する字形
Convert 変換
Convert All Spot Colors to Process すべての特色をプロセスカラーに変換
Convert {name} to process {name} をプロセスカラーに変換
Keep {name} as spot {name} を特色のままにする
Convert All Strokes to Outlines すべての線をアウトラインに変換
Convert All Text to Outlines すべてのテキストをアウトラインに変換
Convert Anchor Point アンカーポイントの切り替え
@@ -2838,6 +2840,18 @@ diagnostics ui UI
Preview All Layers すべてのレイヤーをプレビュー
Preview Mode プレビューモード
Preview in Browser ブラウザーでプレビュー
Optimize to File Size… ファイルサイズに合わせて最適化…
Optimize to File Size ファイルサイズに合わせて最適化
Desired File Size: 目標ファイルサイズ:
Start With: 開始設定:
Use: 対象:
Current Settings 現在の設定
Auto Select GIF/JPEG GIF/JPEG を自動選択
Total of All Slices すべてのスライスの合計
Each Slice 各スライス
Current Slice 現在のスライス
{size}, within {target} {size} ({target} 以内)
No setting tried fits in {target}; the smallest is {size} 試したどの設定も {target} に収まりません。最小は {size}
Preview the document as it is now 現在のドキュメントをプレビュー
Previous 前へ
Previous Library 前のライブラリ
@@ -5185,6 +5199,11 @@ swatch Bright Violet ビビッドバイオレット
@msg 1 hidden object 非表示のオブジェクト 1 個
@msg {n} hidden objects 非表示のオブジェクト {n} 個
@msg Preview in Browser needs the desktop app (the web downloads files instead) 「ブラウザーでプレビュー」にはデスクトップアプリが必要です (Web 版では代わりにファイルをダウンロードします)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 `desiredK` に目標ファイルサイズを K (1024 バイト) 単位で指定してください: 0 より大きく 1048576 以下の数値
@msg `startWith` is `current` or `auto` `startWith` は `current` または `auto` です
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` は `allSlices`、`eachSlice` または `currentSlice` です
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` は `slice.list` のスライス番号で、`use: currentSlice` と一緒に使います
@msg Optimize to File Size: there is no image to measure ファイルサイズに合わせて最適化: 測定する画像がありません
@msg no file system here この環境にはファイルシステムがありません
@msg nothing to preview プレビューするものがありません
@msg Saved {n} files beside {path} {path} と同じ場所にファイルを {n} 個保存しました
Can't render this file because it is too large.
+19
View File
@@ -3262,6 +3262,18 @@ lighting Light სინათლე
Placement Options… განთავსების პარამეტრები…
Plug-in… პლაგინი…
Preview in Browser ბრაუზერში ნახვა
Optimize to File Size… ფაილის ზომაზე ოპტიმიზაცია…
Optimize to File Size ფაილის ზომაზე ოპტიმიზაცია
Desired File Size: სასურველი ფაილის ზომა:
Start With: დაწყება:
Use: გამოყენება:
Current Settings მიმდინარე პარამეტრები
Auto Select GIF/JPEG GIF/JPEG-ის ავტომატური არჩევა
Total of All Slices ყველა ნაჭრის ჯამი
Each Slice თითოეული ნაჭერი
Current Slice მიმდინარე ნაჭერი
{size}, within {target} {size}, {target}-ის ფარგლებში
No setting tried fits in {target}; the smallest is {size} არცერთი ნაცადი პარამეტრი არ ეტევა {target}-ში; უმცირესია {size}
Printer Setup… პრინტერის დაყენება…
Printers პრინტერები
Recent File ბოლოს გახსნილი ფაილი
@@ -4825,6 +4837,8 @@ digits Malayalam მალაიალამური
Collate დაკომპლექტება
Composite colours are converted to it; separations separate with it when it is a CMYK profile. შედგენილი ფერები მასში გარდაიქმნება; სეპარაცია მისით ხდება, როცა ის CMYK პროფილია.
Convert All Spot Colors to Process ყველა სპოტ-ფერის პროცესულად გარდაქმნა
Convert {name} to process {name}-ის პროცესულად გარდაქმნა
Keep {name} as spot {name}-ის სპოტ-ფერად დატოვება
Default Printer ნაგულისხმევი პრინტერი
Document Ink Options დოკუმენტის საღებავების პარამეტრები
Download: ჩამოტვირთვა:
@@ -6548,6 +6562,11 @@ font-technology Variable ცვლადი
@msg PDF writer error: {0} PDF-ის ჩამწერის შეცდომა: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} შეფუთულია ფაილი ({n}) საქაღალდეში {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) ბრაუზერში წინასწარ ნახვას დესკტოპის აპი სჭირდება (ვებში ფაილები ჩამოიტვირთება)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 მიუთითეთ `desiredK`, სასურველი ფაილის ზომა K-ში (1024 ბაიტი): 0-ზე მეტი და არაუმეტეს 1048576 რიცხვი
@msg `startWith` is `current` or `auto` `startWith` არის `current` ან `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` არის `allSlices`, `eachSlice` ან `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` არის ნაჭრის ნომერი `slice.list`-დან, `use: currentSlice`-თან ერთად
@msg Optimize to File Size: there is no image to measure ფაილის ზომაზე ოპტიმიზაცია: გასაზომი გამოსახულება არ არის
@msg Release Guides: no guides დამხმარე ხაზების მოხსნა: დამხმარე ხაზები არ არის
@msg Release: no layer to put the rectangle in მოხსნა: მართკუთხედის ჩასასმელი შრე არ არის
@msg Replace Spine: select a blend and a path ხერხემლის ჩანაცვლება: მონიშნეთ გადასვლა და ტრაექტორია
Can't render this file because it is too large.
+19
View File
@@ -1369,6 +1369,8 @@ antiAlias Sharp 날카롭게
Contextual Alternates 문맥 대체 글자
Convert 변환
Convert All Spot Colors to Process 모든 별색을 프로세스 색상으로 변환
Convert {name} to process {name}을(를) 프로세스 색상으로 변환
Keep {name} as spot {name}을(를) 별색으로 유지
Convert All Strokes to Outlines 모든 선을 윤곽선으로 변환
Convert All Text to Outlines 모든 문자를 윤곽선으로 변환
Convert Anchor Point 앵커 포인트 변환
@@ -2828,6 +2830,18 @@ diagnostics ui UI
Preview All Layers 모든 레이어 미리 보기
Preview Mode 미리 보기 모드
Preview in Browser 브라우저에서 미리 보기
Optimize to File Size… 파일 크기에 맞게 최적화…
Optimize to File Size 파일 크기에 맞게 최적화
Desired File Size: 원하는 파일 크기:
Start With: 시작 설정:
Use: 사용:
Current Settings 현재 설정
Auto Select GIF/JPEG GIF/JPEG 자동 선택
Total of All Slices 모든 분할 합계
Each Slice 각 분할
Current Slice 현재 분할
{size}, within {target} {size}, {target} 이내
No setting tried fits in {target}; the smallest is {size} 시도한 설정 중 {target}에 맞는 것이 없습니다. 가장 작은 크기는 {size}
Preview the document as it is now 문서를 현재 상태로 미리 보기
Previous 이전
Previous Library 이전 라이브러리
@@ -5112,6 +5126,11 @@ theme Appearance 외관
@msg 1 hidden object 숨겨진 개체 1개
@msg {n} hidden objects 숨겨진 개체 {n}개
@msg Preview in Browser needs the desktop app (the web downloads files instead) 브라우저에서 미리 보기는 데스크톱 앱이 필요합니다(웹에서는 파일을 다운로드합니다)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 `desiredK`에 원하는 파일 크기를 K(1024바이트) 단위로 지정하세요: 0보다 크고 1048576 이하인 숫자
@msg `startWith` is `current` or `auto` `startWith`는 `current` 또는 `auto`입니다
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use`는 `allSlices`, `eachSlice` 또는 `currentSlice`입니다
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice`는 `slice.list`의 분할 번호이며 `use: currentSlice`와 함께 씁니다
@msg Optimize to File Size: there is no image to measure 파일 크기에 맞게 최적화: 측정할 이미지가 없습니다
@msg no file system here 여기에는 파일 시스템이 없습니다
@msg nothing to preview 미리 볼 항목이 없습니다
@msg Saved {n} files beside {path} {path} 옆에 파일 {n}개를 저장했습니다
Can't render this file because it is too large.
+19
View File
@@ -1665,6 +1665,18 @@ lighting Light Licht
Placement Options… Plaatsingsopties…
Plug-in… Plug-in…
Preview in Browser Voorbeeld in browser
Optimize to File Size… Optimaliseren naar bestandsgrootte…
Optimize to File Size Optimaliseren naar bestandsgrootte
Desired File Size: Gewenste bestandsgrootte:
Start With: Beginnen met:
Use: Gebruiken:
Current Settings Huidige instellingen
Auto Select GIF/JPEG GIF/JPEG automatisch kiezen
Total of All Slices Totaal van alle slices
Each Slice Elke slice
Current Slice Huidige slice
{size}, within {target} {size}, binnen {target}
No setting tried fits in {target}; the smallest is {size} Geen geprobeerde instelling past in {target}; de kleinste is {size}
Printer Setup… Printerinstellingen…
Printers Printers
Recent File Recent bestand
@@ -3270,6 +3282,8 @@ digits Malayalam Malayalam
Collate Sorteren
Composite colours are converted to it; separations separate with it when it is a CMYK profile. Composietkleuren worden ernaar geconverteerd; separaties worden ermee gescheiden als het een CMYK-profiel is.
Convert All Spot Colors to Process Alle spotkleuren omzetten naar proceskleuren
Convert {name} to process {name} omzetten naar proceskleur
Keep {name} as spot {name} als spotkleur behouden
Default Printer Standaardprinter
Document Ink Options Inktopties voor document
Download: Downloaden:
@@ -5116,6 +5130,11 @@ imageTrace Outline Contour
@msg PDF writer error: {0} PDF-schrijffout: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} {n} bestand verpakt in {folder} ({note})|{n} bestanden verpakt in {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Voorvertoning in browser heeft de desktop-app nodig (het web downloadt in plaats daarvan bestanden)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 geef `desiredK`, de gewenste bestandsgrootte in K (1024 bytes): een getal boven 0 en hoogstens 1048576
@msg `startWith` is `current` or `auto` `startWith` is `current` of `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` is `allSlices`, `eachSlice` of `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` is een slicenummer uit `slice.list`, met `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimaliseren naar bestandsgrootte: er is geen afbeelding om te meten
@msg Release Guides: no guides Hulplijnen vrijgeven: geen hulplijnen
@msg Release: no layer to put the rectangle in Vrijgeven: geen laag om de rechthoek in te plaatsen
@msg Replace Spine: select a blend and a path Ruggengraat vervangen: selecteer een mengsel en een pad
Can't render this file because it is too large.
+19
View File
@@ -1130,6 +1130,18 @@ lighting Light Światło
Placement Options… Opcje umieszczania…
Plug-in… Wtyczka…
Preview in Browser Podgląd w przeglądarce
Optimize to File Size… Optymalizuj do rozmiaru pliku…
Optimize to File Size Optymalizuj do rozmiaru pliku
Desired File Size: Żądany rozmiar pliku:
Start With: Zacznij od:
Use: Użyj:
Current Settings Bieżące ustawienia
Auto Select GIF/JPEG Automatyczny wybór GIF/JPEG
Total of All Slices Suma wszystkich plasterków
Each Slice Każdy plasterek
Current Slice Bieżący plasterek
{size}, within {target} {size}, w granicach {target}
No setting tried fits in {target}; the smallest is {size} Żadne wypróbowane ustawienie nie mieści się w {target}; najmniejsze ma {size}
Printer Setup… Ustawienia drukarki…
Printers Drukarki
Recent File Ostatni plik
@@ -2841,6 +2853,8 @@ digits Malayalam Malajalam
Collate Sortuj
Composite colours are converted to it; separations separate with it when it is a CMYK profile. Kolory kompozytowe są do niego konwertowane; rozbarwienia korzystają z niego, gdy jest profilem CMYK.
Convert All Spot Colors to Process Konwertuj wszystkie kolory dodatkowe na triadowe
Convert {name} to process Konwertuj {name} na kolor triadowy
Keep {name} as spot Zachowaj {name} jako kolor dodatkowy
Default Printer Drukarka domyślna
Document Ink Options Opcje farb dokumentu
Download: Pobieranie:
@@ -4833,6 +4847,11 @@ liquify-list-end {0}, {1} {0} i {1}
@msg PDF writer error: {0} Błąd zapisu PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Spakowane pliki: {n} w {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Podgląd w przeglądarce wymaga aplikacji desktopowej (wersja webowa zamiast tego pobiera pliki)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 podaj `desiredK`, żądany rozmiar pliku w K (1024 bajty): liczbę większą od 0 i najwyżej 1048576
@msg `startWith` is `current` or `auto` `startWith` to `current` lub `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` to `allSlices`, `eachSlice` lub `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` to numer plasterka z `slice.list`, z `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optymalizuj do rozmiaru pliku: brak obrazu do zmierzenia
@msg Release Guides: no guides Uwolnij linie pomocnicze: brak linii pomocniczych
@msg Release: no layer to put the rectangle in Uwolnij: brak warstwy, na której można umieścić prostokąt
@msg Replace Spine: select a blend and a path Zastąp grzbiet: zaznacz przejście i ścieżkę
Can't render this file because it is too large.
+19
View File
@@ -562,6 +562,8 @@ antiAlias Sharp Nítido
Control Controle
Convert Converter
Convert All Spot Colors to Process Converter Todas as Cores Spot em Processo
Convert {name} to process Converter {name} em Processo
Keep {name} as spot Manter {name} como Spot
Convert All Strokes to Outlines Converter Todos os Traçados em Contornos
Convert All Text to Outlines Converter Todo o Texto em Contornos
Convert Anchor Point Converter Ponto de Ancoragem
@@ -2253,6 +2255,18 @@ antiAlias Sharp Nítido
Preview: Visualização:
Preview Mode Modo de Visualização
Preview in Browser Visualizar no Navegador
Optimize to File Size… Otimizar para tamanho de arquivo…
Optimize to File Size Otimizar para tamanho de arquivo
Desired File Size: Tamanho de arquivo desejado:
Start With: Começar com:
Use: Usar:
Current Settings Configurações atuais
Auto Select GIF/JPEG Seleção automática GIF/JPEG
Total of All Slices Total de todas as fatias
Each Slice Cada fatia
Current Slice Fatia atual
{size}, within {target} {size}, dentro de {target}
No setting tried fits in {target}; the smallest is {size} Nenhuma configuração testada cabe em {target}; a menor tem {size}
Preview the document as it is now Visualizar o documento como está agora
Previous Anterior
Previous Library Biblioteca Anterior
@@ -4029,6 +4043,11 @@ axis Both Ambos
@msg PDF writer error: {0} Erro do gravador de PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} {n} arquivo empacotado em {folder} ({note})|{n} arquivos empacotados em {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Visualizar no navegador exige o aplicativo para desktop (na web, os arquivos são baixados)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 informe `desiredK`, o tamanho de arquivo desejado em K (1024 bytes): um número acima de 0 e no máximo 1048576
@msg `startWith` is `current` or `auto` `startWith` é `current` ou `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` é `allSlices`, `eachSlice` ou `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` é um número de fatia de `slice.list`, com `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Otimizar para tamanho de arquivo: não há imagem para medir
@msg Release Guides: no guides Liberar guias: não há guias
@msg Release: no layer to put the rectangle in Liberar: não há camada para colocar o retângulo
@msg Replace Spine: select a blend and a path Substituir coluna: selecione uma mesclagem e um traçado
Can't render this file because it is too large.
+19
View File
@@ -616,6 +616,8 @@ font-technology Variable Вариативные
Control Control
Convert Преобразовать
Convert All Spot Colors to Process Преобразовать все плашечные цвета в составные
Convert {name} to process Преобразовать {name} в составной цвет
Keep {name} as spot Оставить {name} плашечным цветом
Convert All Strokes to Outlines Преобразовать все обводки в контуры
Convert All Text to Outlines Преобразовать весь текст в контуры
Convert Anchor Point Преобразовать опорную точку
@@ -2751,6 +2753,18 @@ diagnostics ui интерфейс
Preview: Просмотр:
Preview All Layers Просмотреть все слои
Preview in Browser Просмотреть в браузере
Optimize to File Size… Оптимизировать по размеру файла…
Optimize to File Size Оптимизировать по размеру файла
Desired File Size: Желаемый размер файла:
Start With: Начать с:
Use: Использовать:
Current Settings Текущие настройки
Auto Select GIF/JPEG Автовыбор GIF/JPEG
Total of All Slices Сумма всех фрагментов
Each Slice Каждый фрагмент
Current Slice Текущий фрагмент
{size}, within {target} {size}, в пределах {target}
No setting tried fits in {target}; the smallest is {size} Ни одна опробованная настройка не укладывается в {target}; наименьший размер {size}
Preview in Browser needs the desktop app (the web downloads files instead) Просмотр в браузере требует настольного приложения (web-версия скачивает файлы)
Preview Mode Режим просмотра
Preview the document as it is now Просмотреть документ в текущем виде
@@ -4738,6 +4752,11 @@ liquify-list-end {0}, {1} {0} и {1}
@msg PDF writer error: {0} ошибка записи PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Упаковано файлов: {n} в {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Просмотр в браузере требует настольного приложения (web-версия скачивает файлы)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 укажите `desiredK`, желаемый размер файла в K (1024 байта): число больше 0 и не больше 1048576
@msg `startWith` is `current` or `auto` `startWith` принимает значения `current` или `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` принимает значения `allSlices`, `eachSlice` или `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` задаёт номер фрагмента из `slice.list`, вместе с `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Оптимизировать по размеру файла: нет изображения для измерения
@msg Release Guides: no guides Освобождение направляющих: нет направляющих
@msg Release: no layer to put the rectangle in Освобождение: нет слоя для помещения прямоугольника
@msg Replace Spine: select a blend and a path Замена остова: выделите переход и контур
Can't render this file because it is too large.
+19
View File
@@ -605,6 +605,8 @@ font-technology Variable Variabla
Control Kontroll
Convert Konvertera
Convert All Spot Colors to Process Konvertera alla dekorfärger till process
Convert {name} to process Konvertera {name} till process
Keep {name} as spot Behåll {name} som dekorfärg
Convert All Strokes to Outlines Konvertera alla konturer till konturbanor
Convert All Text to Outlines Konvertera all text till konturbanor
Convert Anchor Point Konvertera ankarpunkt
@@ -2655,6 +2657,18 @@ font-technology Variable Variabla
Preview: Förhandsgranskning:
Preview All Layers Förhandsgranska alla lager
Preview in Browser Förhandsgranska i webbläsare
Optimize to File Size… Optimera till filstorlek…
Optimize to File Size Optimera till filstorlek
Desired File Size: Önskad filstorlek:
Start With: Börja med:
Use: Använd:
Current Settings Aktuella inställningar
Auto Select GIF/JPEG Välj GIF/JPEG automatiskt
Total of All Slices Alla skivor totalt
Each Slice Varje skiva
Current Slice Aktuell skiva
{size}, within {target} {size}, inom {target}
No setting tried fits in {target}; the smallest is {size} Ingen provad inställning ryms i {target}; den minsta är {size}
Preview in Browser needs the desktop app (the web downloads files instead) Förhandsgranska i webbläsare kräver skrivbordsappen (webbversionen hämtar filerna i stället)
Preview Mode Förhandsgranskningsläge
Preview the document as it is now Förhandsgranska dokumentet som det ser ut nu
@@ -4620,6 +4634,11 @@ liquify-list-end {0}, {1} {0} och {1}
@msg PDF writer error: {0} fel i PDF-skrivaren: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Paketerade {n} fil i {folder} ({note})|Paketerade {n} filer i {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Förhandsgranska i webbläsare kräver skrivbordsappen (webbversionen hämtar filer i stället)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 ange `desiredK`, önskad filstorlek i K (1024 byte): ett tal över 0 och högst 1048576
@msg `startWith` is `current` or `auto` `startWith` är `current` eller `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` är `allSlices`, `eachSlice` eller `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` är ett skivnummer från `slice.list`, med `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Optimera till filstorlek: det finns ingen bild att mäta
@msg Release Guides: no guides Släpp stödlinjer: inga stödlinjer
@msg Release: no layer to put the rectangle in Släpp: inget lager att placera rektangeln i
@msg Replace Spine: select a blend and a path Ersätt ryggrad: markera en blandning och en bana
Can't render this file because it is too large.
+19
View File
@@ -597,6 +597,8 @@ font-technology Variable Değişken
Control Kontrol
Convert Dönüştür
Convert All Spot Colors to Process Tüm Spot Renkleri Proses Renklere Dönüştür
Convert {name} to process {name} Rengini Prosese Dönüştür
Keep {name} as spot {name} Rengini Spot Olarak Koru
Convert All Strokes to Outlines Tüm Konturları Anahatlara Dönüştür
Convert All Text to Outlines Tüm Metni Ana Hatlara Dönüştür
Convert Anchor Point Bağlantı Noktasını Dönüştür
@@ -2496,6 +2498,18 @@ shape Open Açık
Preview: Önizleme:
Preview All Layers Tüm Katmanları Önizle
Preview in Browser Tarayıcıda Önizleme
Optimize to File Size… Dosya Boyutuna Göre Optimize Et…
Optimize to File Size Dosya Boyutuna Göre Optimize Et
Desired File Size: İstenen Dosya Boyutu:
Start With: Başlangıç:
Use: Kullan:
Current Settings Geçerli Ayarlar
Auto Select GIF/JPEG GIF/JPEG Otomatik Seç
Total of All Slices Tüm Dilimlerin Toplamı
Each Slice Her Dilim
Current Slice Geçerli Dilim
{size}, within {target} {size}, {target} sınırında
No setting tried fits in {target}; the smallest is {size} Denenen hiçbir ayar {target} içine sığmıyor; en küçüğü {size}
Preview in Browser needs the desktop app (the web downloads files instead) Tarayıcıdaki önizleme için masaüstü uygulaması gerekir (bunun yerine web, dosyaları indirir)
Preview Mode Önizleme Modu
Preview the document as it is now Belgeyi şu anki haliyle önizleyin
@@ -4453,6 +4467,11 @@ liquify-list-end {0}, {1} {0} ve {1}
@msg PDF writer error: {0} PDF yazıcı hatası: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} {n} dosya {folder} klasörüne paketlendi ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Tarayıcıdaki önizleme için masaüstü uygulaması gerekir (bunun yerine web, dosyaları indirir)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 `desiredK` değerini verin, K cinsinden istenen dosya boyutu (1024 bayt): 0'dan büyük ve en çok 1048576 olan bir sayı
@msg `startWith` is `current` or `auto` `startWith` değeri `current` veya `auto` olmalıdır
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` değeri `allSlices`, `eachSlice` veya `currentSlice` olmalıdır
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice`, `slice.list` içindeki bir dilim numarasıdır ve `use: currentSlice` ile kullanılır
@msg Optimize to File Size: there is no image to measure Dosya Boyutuna Göre Optimize Et: ölçülecek görüntü yok
@msg Release Guides: no guides Sürüm Kılavuzları: kılavuz yok
@msg Release: no layer to put the rectangle in Serbest bırakma: dikdörtgeni yerleştirecek katman yok
@msg Replace Spine: select a blend and a path Omurgayı Değiştir: bir karışım ve yol seçin
Can't render this file because it is too large.
+19
View File
@@ -614,6 +614,8 @@ font-technology Variable Варіативні
Control Панель керування
Convert Перетворити
Convert All Spot Colors to Process Перетворити всі плашкові кольори на складові
Convert {name} to process Перетворити {name} на складовий колір
Keep {name} as spot Залишити {name} плашковим кольором
Convert All Strokes to Outlines Перетворити всі обведення на контури
Convert All Text to Outlines Перетворити весь текст на контури
Convert Anchor Point Перетворити опорну точку
@@ -2756,6 +2758,18 @@ diagnostics ui інтерфейс
Preview: Перегляд:
Preview All Layers Переглянути всі шари
Preview in Browser Переглянути у браузері
Optimize to File Size… Оптимізувати за розміром файлу…
Optimize to File Size Оптимізувати за розміром файлу
Desired File Size: Бажаний розмір файлу:
Start With: Почати з:
Use: Використати:
Current Settings Поточні налаштування
Auto Select GIF/JPEG Автовибір GIF/JPEG
Total of All Slices Сума всіх фрагментів
Each Slice Кожен фрагмент
Current Slice Поточний фрагмент
{size}, within {target} {size}, у межах {target}
No setting tried fits in {target}; the smallest is {size} Жодне випробуване налаштування не вміщується в {target}; найменший розмір {size}
Preview in Browser needs the desktop app (the web downloads files instead) Перегляд у браузері вимагає настільної програми (web-версія завантажує файли)
Preview Mode Режим перегляду
Preview the document as it is now Переглянути документ у поточному вигляді
@@ -4728,6 +4742,11 @@ liquify-list-end {0}, {1} {0} і {1}
@msg PDF writer error: {0} Помилка запису PDF: {0}
@msgplural Packaged {n} file ({note}) in {folder}|Packaged {n} files ({note}) in {folder} Упаковано файли: {n} {folder} ({note})
@msg Preview in Browser needs the desktop app (the web downloads files instead) Перегляд у браузері вимагає настільної програми (web-версія завантажує файли)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 укажіть `desiredK`, бажаний розмір файлу в K (1024 байти): число більше за 0 і не більше 1048576
@msg `startWith` is `current` or `auto` `startWith` має значення `current` або `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` має значення `allSlices`, `eachSlice` або `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` задає номер фрагмента зі `slice.list`, разом з `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Оптимізувати за розміром файлу: немає зображення для вимірювання
@msg Release Guides: no guides Звільнення напрямних: немає напрямних
@msg Release: no layer to put the rectangle in Звільнення: немає шару для приміщення прямокутника
@msg Replace Spine: select a blend and a path Заміна осі: виділіть перехід і контур
Can't render this file because it is too large.
+19
View File
@@ -717,6 +717,8 @@ font-technology Variable Biến thiên
Control Điều khiển
Convert Chuyển đổi
Convert All Spot Colors to Process Chuyển tất cả màu đặc thành màu lai
Convert {name} to process Chuyển {name} thành màu lai
Keep {name} as spot Giữ {name} là màu đặc
Convert All Strokes to Outlines Chuyển tất cả nét thành đường bao
Convert All Text to Outlines Chuyển tất cả văn bản thành đường bao
Convert Anchor Point Chuyển đổi điểm neo
@@ -3078,6 +3080,18 @@ diagnostics ui giao diện
Preview: Xem trước:
Preview All Layers Xem trước tất cả lớp
Preview in Browser Xem trước trong trình duyệt
Optimize to File Size… Tối ưu theo kích thước tệp…
Optimize to File Size Tối ưu theo kích thước tệp
Desired File Size: Kích thước tệp mong muốn:
Start With: Bắt đầu với:
Use: Dùng:
Current Settings Cài đặt hiện tại
Auto Select GIF/JPEG Tự chọn GIF/JPEG
Total of All Slices Tổng tất cả lát cắt
Each Slice Mỗi lát cắt
Current Slice Lát cắt hiện tại
{size}, within {target} {size}, trong giới hạn {target}
No setting tried fits in {target}; the smallest is {size} Không cài đặt nào đã thử vừa với {target}; nhỏ nhất là {size}
Preview in Browser needs the desktop app (the web downloads files instead) Xem trước trong trình duyệt cần ứng dụng máy tính để bàn (web sẽ tải tệp xuống thay thế)
Preview Mode Chế độ xem trước
Preview the document as it is now Xem trước tài liệu như hiện tại
@@ -5521,6 +5535,11 @@ liquify-list-end {0}, {1} {0} và {1}
@msg plug-in parameters: {0} tham số plug-in: {0}
@msg plug-in trapped: {0} plug-in bị kẹt: {0}
@msg Preview in Browser needs the desktop app (the web downloads files instead) Xem trước trên trình duyệt cần ứng dụng máy tính (web sẽ tải xuống tệp thay thế)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 hãy cho `desiredK`, kích thước tệp mong muốn tính bằng K (1024 byte): một số lớn hơn 0 và tối đa 1048576
@msg `startWith` is `current` or `auto` `startWith` là `current` hoặc `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` là `allSlices`, `eachSlice` hoặc `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` là số lát cắt từ `slice.list`, đi cùng `use: currentSlice`
@msg Optimize to File Size: there is no image to measure Tối ưu theo kích thước tệp: không có ảnh để đo
@msg print settings are not an object cài đặt in không phải là đối tượng
@msg printing isn't available here in không khả dụng ở đây
@msg range `{s}` is empty phạm vi `{s}` trống
Can't render this file because it contains an unexpected character in line 205 and column 5.
+19
View File
@@ -565,6 +565,8 @@ antiAlias Sharp 锐利
Control 控制栏
Convert 转换
Convert All Spot Colors to Process 将所有专色转换为印刷色
Convert {name} to process 将 {name} 转换为印刷色
Keep {name} as spot 将 {name} 保留为专色
Convert All Strokes to Outlines 将所有描边转换为轮廓
Convert All Text to Outlines 将所有文字转换为轮廓
Convert Anchor Point 转换锚点
@@ -2615,6 +2617,18 @@ diagnostics ui 界面
Preview 预览
Preview: 预览:
Preview in Browser 在浏览器中预览
Optimize to File Size… 优化到文件大小…
Optimize to File Size 优化到文件大小
Desired File Size: 所需文件大小:
Start With: 起始设置:
Use: 使用:
Current Settings 当前设置
Auto Select GIF/JPEG 自动选择 GIF/JPEG
Total of All Slices 所有切片总计
Each Slice 每个切片
Current Slice 当前切片
{size}, within {target} {size},不超过 {target}
No setting tried fits in {target}; the smallest is {size} 尝试过的设置都无法小于 {target};最小为 {size}
Preview in Browser needs the desktop app (the web downloads files instead) 在浏览器中预览需要桌面版应用程序 (网页版会改为下载文件)
Preview Mode 预览模式
Preview the document as it is now 按当前状态预览文档
@@ -4866,6 +4880,11 @@ imageTrace Outline 轮廓
@msg 1 hidden object 1 个隐藏的对象
@msg {n} hidden objects {n} 个隐藏的对象
@msg Preview in Browser needs the desktop app (the web downloads files instead) “在浏览器中预览”需要桌面应用 (网页版会改为下载文件)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 请给出 `desiredK`,即以 K (1024 字节) 为单位的所需文件大小:大于 0 且不超过 1048576 的数字
@msg `startWith` is `current` or `auto` `startWith` 为 `current` 或 `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` 为 `allSlices`、`eachSlice` 或 `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` 是 `slice.list` 中的切片编号,需配合 `use: currentSlice`
@msg Optimize to File Size: there is no image to measure 优化到文件大小:没有可测量的图像
@msg no file system here 此处没有文件系统
@msg nothing to preview 没有可预览的内容
@msg Saved {n} files beside {path} 已在 {path} 旁保存 {n} 个文件
Can't render this file because it is too large.
+19
View File
@@ -582,6 +582,8 @@ font-technology Variable 可變
Control 控制
Convert 轉換
Convert All Spot Colors to Process 將所有特別色轉換為印刷色
Convert {name} to process 將 {name} 轉換為印刷色
Keep {name} as spot 將 {name} 保留為特別色
Convert All Strokes to Outlines 將所有筆畫轉換為外框
Convert All Text to Outlines 將所有文字轉換為外框
Convert Anchor Point 轉換錨點
@@ -2455,6 +2457,11 @@ file-filter Templates 範本
@msg 1 hidden object 1 個隱藏的物件
@msg {n} hidden objects {n} 個隱藏的物件
@msg Preview in Browser needs the desktop app (the web downloads files instead) 「在瀏覽器中預覽」需要桌面應用程式 (網頁版會改為下載檔案)
@msg give `desiredK`, the desired file size in K (1024 bytes): a number above 0 and at most 1048576 請提供 `desiredK`,即以 K (1024 位元組) 為單位的所需檔案大小:大於 0 且不超過 1048576 的數字
@msg `startWith` is `current` or `auto` `startWith` 為 `current` 或 `auto`
@msg `use` is `allSlices`, `eachSlice` or `currentSlice` `use` 為 `allSlices`、`eachSlice` 或 `currentSlice`
@msg `slice` is a slice number from `slice.list`, with `use: currentSlice` `slice` 是 `slice.list` 中的切片編號,需搭配 `use: currentSlice`
@msg Optimize to File Size: there is no image to measure 最佳化至檔案大小:沒有可測量的影像
@msg no file system here 此處沒有檔案系統
@msg nothing to preview 沒有可預覽的內容
@msg Saved {n} files beside {path} 已在 {path} 旁儲存 {n} 個檔案
@@ -3891,6 +3898,18 @@ diagnostics ui 介面
Preview: 預覽:
Preview All Layers 預覽所有圖層
Preview in Browser 在瀏覽器中預覽
Optimize to File Size… 最佳化至檔案大小…
Optimize to File Size 最佳化至檔案大小
Desired File Size: 所需檔案大小:
Start With: 起始設定:
Use: 使用:
Current Settings 目前設定
Auto Select GIF/JPEG 自動選取 GIF/JPEG
Total of All Slices 所有切片總計
Each Slice 每個切片
Current Slice 目前切片
{size}, within {target} {size},不超過 {target}
No setting tried fits in {target}; the smallest is {size} 嘗試過的設定都無法小於 {target};最小為 {size}
Preview in Browser needs the desktop app (the web downloads files instead) 在瀏覽器中預覽需要桌面版應用程式 (網頁版會改為下載檔案)
Preview Mode 預覽模式
Preview the document as it is now 以目前狀態預覽文件
Can't render this file because it is too large.
+1 -1
View File
@@ -46,7 +46,7 @@ pub(crate) use libraries::{
};
#[cfg(test)]
pub(crate) use tiles::describe;
pub(crate) use tiles::{draw_folder, folder_tile, global_mark, list_row, list_row_name, tile_grid};
pub(crate) use tiles::{CMYK_INKS, draw_folder, folder_tile, global_mark, list_row, list_row_name, tile_grid};
/// View modes of the swatch list (and of the library panels: `ui.libraryPanel {view}`).
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
+2 -1
View File
@@ -64,7 +64,8 @@ pub(crate) fn draw_folder(ui: &Ui, r: Rect) {
}
/// The ink colours of the CMYK glyph (cyan, magenta, yellow, black) and the RGB glyph's bars.
const CMYK_INKS: [Color32; 4] = [Color32::from_rgb(0, 174, 239), Color32::from_rgb(236, 0, 140), Color32::from_rgb(255, 242, 0), Color32::BLACK];
pub(crate) const CMYK_INKS: [Color32; 4] =
[Color32::from_rgb(0, 174, 239), Color32::from_rgb(236, 0, 140), Color32::from_rgb(255, 242, 0), Color32::BLACK];
const RGB_BARS: [Color32; 3] = [Color32::from_rgb(255, 0, 0), Color32::from_rgb(0, 200, 0), Color32::from_rgb(0, 0, 255)];
File diff suppressed because one or more lines are too long
+36 -5
View File
@@ -7560,7 +7560,7 @@ nothing. Opening a document reads a DCS file and its plates again even with the
keeps the saved preview of other linked EPS files. These rules are VectorCraft's own: the screen, composite print and exports show the image as its plates
mixed into CMYK (each ink amount times the ink's CMYK values, plates combined as `1 − (1 − a)(1 − b)`); Separations
Preview and `file.print` separations show each plate on its own ink, and a spot plate prints as the document's swatch
of its ink (else its CMYK values) with `spotsToProcess`. Separations Preview shows a reduced image's plates as the
of its ink (else its CMYK values) with `spotsToProcess` or that ink's own `convertToProcess`. Separations Preview shows a reduced image's plates as the
mean of the plate pixels each shown pixel covers. A file may name 64 plates, a plate file may be 1 GB, and the plates together may hold 512 MB of
ink amounts; a plate that can't be read is an error naming the plate, and nothing is placed. The plates go on the first
plate's pixel grid, grown to hold every plate where it prints; a plate of another size or position is resampled onto
@@ -8646,7 +8646,9 @@ picked as the printer, File → Print saves the PDF instead (see Printing). Head
`{pages, path | dataBase64, bytes, warnings}`; `print.preview {settings?}`
answers what it would print without writing it: `{pages (copies included), sheets: [{artboard, tile?, ink?, width,
height, orientation, scale}] (one copy, in order), tiles: [{artboard, columns, rows, printed, tiles}] (document
space), inks: [{name, spot, print, frequency, angle}], warnings, settings}`. `print.setup {settings?}` saves the
space), inks: [{name, spot, print, frequency, angle}] (the plates), documentInks: [{name, spot, print, frequency,
angle, convertToProcess?}] (every ink of the document, the spot inks printing as process included), warnings,
settings}`. `print.setup {settings?}` saves the
settings with the document (one undo step, kept in the native file as `print_setup`); both other commands start from
the saved settings, or from a print preset's with `preset` (see Print presets), with `settings` over them (`null` keeps
a value). `list_commands` with filter `print.setup`
@@ -8676,9 +8678,19 @@ documents every field:
- `marks` and `bleed` as `document.exportPdf` takes them (the bleed is the document's unless `useDocument: false`),
drawn around the artboard at the paper's scale; the page information adds the tile and the ink with its screen.
- `output: {mode: composite|separations, emulsion: up|down, image: positive|negative, spotsToProcess, overprintBlack,
inks: [{name, print, frequency, angle}]}`: separations print one page per ink in the gray of its coverage (images
too; overprinting fills, strokes and characters don't knock out), Registration on every plate; emulsion down mirrors
the page and a negative inverts it.
inks: [{name, print, frequency, angle, convertToProcess}]}`: separations print one page per ink in the gray of its
coverage (images too; overprinting fills, strokes and characters don't knock out), Registration on every plate;
emulsion down mirrors the page and a negative inverts it.
- `output.inks[].convertToProcess` (default false) prints one spot ink as process inks: it gets no plate of its own,
and its color prints on the Cyan, Magenta, Yellow and Black plates, while other spot inks keep their plates. The
Print dialog's Document Ink Options list shows an icon before each spot ink's name, and a click on it switches that
ink between spot and process output, as
[the help page](https://helpx.adobe.com/illustrator/using/printing-color-separations.html) describes for single
spot colors. The rest is VectorCraft's own rule. `spotsToProcess` converts every spot ink whatever each one's
own setting says, and the dialog then dims the icons; turning it off again applies each ink's own setting. A
converted ink's `print`, `frequency` and `angle` are kept for when it prints as a spot ink again, and its Print
checkbox and fields are dimmed: `print: false` does not leave its color out of the process plates. Process inks and
Registration have no icon, and `convertToProcess` on a process ink is ignored with a setting note.
- `output.overprintBlack` (default false) makes black ink overprint in separations, as the Output step of
[Print color separations](https://helpx.adobe.com/illustrator/using/printing-color-separations.html) describes:
black art leaves the inks under it on the other plates. Which paints count as black is VectorCraft's own rule: a
@@ -8977,6 +8989,25 @@ file size), `seconds` to download at `kbps` (default 56.6), the size, and for pa
`source` (the colour the reduction made), so a colour keeps its edits when it is web-shifted or snapped. `slice: n`
previews one slice; `image: true` adds the file; `warnings` holds the export's warnings.
Optimize to File Size (the dialog's button under Preset) is `webExport.optimizeToFileSize {desiredK, startWith?,
use?, slice?, …settings}`. It searches for settings whose files fit in `desiredK` K (1 K is 1024 bytes; above 0, at
most 1048576) and returns them without writing a file or changing the remembered settings: `{targetBytes, achieved,
bytes, format, settings, trials, images, warnings}`. `startWith: current` (the default) keeps the format and takes the
highest JPEG quality (1 to the current quality) or the most GIF/PNG-8 colors (2 to the current count) that fit,
measured by encoding. A lower value can give a larger file, so the search measures up to 6 values spread over the
range, from the top down, and then narrows the step above the first one that fits. When no value measured fits, GIF
tries lossy 100 with the most colors that fit. PNG-24 has no
setting to lower. `startWith: auto` takes GIF for art with transparent pixels or at most 256 colors and JPEG
otherwise. With `transparency: false` it counts the colors the pixels have once blended over the matte, as the file
is written. For opaque art it tries the other format when the first one cannot reach the size. `use: allSlices` (the
default) measures the image, or the image slices' files together; `eachSlice` measures the largest slice file;
`currentSlice` measures `slice` (a number from `slice.list`), else the selected image slice, else the first. The
slices share one setting, so every `use` changes the setting of all of them. The search encodes at most 32 trial
settings. When none fits, `achieved` is false and `settings` are the smallest trial. A `desiredK` that is missing,
not a number, 0 or less or above 1048576 is an error, as are an unknown `startWith` or `use` and a `slice` that is
not a slice number or comes with another `use`. In the dialog, the desired size starts at the size of what Total of All
Slices measures with the current settings, rounded up to 0.001 K.
Presets: `webExport.presets.list` (built-in ones, then saved ones), `webExport.presets.save {name, newName?, …settings}`,
`webExport.presets.delete {name}`; any name works as `preset` in the other commands (its settings, then the keys
given). `webExport.settings {…}` remembers the settings the dialog opens on (`{}` reads them, `reset: true` restores the
+4 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long