mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 14:14:50 +00:00
Merge main into feat/prefs-descriptions-smart-guides
This commit is contained in:
@@ -294,13 +294,19 @@ impl GuideOptions {
|
||||
}
|
||||
}
|
||||
|
||||
/// The share of the way to its target (black or white, cool or warm, gray or full color) that the
|
||||
/// variation at `step` goes: 0 at the center, the options' reach at the outermost steps.
|
||||
pub fn step_fraction(opts: &GuideOptions, step: i32) -> f32 {
|
||||
(step.unsigned_abs() as f32 / opts.steps.max(1) as f32).min(1.0) * opts.reach()
|
||||
}
|
||||
|
||||
/// Variation of `c` at `step` (−steps..=steps: negative towards shades/cool/muted, positive towards
|
||||
/// tints/warm/vivid; 0 is `c` itself), in `c`'s model.
|
||||
pub fn variation(c: Color, opts: &GuideOptions, step: i32) -> Color {
|
||||
if step == 0 {
|
||||
return c;
|
||||
}
|
||||
let f = (step.unsigned_abs() as f32 / opts.steps.max(1) as f32).min(1.0) * opts.reach();
|
||||
let f = step_fraction(opts, step);
|
||||
let v = match opts.variation {
|
||||
Variation::TintsShades => c.lerp(if step < 0 { &Color::BLACK } else { &Color::WHITE }, f),
|
||||
Variation::WarmCool => {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -241,7 +241,8 @@ struct RasterOptions {
|
||||
width: Option<f64>,
|
||||
/// The height of each file in pixels (wins over `ppi` and `scale`).
|
||||
height: Option<f64>,
|
||||
quality: Option<u8>,
|
||||
/// JPEG and lossy WebP quality, read by [`RasterOptions::quality`].
|
||||
quality: Option<Value>,
|
||||
background: Option<Value>,
|
||||
anti_alias: Option<String>,
|
||||
interlaced: Option<bool>,
|
||||
@@ -281,6 +282,19 @@ fn clamped_ppi(ppi: f64) -> f64 {
|
||||
}
|
||||
|
||||
impl RasterOptions {
|
||||
/// `quality` as given: `None` when absent or null, else a whole number 0–255 (JPEG caps it at
|
||||
/// 100; WebP refuses more than 100), or an error naming it.
|
||||
fn quality(&self) -> Result<Option<u8>> {
|
||||
match &self.quality {
|
||||
None | Some(Value::Null) => Ok(None),
|
||||
Some(v) => v
|
||||
.as_u64()
|
||||
.and_then(|q| u8::try_from(q).ok())
|
||||
.map(Some)
|
||||
.ok_or_else(|| bad(C, format!("quality must be a whole number from 0 to 100, not {v}"))),
|
||||
}
|
||||
}
|
||||
|
||||
/// The pixel size each file is scaled to: `width`, else `height`; `None` when neither is set.
|
||||
fn pixel_size(&self) -> Result<Option<ScreenSize>> {
|
||||
let checked = |key: &str, n: f64| {
|
||||
@@ -311,7 +325,8 @@ impl RasterOptions {
|
||||
},
|
||||
anti_alias: self.anti_alias.as_deref().map(anti_alias).transpose().map_err(|e| bad(C, e))?.unwrap_or_default(),
|
||||
interlaced: self.interlaced.unwrap_or(false),
|
||||
quality: self.quality.unwrap_or(90).min(100),
|
||||
quality: self.quality()?.unwrap_or(90).min(100),
|
||||
webp_lossless: self.lossless.unwrap_or(true),
|
||||
jpeg: JpegOptions {
|
||||
color_model,
|
||||
method: parse(self.method.as_deref(), jpeg::Method::from_id, "method", "baseline, optimized or progressive")?,
|
||||
@@ -1136,6 +1151,11 @@ fn encode_files(doc: &Document, f: &Format, p: &Value) -> Result<Encoded> {
|
||||
"psd" => RasterFormat::Psd,
|
||||
_ => RasterFormat::WebP,
|
||||
};
|
||||
if format == RasterFormat::WebP
|
||||
&& let Some(q) = o.quality()?.filter(|q| *q > 100)
|
||||
{
|
||||
return Err(bad(C, format!("quality {q}: WebP quality is 0–100")));
|
||||
}
|
||||
check_options(format, &settings)?;
|
||||
// Use Artboards: one file per chosen artboard (default all); else the one chosen.
|
||||
let chosen = match use_artboards {
|
||||
@@ -1182,9 +1202,6 @@ fn encode_files(doc: &Document, f: &Format, p: &Value) -> Result<Encoded> {
|
||||
}
|
||||
let regions: Vec<Rect> = enc.files.iter().filter_map(|(b, _)| b.and_then(|b| doc.artboards.get(b))).map(|a| a.rect).collect();
|
||||
enc.warnings.extend(crate::cmd::fonts::export_overflow_warning(doc, &doc.layers, Some(®ions)));
|
||||
if format == RasterFormat::WebP && o.lossless == Some(false) {
|
||||
enc.setting_notes.push("lossy WebP isn't available yet: the file is lossless (exact, but larger)".into());
|
||||
}
|
||||
return Ok(enc);
|
||||
}
|
||||
_ => return Err(bad(C, format!("no encoder for {} yet", f.label))),
|
||||
|
||||
@@ -206,11 +206,15 @@ const LOSSLESS: FormatOption = FormatOption {
|
||||
name: "lossless",
|
||||
ty: "boolean",
|
||||
default: "true",
|
||||
description: "lossless WebP; false asks for lossy, which isn't available yet (written lossless, with a warning)",
|
||||
description: "lossless WebP (every pixel kept exactly); false writes lossy WebP at quality: a smaller file that loses some detail",
|
||||
};
|
||||
|
||||
const WEBP_QUALITY: FormatOption =
|
||||
FormatOption { name: "quality", ty: "integer", default: "90", description: "lossy quality 0–100 (for when lossy WebP is available)" };
|
||||
const WEBP_QUALITY: FormatOption = FormatOption {
|
||||
name: "quality",
|
||||
ty: "integer",
|
||||
default: "90",
|
||||
description: "lossy WebP quality 0–100 (with lossless false; higher keeps more detail in a larger file; more than 100 is refused)",
|
||||
};
|
||||
|
||||
/// The options of the palette formats (PNG-8, GIF).
|
||||
const PALETTE_OPTIONS: &[FormatOption] = &[
|
||||
|
||||
@@ -135,26 +135,25 @@ fn formats_list_use_artboards() {
|
||||
assert!(opts("vectorcraft").get("useArtboards").is_none());
|
||||
}
|
||||
|
||||
/// An export's reply gives what the file loses before its notes on the options, whatever order
|
||||
/// the encoder gave them: the WebP encoder notes that lossy WebP isn't applied before the export
|
||||
/// notes the type it drew in the fallback font. With only notes on the options, they keep their
|
||||
/// order.
|
||||
/// An export's reply gives what the file loses before its notes on the options: the type the
|
||||
/// export drew in the fallback font comes before the note on an option WebP doesn't read. With
|
||||
/// only notes on the options, they keep their order.
|
||||
#[test]
|
||||
fn what_the_file_loses_comes_before_a_note_on_the_options() {
|
||||
let lossy = "lossy WebP isn't available yet: the file is lossless (exact, but larger)";
|
||||
let unused = "`interlaced` was not used: WebP files don't read it";
|
||||
let warnings = |s: &mut Session, p: Value| -> Vec<String> {
|
||||
let r = s.execute("document.export", &p).unwrap();
|
||||
r["warnings"].as_array().unwrap().iter().filter_map(Value::as_str).map(str::to_string).collect()
|
||||
};
|
||||
let mut s = session(60.0, 40.0, 1);
|
||||
assert_eq!(warnings(&mut s, json!({"format": "webp", "lossless": false})), [lossy]);
|
||||
assert_eq!(warnings(&mut s, json!({"format": "webp", "interlaced": true})), [unused]);
|
||||
s.execute("text.create", &json!({"x": 5, "y": 20, "text": "Ab", "font": "Nonexistent Sans Probe"})).unwrap();
|
||||
let w = warnings(&mut s, json!({"format": "webp", "lossless": false}));
|
||||
let w = warnings(&mut s, json!({"format": "webp", "interlaced": true}));
|
||||
assert_eq!(w.len(), 2, "{w:?}");
|
||||
assert!(w[0].contains("fallback font") && w[0].contains("Nonexistent Sans Probe"), "{w:?}");
|
||||
assert_eq!(w[1], lossy);
|
||||
assert_eq!(w[1], unused);
|
||||
// document.serialize gives them in the same order.
|
||||
let r = s.execute("document.serialize", &json!({"format": "webp", "lossless": false})).unwrap();
|
||||
let r = s.execute("document.serialize", &json!({"format": "webp", "interlaced": true})).unwrap();
|
||||
assert_eq!(r["warnings"], json!(w));
|
||||
}
|
||||
|
||||
|
||||
@@ -546,20 +546,19 @@ fn type_in_a_missing_family_is_named_once_for_every_format() {
|
||||
assert!(fallback[0].contains("Nonexistent Sans Probe"), "{fallback:?}");
|
||||
}
|
||||
|
||||
/// What a later file loses comes before a note on the options that an earlier file gave: the
|
||||
/// first artboard's WebP gives only the lossy WebP note, the second's also says its type doesn't
|
||||
/// fit.
|
||||
/// What a later file loses comes before a note on the options: the second artboard's WebP says
|
||||
/// its type doesn't fit, before the note on the row's option that WebP doesn't read.
|
||||
#[test]
|
||||
fn what_any_file_loses_comes_before_the_notes_on_the_options() {
|
||||
let mut s = session(2);
|
||||
let second = s.doc().unwrap().doc.artboards[1].rect;
|
||||
let area = json!({"width": 30, "height": 8});
|
||||
s.execute("text.create", &json!({"x": second.x0 + 2.0, "y": second.y0 + 2.0, "size": 12, "area": area, "text": "Ab\nCd\nEf\nGh"})).unwrap();
|
||||
let r = export(&mut s, json!({"formats": [{"format": "webp", "lossless": false}]}));
|
||||
let r = export(&mut s, json!({"formats": [{"format": "webp", "interlaced": true}]}));
|
||||
let warnings: Vec<&str> = r["warnings"].as_array().unwrap().iter().filter_map(Value::as_str).collect();
|
||||
assert_eq!(warnings.len(), 2, "{warnings:?}");
|
||||
assert!(warnings[0].contains("doesn't fit its frame"), "{warnings:?}");
|
||||
assert!(warnings[1].starts_with("lossy WebP"), "{warnings:?}");
|
||||
assert!(warnings[1].starts_with("`formats[0].interlaced` was not used"), "{warnings:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -53,41 +53,115 @@ fn text_export_writes_the_stories_in_stacking_order() {
|
||||
let _ = std::fs::remove_dir_all(dir);
|
||||
}
|
||||
|
||||
/// The chunk types of RIFF WebP file `file`, in order.
|
||||
fn webp_chunks(file: &[u8]) -> Vec<[u8; 4]> {
|
||||
assert_eq!((&file[..4], &file[8..12]), (&b"RIFF"[..], &b"WEBP"[..]));
|
||||
let mut chunks = Vec::new();
|
||||
let mut at = 12;
|
||||
while at + 8 <= file.len() {
|
||||
let len = u32::from_le_bytes([file[at + 4], file[at + 5], file[at + 6], file[at + 7]]) as usize;
|
||||
chunks.push([file[at], file[at + 1], file[at + 2], file[at + 3]]);
|
||||
at += 8 + len + len % 2;
|
||||
}
|
||||
chunks
|
||||
}
|
||||
|
||||
/// The size and straight RGBA pixels of image file `file`.
|
||||
fn rgba(file: &[u8]) -> (u32, u32, Vec<u8>) {
|
||||
let img = craft_image_codecs::decode(file).unwrap();
|
||||
let (w, h) = img.dimensions();
|
||||
(w, h, img.to_rgba8())
|
||||
}
|
||||
|
||||
/// A 120 × 80 pt document filled with a grid of rectangles in 96 colors.
|
||||
fn varied_art() -> Session {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 120, "height": 80})).unwrap();
|
||||
for row in 0..8 {
|
||||
for col in 0..12 {
|
||||
s.execute("shape.rectangle", &json!({"x": col * 10, "y": row * 10, "width": 10, "height": 10})).unwrap();
|
||||
let color = format!("#{:02x}{:02x}{:02x}", col * 21, row * 32, (col * 7 + row * 23) % 256);
|
||||
s.execute("paint.setFill", &json!({"color": color})).unwrap();
|
||||
}
|
||||
}
|
||||
s
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn webp_is_lossless_and_says_so_when_lossy_is_asked_for() {
|
||||
fn webp_is_lossless_by_default_and_lossy_when_asked() {
|
||||
let mut s = varied_art();
|
||||
let export = |s: &mut Session, p: Value| -> (Vec<u8>, Value) {
|
||||
let r = s.execute("document.export", &merge(json!({"format": "webp", "background": "white"}), p)).unwrap();
|
||||
(b64(&r), r["warnings"].clone())
|
||||
};
|
||||
let (lossless, warnings) = export(&mut s, json!({}));
|
||||
assert_eq!(webp_chunks(&lossless), [*b"VP8L"], "lossless by default");
|
||||
assert_eq!(warnings, json!([]));
|
||||
// Quality doesn't change a lossless file.
|
||||
assert_eq!(export(&mut s, json!({"lossless": true, "quality": 10})).0, lossless);
|
||||
|
||||
let (lossy, warnings) = export(&mut s, json!({"lossless": false}));
|
||||
assert_eq!(webp_chunks(&lossy), [*b"VP8 "], "opaque art is a plain lossy file");
|
||||
assert_eq!(warnings, json!([]), "no note: the file is lossy");
|
||||
assert_eq!(export(&mut s, json!({"lossless": false, "quality": 90})).0, lossy, "quality 90 by default");
|
||||
// At quality 90 each channel stays within 4 levels of the exact pixels on average.
|
||||
let ((w, h, exact), (lw, lh, near)) = (rgba(&lossless), rgba(&lossy));
|
||||
assert_eq!((lw, lh), (w, h));
|
||||
assert_eq!((w, h), (120, 80));
|
||||
let diff: u64 = exact.iter().zip(&near).map(|(a, b)| u64::from(a.abs_diff(*b))).sum();
|
||||
let mean = diff as f64 / exact.len() as f64;
|
||||
assert!(mean <= 4.0, "mean difference {mean}");
|
||||
// Lower quality, smaller file.
|
||||
let low = export(&mut s, json!({"lossless": false, "quality": 10})).0;
|
||||
let high = export(&mut s, json!({"lossless": false, "quality": 95})).0;
|
||||
assert_eq!(webp_chunks(&low), [*b"VP8 "]);
|
||||
assert!(low.len() < high.len(), "{} vs {} bytes", low.len(), high.len());
|
||||
for q in [0, 100] {
|
||||
assert_eq!(webp_chunks(&export(&mut s, json!({"lossless": false, "quality": q})).0), [*b"VP8 "], "quality {q}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lossy_webp_keeps_translucent_pixels() {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.new", &json!({"width": 30, "height": 20})).unwrap();
|
||||
s.execute("shape.rectangle", &json!({"x": 2, "y": 2, "width": 10, "height": 10})).unwrap();
|
||||
let r = s.execute("document.export", &json!({"format": "webp"})).unwrap();
|
||||
let file = b64(&r);
|
||||
assert_eq!((&file[..4], &file[8..12], &file[12..16]), (&b"RIFF"[..], &b"WEBP"[..], &b"VP8L"[..]), "lossless bitstream");
|
||||
assert_eq!(r["warnings"], json!([]));
|
||||
let r = s.execute("document.export", &json!({"format": "webp", "lossless": false, "quality": 60, "background": "black"})).unwrap();
|
||||
assert_eq!(&b64(&r)[12..16], b"VP8L");
|
||||
assert!(r["warnings"][0].as_str().unwrap().contains("lossless"), "{r}");
|
||||
assert_eq!(
|
||||
craft_image_codecs::decode(&b64(&r))
|
||||
.map(|__cimg| {
|
||||
let (__w, __h) = __cimg.dimensions();
|
||||
match (__cimg.layout(), __cimg.sample_type()) {
|
||||
(craft_image_codecs::ChannelLayout::Gray, craft_image_codecs::SampleType::U8) => {
|
||||
image::DynamicImage::ImageLuma8(image::GrayImage::from_raw(__w, __h, __cimg.into_data()).unwrap())
|
||||
}
|
||||
(craft_image_codecs::ChannelLayout::GrayA, craft_image_codecs::SampleType::U8) => {
|
||||
image::DynamicImage::ImageLumaA8(image::GrayAlphaImage::from_raw(__w, __h, __cimg.into_data()).unwrap())
|
||||
}
|
||||
(craft_image_codecs::ChannelLayout::Rgb, craft_image_codecs::SampleType::U8) => {
|
||||
image::DynamicImage::ImageRgb8(image::RgbImage::from_raw(__w, __h, __cimg.into_data()).unwrap())
|
||||
}
|
||||
_ => image::DynamicImage::ImageRgba8(image::RgbaImage::from_raw(__w, __h, __cimg.to_rgba8()).unwrap()),
|
||||
}
|
||||
})
|
||||
.unwrap()
|
||||
.to_rgba8()
|
||||
.get_pixel(29, 19)
|
||||
.0,
|
||||
[0, 0, 0, 255]
|
||||
);
|
||||
s.execute("shape.rectangle", &json!({"x": 0, "y": 0, "width": 20, "height": 20})).unwrap();
|
||||
s.execute("paint.setFill", &json!({"color": "#0000ff"})).unwrap();
|
||||
s.execute("transparency.set", &json!({"opacity": 50})).unwrap();
|
||||
let file = |s: &mut Session, lossless: bool| b64(&s.execute("document.export", &json!({"format": "webp", "lossless": lossless})).unwrap());
|
||||
let (lossless, lossy) = (file(&mut s, true), file(&mut s, false));
|
||||
assert_eq!(webp_chunks(&lossy), [*b"VP8X", *b"ALPH", *b"VP8 "]);
|
||||
let ((w, h, exact), (lw, lh, near)) = (rgba(&lossless), rgba(&lossy));
|
||||
assert_eq!((lw, lh), (w, h));
|
||||
let at = |px: &[u8], x: u32, y: u32| -> [u8; 4] {
|
||||
let i = 4 * (y * w + x) as usize;
|
||||
[px[i], px[i + 1], px[i + 2], px[i + 3]]
|
||||
};
|
||||
// The alpha is written exactly: half covered under the rectangle, clear past it.
|
||||
let alphas = |px: &[u8]| px.chunks(4).map(|p| p[3]).collect::<Vec<u8>>();
|
||||
assert_eq!(alphas(&near), alphas(&exact));
|
||||
assert!((120..=135).contains(&at(&near, 5, 5)[3]), "{:?}", at(&near, 5, 5));
|
||||
assert_eq!(at(&near, 28, 10)[3], 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn webp_quality_out_of_its_range_is_refused() {
|
||||
let mut s = varied_art();
|
||||
for q in [json!(101), json!(255), json!(256), json!(-1), json!(60.5), json!("high"), json!(true)] {
|
||||
let p = json!({"format": "webp", "lossless": false, "quality": q});
|
||||
let e = s.execute("document.export", &p).unwrap_err().to_string();
|
||||
assert!(e.contains("quality"), "{q}: {e}");
|
||||
// In Export for Screens too, in a row or in the format's settings.
|
||||
let row = json!({"formats": [{"format": "webp", "lossless": false, "quality": q}]});
|
||||
assert!(s.execute("document.exportForScreens", &row).is_err(), "{q}");
|
||||
let settings = json!({"formats": [{"format": "webp"}], "settings": {"webp": {"lossless": false, "quality": q}}});
|
||||
assert!(s.execute("document.exportForScreens", &settings).is_err(), "{q}");
|
||||
}
|
||||
// A lossless file refuses it as well: the value is not a WebP quality.
|
||||
assert!(s.execute("document.export", &json!({"format": "webp", "quality": 101})).is_err());
|
||||
let r = s.execute("document.exportForScreens", &json!({"formats": [{"format": "webp", "lossless": false, "quality": 100}]})).unwrap();
|
||||
let file = b64(&r["files"][0]);
|
||||
assert_eq!(webp_chunks(&file), [*b"VP8 "]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -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 knock out; 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)}]}, 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
|
||||
),
|
||||
|
||||
@@ -19,7 +19,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"New Swatch",
|
||||
["Window", "Swatches"],
|
||||
None,
|
||||
"{name?, color? | colors?: [colour] (one swatch each, in one undo step; #rrggbbaa and #rgba are refused) | swatch? | gradient? | pattern?: name (default: the current fill), tint?: 0..100 (% of the global or spot `swatch`, or of the one the current fill links to), mode?: \"gray\"|\"rgb\"|\"hsb\"|\"lab\"|\"cmyk\"|\"web\" (convert the colour; lab: CIE L*a*b*, how spot colours are usually defined), global?, spot? (a spot colour, always global), group?: colour group name (solid colours only; default: ungrouped), none?: true (the None paint), paint?: paint.setFill params, keepModel?: bool (as paint.setFill)} save a colour, gradient or pattern as a swatch. A tint of a global or spot colour (below 100%, without mode, global or spot) becomes a tint swatch, \"Name 40%\", linked to its base: it follows edits to the base and applies as that tint of it. A gradient swatch keeps the gradient's aspect (with or without start/end) and holds no link to the swatch its gradient came from, and a pattern swatch holds the pattern untransformed. Names are unique (\"Sky 2\"); a colour's default name is its values (\"C=10 M=20 Y=30 K=0\", \"R=255 G=128 B=0\", \"Gray K=40\", \"L=55 a=60 b=40\") → {name, names: [every new swatch]}",
|
||||
"{name?, color? | colors?: [colour | {swatch, tint?}] (one swatch each, in one undo step; #rrggbbaa and #rgba are refused; `{swatch, tint}` is the paint paint.setFill gives, so a tint of a global or spot color becomes a tint swatch) | swatch? | gradient? | pattern?: name (default: the current fill), tint?: 0..100 (% of the global or spot `swatch`, or of the one the current fill links to), mode?: \"gray\"|\"rgb\"|\"hsb\"|\"lab\"|\"cmyk\"|\"web\" (convert the colour; lab: CIE L*a*b*, how spot colours are usually defined), global?, spot? (a spot colour, always global), group?: colour group name (solid colours only; default: ungrouped), none?: true (the None paint), paint?: paint.setFill params, keepModel?: bool (as paint.setFill)} save a colour, gradient or pattern as a swatch. A tint of a global or spot colour (below 100%, without mode, global or spot) becomes a tint swatch, \"Name 40%\", linked to its base: it follows edits to the base and applies as that tint of it. A gradient swatch keeps the gradient's aspect (with or without start/end) and holds no link to the swatch its gradient came from, and a pattern swatch holds the pattern untransformed. Names are unique (\"Sky 2\"); a colour's default name is its values (\"C=10 M=20 Y=30 K=0\", \"R=255 G=128 B=0\", \"Gray K=40\", \"L=55 a=60 b=40\") → {name, names: [every new swatch]}",
|
||||
has_doc,
|
||||
swatch_new
|
||||
),
|
||||
@@ -37,7 +37,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"New Color Group",
|
||||
["Window", "Swatches"],
|
||||
None,
|
||||
"{name?, swatches?: [names] (solid colours move into the group; gradients, patterns and None stay), colors?: [colour] (added as new swatches; #rrggbbaa and #rgba are refused), keepModel?: bool (as paint.setFill), fromArtwork?: false (add the unique colours of the selected art: fills, strokes, text, gradient stops and mesh points; a colour linked to a global swatch moves that swatch into the group), toGlobal?: true (with fromArtwork: the new swatches are global and the selected art's matching unlinked colours link to them), includeTints?: false (with fromArtwork: tints of global swatches also get swatches of their own)} → {name, swatches: [names in the group], linked: paints linked}",
|
||||
"{name?, swatches?: [names] (solid colours move into the group; gradients, patterns and None stay), colors?: [colour | {swatch, tint?}] (added as new swatches; #rrggbbaa and #rgba are refused; `{swatch, tint}` below 100% of a global or spot color adds a tint swatch, \"Name 40%\", linked to it, and any other `{swatch}` its color), keepModel?: bool (as paint.setFill), fromArtwork?: false (add the unique colours of the selected art: fills, strokes, text, gradient stops and mesh points; a colour linked to a global swatch moves that swatch into the group), toGlobal?: true (with fromArtwork: the new swatches are global and the selected art's matching unlinked colours link to them), includeTints?: false (with fromArtwork: tints of global swatches also get swatches of their own)} → {name, swatches: [names in the group], linked: paints linked}",
|
||||
has_doc,
|
||||
swatch_new_group
|
||||
),
|
||||
@@ -146,9 +146,11 @@ fn swatch_new(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let stored = |c: Color| if mode.is_some() { c } else { super::paint::new_color(s, p, c) };
|
||||
let cs: Vec<Paint> = cs
|
||||
.iter()
|
||||
.map(|c| color_value(c).map(|c| Paint::solid(stored(c))))
|
||||
.collect::<Option<_>>()
|
||||
.ok_or_else(|| bad(C, "bad colour in `colors`"))?;
|
||||
.map(|c| match swatch_entry(s, c, C)? {
|
||||
Some(paint) => Ok(paint),
|
||||
None => color_value(c).map(|c| Paint::solid(stored(c))).ok_or_else(|| bad(C, "bad colour in `colors`")),
|
||||
})
|
||||
.collect::<Result<_>>()?;
|
||||
if cs.is_empty() {
|
||||
return Err(bad(C, "`colors` is empty"));
|
||||
}
|
||||
@@ -216,6 +218,16 @@ fn swatch_new(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Ok(json!({ "name": names[0], "names": names }))
|
||||
}
|
||||
|
||||
/// A `colors` entry of `swatch.new` or `swatch.newGroup` that names a color swatch,
|
||||
/// `{swatch, tint?}`: the paint `paint.setFill {swatch, tint}` applies (a tint of a global or spot
|
||||
/// color stays linked to it). `None` for an entry without `swatch`.
|
||||
fn swatch_entry(s: &Session, v: &Value, cmd: &str) -> Result<Option<Paint>> {
|
||||
let Some(name) = v.get("swatch") else { return Ok(None) };
|
||||
let name = name.as_str().ok_or_else(|| bad(cmd, format!("`swatch` in `colors` must be a swatch name, not {name}")))?;
|
||||
let tint = super::paint::tint_param(v, cmd)?;
|
||||
super::paint::swatch_solid(&s.doc()?.doc, name, tint).map(Some).map_err(|e| bad(cmd, e))
|
||||
}
|
||||
|
||||
/// A gradient or pattern `paint`, parsed from the paint params `p`, as a new or edited swatch
|
||||
/// stores it.
|
||||
fn stored_paint(paint: Paint, p: &Value) -> Paint {
|
||||
@@ -475,10 +487,20 @@ fn swatch_new_group(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let mut names = str_list(p, "swatches");
|
||||
super::paint::check_keep_model(p, C)?;
|
||||
check_switches(p, &["fromArtwork", "toGlobal", "includeTints"], C)?;
|
||||
let colors: Vec<Color> = p
|
||||
// A `{swatch, tint}` entry below 100% becomes a tint swatch linked to its base; any other
|
||||
// entry becomes a process color swatch.
|
||||
let colors: Vec<Paint> = p
|
||||
.get("colors")
|
||||
.and_then(Value::as_array)
|
||||
.map(|a| a.iter().map(|v| color_value(v).map(|c| super::paint::new_color(s, p, c)).ok_or_else(|| bad(C, format!("bad color {v}")))).collect())
|
||||
.map(|a| {
|
||||
a.iter()
|
||||
.map(|v| match swatch_entry(s, v, C)? {
|
||||
Some(paint @ Paint::Solid { swatch: Some(_), tint, .. }) if tint < 1.0 => Ok(paint),
|
||||
Some(paint) => paint.color().map(Paint::solid).ok_or_else(|| bad(C, format!("bad color {v}"))),
|
||||
None => color_value(v).map(|c| Paint::solid(super::paint::new_color(s, p, c))).ok_or_else(|| bad(C, format!("bad color {v}"))),
|
||||
})
|
||||
.collect::<Result<Vec<_>>>()
|
||||
})
|
||||
.transpose()?
|
||||
.unwrap_or_default();
|
||||
let from_art = bool_or(p, "fromArtwork", false);
|
||||
@@ -486,15 +508,15 @@ fn swatch_new_group(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let tints = bool_or(p, "includeTints", false);
|
||||
let requested = name_param(p, "name");
|
||||
let (name, members, linked) = s.edit("New Color Group", |d, sel| {
|
||||
// New swatches: (colour, global).
|
||||
let mut new: Vec<(Color, bool)> = colors.iter().map(|c| (*c, false)).collect();
|
||||
// New swatches: (paint, global).
|
||||
let mut new: Vec<(Paint, bool)> = colors.iter().map(|c| (c.clone(), false)).collect();
|
||||
if from_art {
|
||||
if sel.objects.is_empty() {
|
||||
return Err(bad(C, "select artwork to make a group of its colours"));
|
||||
}
|
||||
let mut art = vec![];
|
||||
artwork_colors(d, &sel.objects, tints, &mut names, &mut art);
|
||||
new.extend(art.into_iter().map(|c| (c, to_global)));
|
||||
new.extend(art.into_iter().map(|c| (Paint::solid(c), to_global)));
|
||||
}
|
||||
let name = d.free_swatch_name(requested.as_deref().unwrap_or("Color Group"));
|
||||
// Colour groups hold solid colours only.
|
||||
@@ -505,12 +527,13 @@ fn swatch_new_group(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let mut free = d.free_swatch_names();
|
||||
free.insert(&name);
|
||||
group.swatches.iter().for_each(|sw| free.insert(&sw.name));
|
||||
for (c, global) in new {
|
||||
let nm = free.take(&color_name(c));
|
||||
if global {
|
||||
for (paint, global) in new {
|
||||
// A tint swatch is named "Name 40%", a colour after its values.
|
||||
let nm = free.take_new(&paint);
|
||||
if global && let Some(c) = paint.color() {
|
||||
links.push((c, nm.clone()));
|
||||
}
|
||||
group.swatches.push(Swatch { name: nm, paint: Paint::solid(c), global, spot: false });
|
||||
group.swatches.push(Swatch { name: nm, paint, global, spot: false });
|
||||
}
|
||||
let members: Vec<String> = group.swatches.iter().map(|w| w.name.clone()).collect();
|
||||
d.swatch_groups.push(group);
|
||||
|
||||
@@ -95,3 +95,50 @@ fn new_swatch_saves_several_colours_in_one_step() {
|
||||
assert!(s.execute("swatch.new", &json!({"colors": []})).is_err());
|
||||
assert!(s.execute("swatch.new", &json!({"colors": ["nope"]})).is_err());
|
||||
}
|
||||
|
||||
/// The tint swatch a swatch named `name` is: (base, tint 0..1); none for any other swatch.
|
||||
fn tint_of(s: &Session, name: &str) -> Option<(String, f32)> {
|
||||
s.doc().unwrap().doc.swatch(name)?.tint_of().map(|(b, t)| (b.to_string(), t))
|
||||
}
|
||||
|
||||
/// `{swatch, tint}` entries of `swatch.new {colors}` and `swatch.newGroup {colors}` make tint
|
||||
/// swatches linked to their spot color, beside plain colors, in one undo step; the tints follow an
|
||||
/// edit of the spot color; a bad entry saves nothing.
|
||||
#[test]
|
||||
fn colors_entries_naming_a_spot_color_save_tint_swatches() {
|
||||
let mut s = session();
|
||||
s.execute("swatch.new", &json!({"name": "Ink", "color": "#0066cc", "spot": true})).unwrap();
|
||||
let undo = s.doc().unwrap().history.undo.len();
|
||||
let r = s.execute("swatch.new", &json!({"colors": [{"swatch": "Ink", "tint": 60}, "#112233", {"swatch": "Ink", "tint": 30}]})).unwrap();
|
||||
let names = hexes(&r["names"]);
|
||||
assert_eq!(names, ["Ink 60%", "R=17 G=34 B=51", "Ink 30%"]);
|
||||
assert_eq!(s.doc().unwrap().history.undo.len(), undo + 1, "one undo step");
|
||||
let (base, tint) = tint_of(&s, "Ink 60%").expect("a tint swatch");
|
||||
assert_eq!(base, "Ink");
|
||||
assert!((tint - 0.6).abs() < 1e-6, "{tint}");
|
||||
assert!(tint_of(&s, "R=17 G=34 B=51").is_none());
|
||||
let r = s.execute("swatch.newGroup", &json!({"name": "Guide", "colors": [{"swatch": "Ink", "tint": 45}, "#445566", {"swatch": "Ink"}]})).unwrap();
|
||||
let members = hexes(&r["swatches"]);
|
||||
assert_eq!(members[0], "Ink 45%");
|
||||
assert_eq!(tint_of(&s, "Ink 45%").map(|(b, _)| b).as_deref(), Some("Ink"));
|
||||
assert!(members[1..].iter().all(|m| tint_of(&s, m).is_none()), "a color and the full spot color are process copies: {members:?}");
|
||||
let d = &s.doc().unwrap().doc;
|
||||
let full = d.swatch(&members[2]).unwrap();
|
||||
assert!(!full.spot && !full.global, "{full:?}");
|
||||
// The tint swatches follow an edit of the spot color.
|
||||
s.execute("swatch.edit", &json!({"name": "Ink", "color": "#cc0000"})).unwrap();
|
||||
let d = &s.doc().unwrap().doc;
|
||||
let ink = d.global_color("Ink").unwrap();
|
||||
for name in ["Ink 60%", "Ink 45%"] {
|
||||
let w = d.swatch(name).unwrap();
|
||||
let t = w.tint_of().unwrap().1;
|
||||
assert_eq!(w.paint.color().map(|c| c.to_hex()), Some(ink.tinted(t).to_hex()), "{name}");
|
||||
}
|
||||
// A missing swatch, a tint of a process color or a tint that is not a number saves nothing.
|
||||
let count = s.doc().unwrap().doc.swatches_iter().count();
|
||||
for bad in [json!({"swatch": "Nope", "tint": 50}), json!({"swatch": "R=17 G=34 B=51", "tint": 50}), json!({"swatch": "Ink", "tint": "half"})] {
|
||||
assert!(s.execute("swatch.new", &json!({"colors": ["#010203", bad]})).is_err(), "{bad}");
|
||||
assert!(s.execute("swatch.newGroup", &json!({"colors": ["#010203", bad]})).is_err(), "{bad}");
|
||||
}
|
||||
assert_eq!(s.doc().unwrap().doc.swatches_iter().count(), count);
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ fn export_selection_reports_the_encoders_warnings() {
|
||||
assert_eq!(plain["format"], "svg");
|
||||
assert!(warnings(&plain).is_empty(), "{plain}");
|
||||
for (format, options, says) in [
|
||||
("webp", json!({"lossless": false}), "lossless"),
|
||||
("webp", json!({"interlaced": true}), "interlaced"),
|
||||
("svg", json!({"profile": "tiny12"}), "blend"),
|
||||
("pdf", json!({"createLayers": true, "compatibility": "1.4"}), "layers"),
|
||||
] {
|
||||
|
||||
@@ -41,6 +41,8 @@ pub(crate) use envelope::TYPE_DRAWN as ENVELOPE_TYPE_DRAWN;
|
||||
pub(crate) use envelope::{GridPoint as EnvelopeGridPoint, PLUGIN as DEFORM_PLUGIN, outline as envelope_outline, upright as envelope_upright};
|
||||
pub(crate) use envelope::{MAX_ANY as ENVELOPE_MAX_ANY, MAX_SOLID as ENVELOPE_MAX_SOLID};
|
||||
pub(crate) use envelope::{WARPED_TYPE_DRAWN, WarpedType};
|
||||
#[cfg(test)]
|
||||
pub(crate) use frames::TEXT_FRAME_SCANS;
|
||||
pub(crate) use frames::text_frames;
|
||||
pub use obj::{NameEncoding, Names};
|
||||
pub(crate) use paint::MAX_STOPS as MAX_GRADIENT_STOPS;
|
||||
|
||||
@@ -15,11 +15,14 @@
|
||||
//!
|
||||
//! The reader reads the words after `DCBA` (little endian) this way. Word 1 is the spacing: 0 is
|
||||
//! Smooth Color, 1 is Specified Steps and 2 is Specified Distance. For Specified Distance, word 2
|
||||
//! is the distance in points, as a 32-bit float. Word 10 is the number of keys, and the words after
|
||||
//! it are a record of six words per key that starts with the key's id. For Specified Steps, the
|
||||
//! steps between two keys are counted from the steps drawn. The orientation is taken from the steps
|
||||
//! drawn: whichever one lays the blend out as they are drawn. A blend whose parts don't agree,
|
||||
//! whose spacing isn't one of these, or that doesn't come out as drawn, keeps its drawn steps.
|
||||
//! is the distance in points, as a 32-bit float. Word 5 is 0 for Align to Page and, for Align to
|
||||
//! Path, a 32-bit float of 8 or more. Word 10 is the number of keys, and the words after it are a
|
||||
//! record of six words per key that starts with the key's id. For Specified Steps, the steps
|
||||
//! between two keys are counted from the steps drawn. The orientation is the record's when it lays
|
||||
//! the blend out as the steps are drawn, else whichever one does (the closest when both do). A blend
|
||||
//! with no spine part whose record names its keys in their order has no spine of its own: it runs
|
||||
//! straight between its keys' centers. A blend whose parts don't agree, whose spacing isn't one of
|
||||
//! these, or that doesn't come out as drawn, keeps its drawn steps.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
@@ -28,7 +31,7 @@ use vectorcraft_color::{Color, Paint};
|
||||
use vectorcraft_doc::blend::{blend_expand, blend_steps};
|
||||
use vectorcraft_doc::live::{BlendOrientation, BlendSpacing, BlendSpec};
|
||||
use vectorcraft_doc::{AppearanceItem, Node, NodeId, NodeKind};
|
||||
use vectorcraft_geom::{PathData, Point, SubPath};
|
||||
use vectorcraft_geom::{ParamCurve, PathData, Point, SubPath};
|
||||
|
||||
/// The plugin that writes blends.
|
||||
pub(super) const PLUGIN: &str = "Adobe Path Blends"; // brand-ok: the plugin name the files use
|
||||
@@ -66,6 +69,8 @@ pub(super) struct Record {
|
||||
pub(super) ids: Vec<String>,
|
||||
/// `None`: Specified Steps, whose steps the reader counts from the drawn ones.
|
||||
pub(super) spacing: Option<BlendSpacing>,
|
||||
/// The orientation word 5 names, when it names one.
|
||||
pub(super) orientation: Option<BlendOrientation>,
|
||||
}
|
||||
|
||||
/// A blend's record, or `None` for a record that isn't one or whose spacing isn't read: an
|
||||
@@ -82,7 +87,18 @@ pub(super) fn record(bytes: &[u8]) -> Option<Record> {
|
||||
_ => return None,
|
||||
};
|
||||
let ids = record_ids(&words)?;
|
||||
Some(Record { ids, spacing })
|
||||
let orientation = words.get(5).and_then(|w| orientation(*w));
|
||||
Some(Record { ids, spacing, orientation })
|
||||
}
|
||||
|
||||
/// The orientation in a record's word 5: 0 is Align to Page, a 32-bit float of 8 or more Align to
|
||||
/// Path; anything else names none.
|
||||
fn orientation(bits: u32) -> Option<BlendOrientation> {
|
||||
if bits == 0 {
|
||||
return Some(BlendOrientation::AlignToPage);
|
||||
}
|
||||
let a = f32::from_bits(bits);
|
||||
(a.is_finite() && a >= 8.0).then_some(BlendOrientation::AlignToPath)
|
||||
}
|
||||
|
||||
/// The distance in a record's word `bits` (a 32-bit float), as the shortest decimal that reads
|
||||
@@ -131,6 +147,7 @@ pub(super) fn live_blend(edit: &Node, drawn: &Node, record: &Record, roles: &Rol
|
||||
if keys.len() < 2 || named.len() != keys.len() || ids.len() != keys.len() {
|
||||
return None;
|
||||
}
|
||||
let in_order = named.iter().zip(ids).all(|(n, id)| *n == id.as_str());
|
||||
named.sort_unstable();
|
||||
let mut listed: Vec<&str> = ids.iter().map(String::as_str).collect();
|
||||
listed.sort_unstable();
|
||||
@@ -150,12 +167,20 @@ pub(super) fn live_blend(edit: &Node, drawn: &Node, record: &Record, roles: &Rol
|
||||
})
|
||||
.collect();
|
||||
// A blend whose spine was never edited has none written: its spine is the straight lines
|
||||
// between the keys' centres, in the record's order.
|
||||
let spine = match spine {
|
||||
Some(spine) => spine,
|
||||
None => straight_spine(&keys, ids, roles)?,
|
||||
// between the keys' centers, in the record's order. With the keys in that order it is the
|
||||
// spine of a blend that has none of its own.
|
||||
let (spine, key_anchors) = match spine {
|
||||
Some(spine) => {
|
||||
let anchors = on_spine(&keys, &spine)?;
|
||||
(Some(spine), anchors)
|
||||
}
|
||||
None if in_order => (None, vec![]),
|
||||
None => {
|
||||
let spine = straight_spine(&keys, ids, roles)?;
|
||||
let anchors = on_spine(&keys, &spine)?;
|
||||
(Some(spine), anchors)
|
||||
}
|
||||
};
|
||||
let key_anchors = on_spine(&keys, &spine)?;
|
||||
let spacing = match record.spacing {
|
||||
// Specified Steps: the steps between two keys are the drawn objects that aren't keys,
|
||||
// shared out.
|
||||
@@ -170,26 +195,36 @@ pub(super) fn live_blend(edit: &Node, drawn: &Node, record: &Record, roles: &Rol
|
||||
if cost > *budget {
|
||||
return None;
|
||||
}
|
||||
let spec = BlendSpec { spacing, spine: Some(spine), key_anchors, ..BlendSpec::default() };
|
||||
let spec = BlendSpec { spacing, spine, key_anchors, ..BlendSpec::default() };
|
||||
// As many objects as the spacing lays out between each pair of keys (the orientation doesn't
|
||||
// change how many), counted before anything is laid out: as many as are drawn.
|
||||
if blend_steps(&keys, &spec).into_iter().fold(keys.len(), usize::saturating_add) != drawn.len() {
|
||||
return None;
|
||||
}
|
||||
*budget -= cost;
|
||||
// The drawn steps' centres and paints, once.
|
||||
let drawn: Vec<(Point, Fill)> = drawn.iter().map(|d| Some((centre(d)?, fill(d)))).collect::<Option<_>>()?;
|
||||
// The orientation that lays the steps out as drawn, the closest when both do.
|
||||
[BlendOrientation::AlignToPage, BlendOrientation::AlignToPath]
|
||||
// The drawn steps as the check compares them, once.
|
||||
let drawn: Vec<Drawn> = drawn.iter().map(|d| drawn_as(d)).collect::<Option<_>>()?;
|
||||
// The orientations that lay the steps out as drawn (the check compares the steps' centers, which
|
||||
// turning the steps along the spine leaves in place). Of those that also lay them out at their
|
||||
// drawn sizes and turned as drawn, the record's, else the closest; when none does, the closest
|
||||
// of them all.
|
||||
let fits: Vec<(f64, BlendSpec, Vec<Node>)> = [BlendOrientation::AlignToPage, BlendOrientation::AlignToPath]
|
||||
.into_iter()
|
||||
.filter_map(|orientation| {
|
||||
let spec = BlendSpec { orientation, ..spec.clone() };
|
||||
let laid = blend_expand(&keys, &spec);
|
||||
let off = how_far(&laid, &drawn)?;
|
||||
Some((off, spec))
|
||||
let off = how_far(&laid, &drawn, false)?;
|
||||
Some((off, spec, laid))
|
||||
})
|
||||
.min_by(|a, b| a.0.total_cmp(&b.0))
|
||||
.map(|(_, spec)| NodeKind::Blend { children: keys, spec: Box::new(spec) })
|
||||
.collect();
|
||||
let as_drawn: Vec<&(f64, BlendSpec, Vec<Node>)> = fits.iter().filter(|(_, _, laid)| how_far(laid, &drawn, true).is_some()).collect();
|
||||
as_drawn
|
||||
.iter()
|
||||
.copied()
|
||||
.find(|(_, s, _)| Some(s.orientation) == record.orientation)
|
||||
.or_else(|| as_drawn.iter().copied().min_by(|a, b| a.0.total_cmp(&b.0)))
|
||||
.or_else(|| fits.iter().min_by(|a, b| a.0.total_cmp(&b.0)))
|
||||
.map(|(_, spec, _)| NodeKind::Blend { children: keys, spec: Box::new(spec.clone()) })
|
||||
}
|
||||
|
||||
/// The anchor of `spine`'s first subpath each key's centre sits on (within a point), each a
|
||||
@@ -227,6 +262,117 @@ fn centre(n: &Node) -> Option<Point> {
|
||||
n.geometric_bounds().map(|b| b.center()).filter(|p| p.x.is_finite() && p.y.is_finite())
|
||||
}
|
||||
|
||||
/// The most anchors of an object's paths the check compares; an object with more is compared by its
|
||||
/// size alone.
|
||||
const MAX_MARK_ANCHORS: usize = 64;
|
||||
/// The most drawn objects whose outlines one check compares, spread evenly from the first to the
|
||||
/// last; the rest are compared by their sizes alone (the orientation turns every step alike).
|
||||
const MAX_OUTLINE_CHECKS: usize = 16;
|
||||
/// The most outline comparisons one check makes (a drawn object compared can have more than one
|
||||
/// laid object in its place); past them, a drawn object whose outline is to be compared matches
|
||||
/// none.
|
||||
const MAX_OUTLINE_COMPARISONS: usize = 4 * MAX_OUTLINE_CHECKS;
|
||||
|
||||
/// An object as the check compares it.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
struct Drawn<'a> {
|
||||
centre: Point,
|
||||
fill: Fill,
|
||||
/// Its width and height.
|
||||
size: Point,
|
||||
/// The object, for its paths' outline ([`outline`]), which turning it moves.
|
||||
node: &'a Node,
|
||||
}
|
||||
|
||||
/// `n` as the check compares it, or `None` when it has no finite bounds.
|
||||
fn drawn_as(n: &Node) -> Option<Drawn<'_>> {
|
||||
let size = n.geometric_bounds().map(|b| Point::new(b.width(), b.height())).filter(|p| p.x.is_finite() && p.y.is_finite())?;
|
||||
Some(Drawn { centre: centre(n)?, fill: fill(n), size, node: n })
|
||||
}
|
||||
|
||||
/// How the check compares an object's turn.
|
||||
enum Outline {
|
||||
/// By its outline: every subpath of more than one anchor of its paths, in any order, each with
|
||||
/// its path's fill, so that a turn that trades the places of paths painted differently doesn't
|
||||
/// pass.
|
||||
Paths(Vec<(Fill, SubPath)>),
|
||||
/// By its size alone: it holds art whose drawing isn't its members (a blend, an envelope, a
|
||||
/// repeat), art past eight levels down, more than [`MAX_MARK_ANCHORS`] anchors or no subpath to
|
||||
/// compare.
|
||||
Size,
|
||||
}
|
||||
|
||||
/// How the check compares `n`'s turn (the members of its groups and compound paths looked through,
|
||||
/// at most eight levels down; a compound path's members take its fill).
|
||||
fn outline(n: &Node) -> Outline {
|
||||
/// What the walk found.
|
||||
#[derive(Default)]
|
||||
struct Walk {
|
||||
subpaths: Vec<(Fill, SubPath)>,
|
||||
anchors: usize,
|
||||
/// Art compared by the size alone, or too many anchors.
|
||||
size_only: bool,
|
||||
}
|
||||
fn add(n: &Node, depth: usize, painted: Option<Fill>, w: &mut Walk) {
|
||||
if w.size_only {
|
||||
return;
|
||||
}
|
||||
match &n.kind {
|
||||
NodeKind::Path { path, .. } => {
|
||||
let f = painted.unwrap_or_else(|| fill(n));
|
||||
// A subpath of one anchor has no segment to compare with.
|
||||
for s in path.subpaths.iter().filter(|s| s.anchors.len() > 1) {
|
||||
w.anchors = w.anchors.saturating_add(s.anchors.len());
|
||||
if w.anchors > MAX_MARK_ANCHORS {
|
||||
w.size_only = true;
|
||||
return;
|
||||
}
|
||||
w.subpaths.push((f, s.clone()));
|
||||
}
|
||||
}
|
||||
NodeKind::Group { children, .. } if depth < 8 => {
|
||||
for c in children {
|
||||
add(c, depth + 1, painted, w);
|
||||
}
|
||||
}
|
||||
NodeKind::Compound { children, .. } if depth < 8 => {
|
||||
let f = painted.unwrap_or_else(|| fill(n));
|
||||
for c in children {
|
||||
add(c, depth + 1, Some(f), w);
|
||||
}
|
||||
}
|
||||
_ => w.size_only = true,
|
||||
}
|
||||
}
|
||||
let mut w = Walk::default();
|
||||
add(n, 0, None, &mut w);
|
||||
if w.size_only || w.subpaths.is_empty() { Outline::Size } else { Outline::Paths(w.subpaths) }
|
||||
}
|
||||
|
||||
/// Do two outlines ([`Outline::Paths`]) draw the same lines in the same fills: each anchor of one,
|
||||
/// and the points a quarter, half and three quarters along each of its segments (which show how a
|
||||
/// curved side bends), within `tolerance` of the other's subpaths of a fill that matches its own?
|
||||
/// Where a path starts, how many anchors it has on a straight or curved stretch, and the order of
|
||||
/// the paths don't count.
|
||||
fn same_outline(a: &[(Fill, SubPath)], b: &[(Fill, SubPath)], tolerance: f64) -> bool {
|
||||
let on = |from: &[(Fill, SubPath)], to: &[(Fill, SubPath)]| {
|
||||
from.iter().all(|(f, s)| {
|
||||
// Fills the check can't compare (gradients, patterns) are compared with each other by
|
||||
// their outline alone.
|
||||
let to = PathData::new(
|
||||
to.iter().filter(|(g, _)| same_fill(*f, *g) || (*f == Fill::Other && *g == Fill::Other)).map(|(_, t)| t.clone()).collect(),
|
||||
);
|
||||
let near = |p: Point| to.nearest(p).is_some_and(|(.., d)| d <= tolerance);
|
||||
s.anchors.iter().all(|p| near(p.p))
|
||||
&& (0..s.segment_count()).all(|i| {
|
||||
let c = s.segment(i);
|
||||
[0.25, 0.5, 0.75].into_iter().all(|t| near(c.eval(t)))
|
||||
})
|
||||
})
|
||||
};
|
||||
on(a, b) && on(b, a)
|
||||
}
|
||||
|
||||
/// An object's fill, as far as the check compares it.
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
enum Fill {
|
||||
@@ -267,31 +413,76 @@ fn same_fill(a: Fill, b: Fill) -> bool {
|
||||
/// farthest, each drawn object matched to a laid one of its own within the tolerance (each laid
|
||||
/// one matches one drawn one: the nearest still free; through a grid of cells the tolerance wide,
|
||||
/// so each finds its neighbours without looking at them all), when they are as many and each
|
||||
/// matches in place and fill; else `None` (also when that matching leaves one out).
|
||||
fn how_far(laid: &[Node], drawn: &[(Point, Fill)]) -> Option<f64> {
|
||||
/// matches in place and fill, and with `turned` also in width and height and, for at most
|
||||
/// [`MAX_OUTLINE_CHECKS`] drawn objects spread from the first to the last, in the outline of its
|
||||
/// paths (each within twice the tolerance), which turning an object changes; else `None` (also when
|
||||
/// that matching leaves one out, and when it would take more than [`MAX_OUTLINE_COMPARISONS`]
|
||||
/// outline comparisons).
|
||||
fn how_far(laid: &[Node], drawn: &[Drawn], turned: bool) -> Option<f64> {
|
||||
if laid.len() != drawn.len() {
|
||||
return None;
|
||||
}
|
||||
let cell = |p: Point| ((p.x / PLACE_TOLERANCE).floor() as i64, (p.y / PLACE_TOLERANCE).floor() as i64);
|
||||
let laid: Vec<(Point, Fill)> = laid.iter().map(|l| Some((centre(l)?, fill(l)))).collect::<Option<_>>()?;
|
||||
let laid: Vec<Drawn> = laid.iter().map(drawn_as).collect::<Option<_>>()?;
|
||||
let mut grid: HashMap<(i64, i64), Vec<usize>> = HashMap::with_capacity(laid.len());
|
||||
for (i, (p, _)) in laid.iter().enumerate() {
|
||||
grid.entry(cell(*p)).or_default().push(i);
|
||||
for (i, l) in laid.iter().enumerate() {
|
||||
grid.entry(cell(l.centre)).or_default().push(i);
|
||||
}
|
||||
let close = |a: Point, b: Point| (a.x - b.x).abs() <= 2.0 * PLACE_TOLERANCE && (a.y - b.y).abs() <= 2.0 * PLACE_TOLERANCE;
|
||||
// The drawn objects whose outlines are compared: all of them, or as many as the limit allows,
|
||||
// spread evenly so that the first and the last are among them.
|
||||
let mut compare_outline = vec![drawn.len() <= MAX_OUTLINE_CHECKS; drawn.len()];
|
||||
if drawn.len() > MAX_OUTLINE_CHECKS {
|
||||
for j in 0..MAX_OUTLINE_CHECKS {
|
||||
if let Some(c) = compare_outline.get_mut(j * (drawn.len() - 1) / (MAX_OUTLINE_CHECKS - 1)) {
|
||||
*c = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
let outlines_compared = std::cell::Cell::new(0usize);
|
||||
let same_turn = |l: &Drawn, d: &Drawn, compare: bool| {
|
||||
if !turned {
|
||||
return true;
|
||||
}
|
||||
if !close(l.size, d.size) || !compare {
|
||||
return close(l.size, d.size);
|
||||
}
|
||||
// An outline that isn't compared doesn't count as the same.
|
||||
if outlines_compared.get() >= MAX_OUTLINE_COMPARISONS {
|
||||
return false;
|
||||
}
|
||||
outlines_compared.set(outlines_compared.get() + 1);
|
||||
match (outline(l.node), outline(d.node)) {
|
||||
(Outline::Paths(a), Outline::Paths(b)) => same_outline(&a, &b, 2.0 * PLACE_TOLERANCE),
|
||||
// Live art against its drawing, too many anchors, or no paths: compared by the size
|
||||
// alone.
|
||||
_ => true,
|
||||
}
|
||||
};
|
||||
let mut used = vec![false; laid.len()];
|
||||
let mut worst: f64 = 0.0;
|
||||
for &(c, f) in drawn {
|
||||
for (k, d) in drawn.iter().enumerate() {
|
||||
let (c, f) = (d.centre, d.fill);
|
||||
let compare = compare_outline.get(k).copied().unwrap_or(false);
|
||||
let (cx, cy) = cell(c);
|
||||
// Coordinates far out saturate the cells: the neighbours' keys saturate too.
|
||||
let (i, near) = (-1i64..=1)
|
||||
let candidates = (-1i64..=1)
|
||||
.flat_map(|dx| (-1i64..=1).map(move |dy| (cx.saturating_add(dx), cy.saturating_add(dy))))
|
||||
.filter_map(|k| grid.get(&k))
|
||||
.flatten()
|
||||
.filter(|&&i| !used.get(i).copied().unwrap_or(true))
|
||||
.filter_map(|&i| laid.get(i).map(|l| (i, l)))
|
||||
.filter(|(_, (p, lf))| (*p - c).hypot() <= PLACE_TOLERANCE && same_fill(*lf, f))
|
||||
.map(|(i, (p, _))| (i, (*p - c).hypot()))
|
||||
.min_by(|a, b| a.1.total_cmp(&b.1))?;
|
||||
.filter(|(_, l)| (l.centre - c).hypot() <= PLACE_TOLERANCE && same_fill(l.fill, f));
|
||||
let (i, near) = if turned && compare {
|
||||
// Outlines are tried nearest first, so that steps crowded in one place don't spend the
|
||||
// outline comparisons on candidates farther off.
|
||||
let mut nearest: Vec<(usize, f64)> =
|
||||
candidates.filter(|(_, l)| close(l.size, d.size)).map(|(i, l)| (i, (l.centre - c).hypot())).collect();
|
||||
nearest.sort_by(|a, b| a.1.total_cmp(&b.1));
|
||||
nearest.into_iter().find(|(i, _)| laid.get(*i).is_some_and(|l| same_turn(l, d, true)))?
|
||||
} else {
|
||||
candidates.filter(|(_, l)| same_turn(l, d, false)).map(|(i, l)| (i, (l.centre - c).hypot())).min_by(|a, b| a.1.total_cmp(&b.1))?
|
||||
};
|
||||
if let Some(u) = used.get_mut(i) {
|
||||
*u = true;
|
||||
}
|
||||
@@ -364,7 +555,7 @@ mod tests {
|
||||
let edit = Node::new(NodeId(1), NodeKind::Group { children: vec![], clip: false });
|
||||
let drawn = Node::new(NodeId(2), NodeKind::Group { children: vec![], clip: false });
|
||||
let mut budget = 1;
|
||||
let record = Record { ids: vec!["A".into(), "B".into()], spacing: None };
|
||||
let record = Record { ids: vec!["A".into(), "B".into()], spacing: None, orientation: None };
|
||||
assert!(live_blend(&edit, &drawn, &record, &Roles::new(), &mut budget).is_none());
|
||||
assert_eq!(budget, 1);
|
||||
}
|
||||
@@ -396,7 +587,7 @@ mod tests {
|
||||
#[test]
|
||||
fn a_blend_takes_from_the_budget_only_when_it_is_laid_out() {
|
||||
let (edit, drawn, roles) = two_keys();
|
||||
let steps = Record { ids: vec!["A".into(), "B".into()], spacing: None };
|
||||
let steps = Record { ids: vec!["A".into(), "B".into()], spacing: None, orientation: None };
|
||||
let mut budget = 10;
|
||||
assert!(matches!(live_blend(&edit, &drawn, &steps, &roles, &mut budget), Some(NodeKind::Blend { .. })));
|
||||
assert_eq!(budget, 0);
|
||||
@@ -417,7 +608,7 @@ mod tests {
|
||||
let NodeKind::Group { children, .. } = &drawn.kind else { panic!("a group") };
|
||||
let keys_alone = [children[0].clone(), children[4].clone()];
|
||||
let drawn = Node::new(NodeId(11), NodeKind::Group { children: keys_alone.to_vec(), clip: false });
|
||||
let far = Record { ids: vec!["A".into(), "B".into()], spacing: Some(BlendSpacing::Distance(150.0)) };
|
||||
let far = Record { ids: vec!["A".into(), "B".into()], spacing: Some(BlendSpacing::Distance(150.0)), orientation: None };
|
||||
let mut budget = 10;
|
||||
let Some(NodeKind::Blend { spec, .. }) = live_blend(&edit, &drawn, &far, &roles, &mut budget) else { panic!("a live blend") };
|
||||
assert_eq!(spec.spacing, BlendSpacing::Distance(150.0));
|
||||
@@ -427,6 +618,44 @@ mod tests {
|
||||
assert_eq!(budget, 6);
|
||||
}
|
||||
|
||||
/// Word 5 names the orientation: 0 Align to Page, a 32-bit float of 8 or more (8 and an angle)
|
||||
/// Align to Path; any other value names none, and a record too short to hold it names none.
|
||||
#[test]
|
||||
fn records_say_their_orientation() {
|
||||
let magic = u32::from_le_bytes(*b"DCBA");
|
||||
let words = |w5: u32| {
|
||||
[magic, 1, 50f32.to_bits(), 0, 3, w5, 'C' as u32, 0, 0, 1, 2, 'A' as u32, 0, 0, u32::MAX, u32::MAX, 0, 'B' as u32, 0, 1f32.to_bits()]
|
||||
.into_iter()
|
||||
.chain([u32::MAX, u32::MAX, 3])
|
||||
.flat_map(u32::to_le_bytes)
|
||||
.collect::<Vec<u8>>()
|
||||
};
|
||||
let orientation = |w5: u32| record(&words(w5)).map(|r| r.orientation);
|
||||
assert_eq!(orientation(0), Some(Some(BlendOrientation::AlignToPage)));
|
||||
assert_eq!(orientation(8f32.to_bits()), Some(Some(BlendOrientation::AlignToPath)));
|
||||
assert_eq!(orientation(11.141593f32.to_bits()), Some(Some(BlendOrientation::AlignToPath)));
|
||||
for other in [1f32.to_bits(), 7.9f32.to_bits(), (-9f32).to_bits(), f32::NAN.to_bits(), f32::INFINITY.to_bits()] {
|
||||
assert_eq!(orientation(other), Some(None), "{other:#x}");
|
||||
}
|
||||
}
|
||||
|
||||
/// On a level straight spine both orientations lay two squares' steps out alike: the blend takes
|
||||
/// the record's orientation, and Align to Page when the record names none.
|
||||
#[test]
|
||||
fn the_records_orientation_is_kept_where_both_lay_out_alike() {
|
||||
let (edit, drawn, roles) = two_keys();
|
||||
for (named, want) in [
|
||||
(Some(BlendOrientation::AlignToPath), BlendOrientation::AlignToPath),
|
||||
(Some(BlendOrientation::AlignToPage), BlendOrientation::AlignToPage),
|
||||
(None, BlendOrientation::AlignToPage),
|
||||
] {
|
||||
let record = Record { ids: vec!["A".into(), "B".into()], spacing: None, orientation: named };
|
||||
let mut budget = 10;
|
||||
let Some(NodeKind::Blend { spec, .. }) = live_blend(&edit, &drawn, &record, &roles, &mut budget) else { panic!("a live blend") };
|
||||
assert_eq!(spec.orientation, want, "{named:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Two drawn steps on one laid object don't both match it: each laid object matches one drawn
|
||||
/// one, so a drawing the blend doesn't lay out isn't taken for it.
|
||||
#[test]
|
||||
@@ -435,12 +664,261 @@ mod tests {
|
||||
let path = vectorcraft_geom::shapes::rectangle(vectorcraft_geom::Rect::new(x, 0.0, x + 10.0, 10.0));
|
||||
Node::path(NodeId(0), path, Default::default())
|
||||
};
|
||||
// `laid` against the objects `drawn` as the check compares them.
|
||||
let check = |laid: &[Node], drawn: &[Node], turned: bool| {
|
||||
let drawn: Vec<Drawn> = drawn.iter().map(|d| drawn_as(d).expect("bounds")).collect();
|
||||
how_far(laid, &drawn, turned)
|
||||
};
|
||||
let laid = [square(0.0), square(50.0)];
|
||||
let c = |x: f64| (Point::new(x + 5.0, 5.0), Fill::None);
|
||||
assert!(how_far(&laid, &[c(0.0), c(50.0)]).is_some());
|
||||
assert!(how_far(&laid, &[c(0.0), c(0.1)]).is_none(), "both drawn steps near the first laid one");
|
||||
assert!(check(&laid, &[square(0.0), square(50.0)], true).is_some());
|
||||
assert!(check(&laid, &[square(0.0), square(0.1)], false).is_none(), "both drawn steps near the first laid one");
|
||||
// Sizes and outlines count only when asked for: a wider rectangle with the same center, and
|
||||
// a triangle turned a half turn.
|
||||
let wide = |x: f64| {
|
||||
let path = vectorcraft_geom::shapes::rectangle(vectorcraft_geom::Rect::new(x - 5.0, 2.5, x + 15.0, 7.5));
|
||||
Node::path(NodeId(0), path, Default::default())
|
||||
};
|
||||
assert!(check(&laid, &[wide(0.0), wide(50.0)], false).is_some());
|
||||
assert!(check(&laid, &[wide(0.0), wide(50.0)], true).is_none());
|
||||
// Steps on one center match by their size, in whichever order they are drawn.
|
||||
let big = |x: f64| {
|
||||
let path = vectorcraft_geom::shapes::rectangle(vectorcraft_geom::Rect::new(x - 5.0, -5.0, x + 15.0, 15.0));
|
||||
Node::path(NodeId(0), path, Default::default())
|
||||
};
|
||||
assert!(check(&[square(0.0), big(0.0)], &[big(0.0), square(0.0)], true).is_some());
|
||||
// A group's members in close reds match in whichever order they are drawn.
|
||||
let reds = |x: f64, order: [usize; 3]| {
|
||||
let member = |k: usize| {
|
||||
let left = x + k as f64 * 10.0;
|
||||
let path = vectorcraft_geom::shapes::rectangle(vectorcraft_geom::Rect::new(left, 0.0, left + 8.0, 8.0));
|
||||
let red = [0.25, 0.265, 0.28].get(k).copied().unwrap_or(0.0);
|
||||
Arc::new(Node::path(NodeId(0), path, vectorcraft_doc::Appearance::basic(Paint::solid(Color::rgb(red, 0.0, 0.0)), Paint::None, 0.0)))
|
||||
};
|
||||
Node::group(NodeId(0), order.iter().map(|k| member(*k)).collect())
|
||||
};
|
||||
assert!(check(&[reds(0.0, [0, 1, 2]), reds(50.0, [0, 1, 2])], &[reds(0.0, [1, 0, 2]), reds(50.0, [1, 0, 2])], true).is_some());
|
||||
// A triangle turned a half turn has its anchors elsewhere.
|
||||
let polygon = |points: &[Point]| Node::path(NodeId(0), PathData::single(SubPath::polyline(points, true)), Default::default());
|
||||
let triangle = |x: f64, turn: f64| {
|
||||
let mut n = polygon(&[Point::new(x, 0.0), Point::new(x, 10.0), Point::new(x + 10.0, 5.0)]);
|
||||
n.transform(vectorcraft_geom::Affine::rotate_about(turn, Point::new(x + 5.0, 5.0)), false);
|
||||
n
|
||||
};
|
||||
let laid = [triangle(0.0, 0.0), triangle(50.0, 0.0)];
|
||||
let turned = |x: f64| triangle(x, std::f64::consts::PI);
|
||||
assert!(check(&laid, &[turned(0.0), turned(50.0)], false).is_some());
|
||||
assert!(check(&laid, &[turned(0.0), turned(50.0)], true).is_none());
|
||||
// So has one in a group, filled with a gradient, which the check compares by its outline.
|
||||
let graded = |x: f64, turn: f64| {
|
||||
let mut t = triangle(x, turn);
|
||||
let gradient = vectorcraft_color::gradient::GradientPaint::new(vectorcraft_color::gradient::Gradient::default());
|
||||
t.appearance.set_fill(Paint::Gradient(Box::new(gradient)));
|
||||
Node::group(NodeId(0), vec![Arc::new(t)])
|
||||
};
|
||||
let in_groups = [graded(0.0, 0.0), graded(50.0, 0.0)];
|
||||
assert!(check(&in_groups, &[graded(0.0, 0.0), graded(50.0, 0.0)], true).is_some());
|
||||
assert!(check(&in_groups, &[graded(0.0, std::f64::consts::PI), graded(50.0, std::f64::consts::PI)], true).is_none());
|
||||
// The same triangle drawn from another of its anchors matches.
|
||||
let shifted = |x: f64| polygon(&[Point::new(x + 10.0, 5.0), Point::new(x, 0.0), Point::new(x, 10.0)]);
|
||||
assert!(check(&laid, &[shifted(0.0), shifted(50.0)], true).is_some());
|
||||
// So does the same triangle drawn with another anchor on one of its sides.
|
||||
let split = |x: f64| polygon(&[Point::new(x, 0.0), Point::new(x, 5.0), Point::new(x, 10.0), Point::new(x + 10.0, 5.0)]);
|
||||
assert!(check(&laid, &[split(0.0), split(50.0)], true).is_some());
|
||||
// A square with its top side bent inward has the same corners as its half turn, whose bent
|
||||
// side is at the bottom: the points along its sides tell them apart.
|
||||
let bent = |x: f64, turn: f64| {
|
||||
let (tl, tr) = (Point::new(x, 0.0), Point::new(x + 10.0, 0.0));
|
||||
let anchors = vec![
|
||||
vectorcraft_geom::Anchor::with_handles(tl, tl, Point::new(x + 3.0, 4.0)),
|
||||
vectorcraft_geom::Anchor::with_handles(tr, Point::new(x + 7.0, 4.0), tr),
|
||||
vectorcraft_geom::Anchor::corner(Point::new(x + 10.0, 10.0)),
|
||||
vectorcraft_geom::Anchor::corner(Point::new(x, 10.0)),
|
||||
];
|
||||
let mut n = Node::path(NodeId(0), PathData::single(SubPath::new(anchors, true)), Default::default());
|
||||
n.transform(vectorcraft_geom::Affine::rotate_about(turn, Point::new(x + 5.0, 5.0)), false);
|
||||
n
|
||||
};
|
||||
let upright = [bent(0.0, 0.0), bent(50.0, 0.0)];
|
||||
assert!(check(&upright, &[bent(0.0, 0.0), bent(50.0, 0.0)], true).is_some());
|
||||
let half = std::f64::consts::PI;
|
||||
assert!(check(&upright, &[bent(0.0, half), bent(50.0, half)], false).is_some());
|
||||
assert!(check(&upright, &[bent(0.0, half), bent(50.0, half)], true).is_none(), "the bent side at the bottom");
|
||||
// Past the limit of outlines compared, the last object is still among them.
|
||||
let row = |last: Node| {
|
||||
let mut row: Vec<Node> = (0..MAX_OUTLINE_CHECKS).map(|i| square(20.0 * i as f64)).collect();
|
||||
row.push(last);
|
||||
row
|
||||
};
|
||||
let end = 20.0 * MAX_OUTLINE_CHECKS as f64;
|
||||
assert!(check(&row(bent(end, 0.0)), &row(bent(end, 0.0)), true).is_some());
|
||||
assert!(check(&row(bent(end, 0.0)), &row(bent(end, half)), true).is_none(), "the last one turned");
|
||||
// A hundred steps crowded within the tolerance of each other match their drawn copies:
|
||||
// each drawn one is compared with the nearest laid one first.
|
||||
let crowd = |turn: f64| (0..100u32).map(|i| triangle(0.4 * f64::from(i) / 99.0, turn)).collect::<Vec<_>>();
|
||||
assert!(check(&crowd(0.0), &crowd(0.0), true).is_some());
|
||||
assert!(check(&crowd(0.0), &crowd(half), true).is_none(), "the crowd turned");
|
||||
// A compound path matches with its contours in another order, and not turned a half turn.
|
||||
let pair = |x: f64, flip: bool, turn: f64| {
|
||||
let a = SubPath::polyline(&[Point::new(x, 0.0), Point::new(x, 4.0), Point::new(x + 10.0, 2.0)], true);
|
||||
let b = SubPath::polyline(&[Point::new(x, 6.0), Point::new(x, 10.0), Point::new(x + 4.0, 8.0)], true);
|
||||
let subpaths = if flip { vec![b, a] } else { vec![a, b] };
|
||||
let mut n = Node::path(NodeId(0), PathData::new(subpaths), Default::default());
|
||||
n.transform(vectorcraft_geom::Affine::rotate_about(turn, Point::new(x + 5.0, 5.0)), false);
|
||||
n
|
||||
};
|
||||
let laid = [pair(0.0, false, 0.0), pair(50.0, false, 0.0)];
|
||||
assert!(check(&laid, &[pair(0.0, true, 0.0), pair(50.0, true, 0.0)], true).is_some());
|
||||
assert!(check(&laid, &[pair(0.0, true, std::f64::consts::PI), pair(50.0, true, std::f64::consts::PI)], true).is_none());
|
||||
// A lone anchor in a path draws nothing: the same path with one matches itself.
|
||||
let dotted = |x: f64| {
|
||||
let triangle = SubPath::polyline(&[Point::new(x, 0.0), Point::new(x, 10.0), Point::new(x + 10.0, 5.0)], true);
|
||||
let dot = SubPath::polyline(&[Point::new(x + 3.0, 5.0)], false);
|
||||
Node::path(NodeId(0), PathData::new(vec![triangle, dot]), Default::default())
|
||||
};
|
||||
assert!(check(&[dotted(0.0), dotted(50.0)], &[dotted(0.0), dotted(50.0)], true).is_some());
|
||||
// A live blend draws more than its keys: one is compared with its drawn copy by size alone.
|
||||
let blend = |x: f64| {
|
||||
let keys = vec![Arc::new(triangle(x, 0.0)), Arc::new(triangle(x, 0.0))];
|
||||
Node::new(NodeId(0), NodeKind::Blend { children: keys, spec: Box::default() })
|
||||
};
|
||||
let expanded = |x: f64| {
|
||||
let inside = SubPath::polyline(&[Point::new(x + 3.0, 4.0), Point::new(x + 3.0, 6.0)], false);
|
||||
let inside = Node::path(NodeId(0), PathData::single(inside), Default::default());
|
||||
Node::group(NodeId(0), vec![Arc::new(triangle(x, 0.0)), Arc::new(inside)])
|
||||
};
|
||||
assert!(check(&[blend(0.0), blend(50.0)], &[expanded(0.0), expanded(50.0)], true).is_some());
|
||||
// Coordinates far out don't overflow the grid.
|
||||
let far = [square(1e300), square(-1e300)];
|
||||
let _ = how_far(&far, &[c(1e300), c(-1e300)]);
|
||||
let _ = check(&far, &[square(1e300), square(-1e300)], false);
|
||||
}
|
||||
|
||||
/// Triangles pointing right on a spine running right to left, with their steps drawn pointing
|
||||
/// right: Align to Path would turn each one (keys included) a half turn, which leaves their
|
||||
/// centers and sizes as they are but not their points. A record naming Align to Path doesn't
|
||||
/// make the blend Align to Path.
|
||||
#[test]
|
||||
fn the_records_orientation_must_lay_the_steps_out_turned_as_drawn() {
|
||||
let triangle = |id: u64, x: f64| {
|
||||
let points = [Point::new(x, 0.0), Point::new(x, 10.0), Point::new(x + 20.0, 5.0)];
|
||||
Arc::new(Node::path(NodeId(id), PathData::single(SubPath::polyline(&points, true)), Default::default()))
|
||||
};
|
||||
let spine = vectorcraft_geom::shapes::line(Point::new(110.0, 5.0), Point::new(10.0, 5.0));
|
||||
let spine = Arc::new(Node::path(NodeId(3), spine, Default::default()));
|
||||
let edit = Node::new(NodeId(10), NodeKind::Group { children: vec![triangle(1, 100.0), triangle(2, 0.0), spine], clip: false });
|
||||
let steps = (0..5u32).map(|i| triangle(20 + u64::from(i), 100.0 - f64::from(i) * 25.0)).collect();
|
||||
let drawn = Node::new(NodeId(11), NodeKind::Group { children: steps, clip: false });
|
||||
let roles = Roles::from([
|
||||
(NodeId(1), ("K".to_string(), Some("A".to_string()))),
|
||||
(NodeId(2), ("K".to_string(), Some("B".to_string()))),
|
||||
(NodeId(3), ("S".to_string(), None)),
|
||||
]);
|
||||
for named in [BlendOrientation::AlignToPath, BlendOrientation::AlignToPage] {
|
||||
let record = Record { ids: vec!["A".into(), "B".into()], spacing: None, orientation: Some(named) };
|
||||
let mut budget = 10;
|
||||
let Some(NodeKind::Blend { spec, .. }) = live_blend(&edit, &drawn, &record, &roles, &mut budget) else { panic!("a live blend") };
|
||||
assert_eq!(spec.orientation, BlendOrientation::AlignToPage, "{named:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Triangles pointing right on a spine 1 pt long running right to left, with 998 steps drawn
|
||||
/// unturned, so that every step sits within the tolerance of each one. Align to Path would turn
|
||||
/// each one to point left. A record naming Align to Path doesn't make the blend Align to Path,
|
||||
/// however many steps one step's place matches; a record naming Align to Page keeps it.
|
||||
#[test]
|
||||
fn the_records_orientation_is_checked_on_crowded_steps() {
|
||||
let triangle = |id: u64, x: f64| {
|
||||
let points = [Point::new(x, 0.0), Point::new(x, 10.0), Point::new(x + 20.0, 5.0)];
|
||||
Arc::new(Node::path(NodeId(id), PathData::single(SubPath::polyline(&points, true)), Default::default()))
|
||||
};
|
||||
let spine = vectorcraft_geom::shapes::line(Point::new(11.0, 5.0), Point::new(10.0, 5.0));
|
||||
let spine = Arc::new(Node::path(NodeId(3), spine, Default::default()));
|
||||
let edit = Node::new(NodeId(10), NodeKind::Group { children: vec![triangle(1, 1.0), triangle(2, 0.0), spine], clip: false });
|
||||
let steps = (0..1000u32).map(|i| triangle(20 + u64::from(i), 1.0 - f64::from(i) / 999.0)).collect();
|
||||
let drawn = Node::new(NodeId(11), NodeKind::Group { children: steps, clip: false });
|
||||
let roles = Roles::from([
|
||||
(NodeId(1), ("K".to_string(), Some("A".to_string()))),
|
||||
(NodeId(2), ("K".to_string(), Some("B".to_string()))),
|
||||
(NodeId(3), ("S".to_string(), None)),
|
||||
]);
|
||||
for named in [BlendOrientation::AlignToPath, BlendOrientation::AlignToPage] {
|
||||
let record = Record { ids: vec!["A".into(), "B".into()], spacing: None, orientation: Some(named) };
|
||||
let mut budget = MAX_BLEND_OBJECTS;
|
||||
let Some(NodeKind::Blend { spec, .. }) = live_blend(&edit, &drawn, &record, &roles, &mut budget) else { panic!("a live blend") };
|
||||
assert_eq!(spec.orientation, BlendOrientation::AlignToPage, "{named:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Groups of a red square on the left and a blue one on the right, on a spine running right to
|
||||
/// left, with their steps drawn unturned: Align to Path would give each a half turn, which keeps
|
||||
/// the group's outline but trades the squares' places. A record naming Align to Path doesn't make
|
||||
/// the blend Align to Path.
|
||||
#[test]
|
||||
fn the_records_orientation_must_keep_each_member_where_it_is_drawn() {
|
||||
let square = |id: u64, x: f64, color: Color| {
|
||||
let path = vectorcraft_geom::shapes::rectangle(vectorcraft_geom::Rect::new(x, 0.0, x + 10.0, 10.0));
|
||||
Arc::new(Node::path(NodeId(id), path, vectorcraft_doc::Appearance::basic(Paint::solid(color), Paint::None, 0.0)))
|
||||
};
|
||||
let pair = |id: u64, x: f64| {
|
||||
let children = vec![square(id * 10, x, Color::rgb(1.0, 0.0, 0.0)), square(id * 10 + 1, x + 10.0, Color::rgb(0.0, 0.0, 1.0))];
|
||||
Arc::new(Node::new(NodeId(id), NodeKind::Group { children, clip: false }))
|
||||
};
|
||||
let spine = vectorcraft_geom::shapes::line(Point::new(110.0, 5.0), Point::new(10.0, 5.0));
|
||||
let spine = Arc::new(Node::path(NodeId(3), spine, Default::default()));
|
||||
let edit = Node::new(NodeId(4), NodeKind::Group { children: vec![pair(1, 100.0), pair(2, 0.0), spine], clip: false });
|
||||
let steps = (0..5u32).map(|i| pair(30 + u64::from(i), 100.0 - f64::from(i) * 25.0)).collect();
|
||||
let drawn = Node::new(NodeId(5), NodeKind::Group { children: steps, clip: false });
|
||||
let roles = Roles::from([
|
||||
(NodeId(1), ("K".to_string(), Some("A".to_string()))),
|
||||
(NodeId(2), ("K".to_string(), Some("B".to_string()))),
|
||||
(NodeId(3), ("S".to_string(), None)),
|
||||
]);
|
||||
for named in [BlendOrientation::AlignToPath, BlendOrientation::AlignToPage] {
|
||||
let record = Record { ids: vec!["A".into(), "B".into()], spacing: None, orientation: Some(named) };
|
||||
let mut budget = 100;
|
||||
let Some(NodeKind::Blend { spec, .. }) = live_blend(&edit, &drawn, &record, &roles, &mut budget) else { panic!("a live blend") };
|
||||
assert_eq!(spec.orientation, BlendOrientation::AlignToPage, "{named:?}");
|
||||
}
|
||||
// Drawn turned, blue on the left: the blend is Align to Path, whichever orientation the
|
||||
// record names.
|
||||
let turned = |id: u64, x: f64| {
|
||||
let children = vec![square(id * 10, x, Color::rgb(0.0, 0.0, 1.0)), square(id * 10 + 1, x + 10.0, Color::rgb(1.0, 0.0, 0.0))];
|
||||
Arc::new(Node::new(NodeId(id), NodeKind::Group { children, clip: false }))
|
||||
};
|
||||
let steps = (0..5u32).map(|i| turned(30 + u64::from(i), 100.0 - f64::from(i) * 25.0)).collect();
|
||||
let drawn = Node::new(NodeId(5), NodeKind::Group { children: steps, clip: false });
|
||||
for named in [BlendOrientation::AlignToPath, BlendOrientation::AlignToPage] {
|
||||
let record = Record { ids: vec!["A".into(), "B".into()], spacing: None, orientation: Some(named) };
|
||||
let mut budget = 100;
|
||||
let Some(NodeKind::Blend { spec, .. }) = live_blend(&edit, &drawn, &record, &roles, &mut budget) else { panic!("a live blend") };
|
||||
assert_eq!(spec.orientation, BlendOrientation::AlignToPath, "{named:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Rectangles 20 pt wide and 10 pt high on a vertical spine, with their steps drawn upright: Align
|
||||
/// to Path would turn each one (keys included) a quarter turn, which leaves the centers in place
|
||||
/// but not the sizes. A record naming Align to Path doesn't make the blend Align to Path; a
|
||||
/// record naming Align to Page does.
|
||||
#[test]
|
||||
fn the_records_orientation_must_lay_the_steps_out_at_their_drawn_sizes() {
|
||||
let rect = |id: u64, y: f64| {
|
||||
let path = vectorcraft_geom::shapes::rectangle(vectorcraft_geom::Rect::new(0.0, y, 20.0, y + 10.0));
|
||||
Arc::new(Node::path(NodeId(id), path, Default::default()))
|
||||
};
|
||||
let spine = vectorcraft_geom::shapes::line(Point::new(10.0, 5.0), Point::new(10.0, 105.0));
|
||||
let spine = Arc::new(Node::path(NodeId(3), spine, Default::default()));
|
||||
let edit = Node::new(NodeId(10), NodeKind::Group { children: vec![rect(1, 0.0), rect(2, 100.0), spine], clip: false });
|
||||
let steps = (0..5u32).map(|i| rect(20 + u64::from(i), f64::from(i) * 25.0)).collect();
|
||||
let drawn = Node::new(NodeId(11), NodeKind::Group { children: steps, clip: false });
|
||||
let roles = Roles::from([
|
||||
(NodeId(1), ("K".to_string(), Some("A".to_string()))),
|
||||
(NodeId(2), ("K".to_string(), Some("B".to_string()))),
|
||||
(NodeId(3), ("S".to_string(), None)),
|
||||
]);
|
||||
for named in [BlendOrientation::AlignToPath, BlendOrientation::AlignToPage] {
|
||||
let record = Record { ids: vec!["A".into(), "B".into()], spacing: None, orientation: Some(named) };
|
||||
let mut budget = 10;
|
||||
let Some(NodeKind::Blend { spec, .. }) = live_blend(&edit, &drawn, &record, &roles, &mut budget) else { panic!("a live blend") };
|
||||
assert_eq!(spec.orientation, BlendOrientation::AlignToPage, "{named:?}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,17 @@ const MAX_OBJECTS: usize = 100_000;
|
||||
const MAX_OBJECT: usize = 256 << 10;
|
||||
const OBJECT: &[u8] = b"/AI11Text :";
|
||||
|
||||
#[cfg(test)]
|
||||
thread_local! {
|
||||
/// How many times [`text_frames`] has scanned an editing copy on this thread.
|
||||
pub(crate) static TEXT_FRAME_SCANS: std::cell::Cell<u64> = const { std::cell::Cell::new(0) };
|
||||
}
|
||||
|
||||
/// The `/Art` path of each text object of `data` (an editing copy's document text), in art space
|
||||
/// (y up), by its story and frame. Objects without a readable path are left out.
|
||||
pub(crate) fn text_frames(data: &[u8]) -> HashMap<(u32, usize), BezPath> {
|
||||
#[cfg(test)]
|
||||
TEXT_FRAME_SCANS.set(TEXT_FRAME_SCANS.get() + 1);
|
||||
let mut out = HashMap::new();
|
||||
let mut at = 0;
|
||||
while let Some(i) = data.get(at..).and_then(|d| find(d, OBJECT)) {
|
||||
|
||||
@@ -9354,8 +9354,10 @@ fn a_blend_comes_in_as_a_live_blend() {
|
||||
}
|
||||
|
||||
/// A blend whose spine was never edited has no spine written, only its keys: its spine is the
|
||||
/// straight line between the keys' centres, in the record's order (here the left key, named `B`,
|
||||
/// first), and the blend comes in live.
|
||||
/// straight line between the keys' centers, in the record's order, and the blend comes in live.
|
||||
/// With the record naming the keys in their order (here the left key, named `B`, first) the blend
|
||||
/// has no spine of its own, which runs the same way; in the other order its spine is that line,
|
||||
/// from the right key to the left one.
|
||||
#[test]
|
||||
fn a_blend_with_no_spine_written_runs_straight_between_its_keys() {
|
||||
let spine_part = format!("%_N\n{}", blend_part("S", None));
|
||||
@@ -9365,12 +9367,20 @@ fn a_blend_with_no_spine_written_runs_straight_between_its_keys() {
|
||||
let NodeKind::Blend { children, spec } = &blend.kind else { panic!("a live blend: {:?} {warnings:?}", blend.kind) };
|
||||
assert!(!warnings.iter().any(|w| w == super::blend::DRAWN), "{warnings:?}");
|
||||
assert_eq!(spec.spacing, vectorcraft_doc::live::BlendSpacing::Steps(3));
|
||||
let spine = spec.spine.as_ref().and_then(|p| p.subpaths.first()).expect("a spine");
|
||||
let points: Vec<(f64, f64)> = spine.anchors.iter().map(|a| (a.p.x, a.p.y)).collect();
|
||||
assert_eq!((&spec.spine, &spec.key_anchors), (&None, &vec![]), "a blend with no spine of its own");
|
||||
let (spine, _) = vectorcraft_doc::blend::blend_spine(children, spec).expect("a spine");
|
||||
let points: Vec<(f64, f64)> = spine.subpaths[0].anchors.iter().map(|a| (a.p.x, a.p.y)).collect();
|
||||
assert_eq!(points.len(), 2, "{points:?}");
|
||||
assert!((points[0].0 - 10.0).abs() < 0.01 && (points[1].0 - 110.0).abs() < 0.01, "from the left key to the right one: {points:?}");
|
||||
assert_eq!(spec.key_anchors, vec![0, 1]);
|
||||
assert_eq!(vectorcraft_doc::blend::blend_expand(children, spec).len(), 5);
|
||||
|
||||
let body = blend_file("", [Some("B"), Some("A")], &blend_record(&['A', 'B']));
|
||||
let (blend, warnings) = read_blend(&body.replace(&spine_part, ""));
|
||||
let NodeKind::Blend { spec, .. } = &blend.kind else { panic!("a live blend: {:?} {warnings:?}", blend.kind) };
|
||||
let spine = spec.spine.as_ref().and_then(|p| p.subpaths.first()).expect("a spine");
|
||||
let points: Vec<(f64, f64)> = spine.anchors.iter().map(|a| (a.p.x, a.p.y)).collect();
|
||||
assert!((points[0].0 - 110.0).abs() < 0.01 && (points[1].0 - 10.0).abs() < 0.01, "from the right key to the left one: {points:?}");
|
||||
assert_eq!(spec.key_anchors, vec![1, 0]);
|
||||
}
|
||||
|
||||
/// The tags after a blend's drawn steps are the live blend's.
|
||||
|
||||
@@ -576,6 +576,12 @@ impl DocFont {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
thread_local! {
|
||||
/// How many times [`Texts::read`] has read a text document on this thread.
|
||||
pub(super) static TEXTS_READS: std::cell::Cell<u64> = const { std::cell::Cell::new(0) };
|
||||
}
|
||||
|
||||
/// The text document of an editing copy.
|
||||
pub(super) struct Texts {
|
||||
stories: Vec<Val>,
|
||||
@@ -615,6 +621,8 @@ impl Texts {
|
||||
fn find(h: &[u8], n: &[u8], from: usize) -> Option<usize> {
|
||||
h.get(from..)?.windows(n.len()).position(|w| w == n).map(|p| p + from)
|
||||
}
|
||||
#[cfg(test)]
|
||||
TEXTS_READS.set(TEXTS_READS.get() + 1);
|
||||
let start = find(data, b"%AI11_BeginTextDocument", 0)?;
|
||||
let from = find(data, b"/ASCII85Decode", start)? + b"/ASCII85Decode".len();
|
||||
let end = find(data, b"~>", from)? + 2;
|
||||
|
||||
@@ -47,6 +47,8 @@ mod layers;
|
||||
mod plan;
|
||||
mod slots;
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) use build::READ_AFRESH;
|
||||
#[cfg(test)]
|
||||
use build::{Frame, MADE, prune_unseen};
|
||||
pub(crate) use build::{MAX_WRAP_WORK, scale_document, scale_symbols};
|
||||
|
||||
@@ -116,13 +116,20 @@ pub(super) type Built = Result<(Document, Vec<String>), String>;
|
||||
/// look draws), no object is unread or has another placement or drawn art that the page would
|
||||
/// choose, no linked image shows a placeholder, and its artboards are the pages, one for one and of their size, in points or in the pages'
|
||||
/// units ([`page_scale_alone`]). The document is drawn at that scale. Else `Err(structure)`, for
|
||||
/// [`build_from`] with the page.
|
||||
pub(super) fn build_without_page(structure: Structure, data: &[u8], pages: &[(f64, f64)], unit: f64) -> Result<Built, Box<Structure>> {
|
||||
let Some(scale) = alone_scale(&structure, data, pages, unit) else {
|
||||
/// [`build_from`] with the page. `text` keeps what was read of the text of `data` for the check and
|
||||
/// the build, and for any later build of `data`.
|
||||
pub(super) fn build_without_page(
|
||||
structure: Structure,
|
||||
data: &[u8],
|
||||
pages: &[(f64, f64)],
|
||||
unit: f64,
|
||||
text: &mut ReadText,
|
||||
) -> Result<Built, Box<Structure>> {
|
||||
let Some(scale) = alone_scale(&structure, data, pages, unit, text) else {
|
||||
return Err(Box::new(structure));
|
||||
};
|
||||
let (styles, own_size) = (structure.styles_read, structure.symbols_own_size);
|
||||
let built = build_from(structure, data, None, Page::Artboard, false, false, 1.0).map(|(mut doc, notes)| {
|
||||
let built = build_weighing(structure, data, None, Page::Artboard, false, false, 1.0, &mut None, text).map(|(mut doc, notes)| {
|
||||
if scale != 1.0 {
|
||||
// The graphic styles read from the file are drawn in its units too.
|
||||
scale_read_document(&mut doc, scale, styles, own_size);
|
||||
@@ -133,9 +140,56 @@ pub(super) fn build_without_page(structure: Structure, data: &[u8], pages: &[(f6
|
||||
}
|
||||
|
||||
/// The scale [`build_without_page`] draws `structure` (the editing copy `data` read) at on `pages`
|
||||
/// in units of `unit` points, when it builds it without the page.
|
||||
pub(super) fn alone_scale(structure: &Structure, data: &[u8], pages: &[(f64, f64)], unit: f64) -> Option<f64> {
|
||||
page_scale_alone(structure, pages, unit).filter(|_| nothing_waits_on_page(structure) && type_all_made(structure, data))
|
||||
/// in units of `unit` points, when it builds it without the page. `text` keeps what was read of the
|
||||
/// text of `data`.
|
||||
pub(super) fn alone_scale(structure: &Structure, data: &[u8], pages: &[(f64, f64)], unit: f64, text: &mut ReadText) -> Option<f64> {
|
||||
page_scale_alone(structure, pages, unit).filter(|_| nothing_waits_on_page(structure) && type_all_made(structure, data, text))
|
||||
}
|
||||
|
||||
/// The text objects' frames and the text document of an editing copy, each read the first time it
|
||||
/// is asked for and kept for every later check and build of the same copy.
|
||||
#[derive(Default)]
|
||||
pub(super) struct ReadText {
|
||||
/// [`ai::text_frames`] of the copy, once scanned.
|
||||
frames: Option<std::collections::HashMap<(u32, usize), kurbo::BezPath>>,
|
||||
/// [`Texts::read`] of the copy, once read: `Some(None)` when it has no text document that can
|
||||
/// be read.
|
||||
texts: Option<Option<Texts>>,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
thread_local! {
|
||||
/// While set, [`ReadText`] keeps nothing on this thread: each check and build reads the text afresh.
|
||||
pub(crate) static READ_AFRESH: std::cell::Cell<bool> = const { std::cell::Cell::new(false) };
|
||||
}
|
||||
|
||||
impl ReadText {
|
||||
/// Forgets what was read while [`READ_AFRESH`] is set (only in tests).
|
||||
fn forget_in_tests(&mut self) {
|
||||
#[cfg(test)]
|
||||
if READ_AFRESH.get() {
|
||||
*self = Self::default();
|
||||
}
|
||||
}
|
||||
|
||||
/// The `/Art` path of each text object of `data` ([`ai::text_frames`]).
|
||||
fn frames(&mut self, data: &[u8]) -> &std::collections::HashMap<(u32, usize), kurbo::BezPath> {
|
||||
self.forget_in_tests();
|
||||
self.frames.get_or_insert_with(|| ai::text_frames(data))
|
||||
}
|
||||
|
||||
/// The text document of `data` ([`Texts::read`]), if it has one that can be read.
|
||||
fn texts(&mut self, data: &[u8]) -> Option<&Texts> {
|
||||
self.forget_in_tests();
|
||||
self.texts.get_or_insert_with(|| Texts::read(data)).as_ref()
|
||||
}
|
||||
|
||||
/// [`Self::texts`] with its characters painted by `patterns` ([`Texts::with_patterns`]).
|
||||
fn texts_with(&mut self, data: &[u8], patterns: std::collections::HashMap<String, vectorcraft_color::Paint>) -> Option<&Texts> {
|
||||
self.forget_in_tests();
|
||||
let texts = self.texts.take().unwrap_or_else(|| Texts::read(data)).map(|t| t.with_patterns(patterns));
|
||||
self.texts.insert(texts).as_ref()
|
||||
}
|
||||
}
|
||||
|
||||
/// Is nothing in `structure` waiting on the page: no object unread (the page's art takes its
|
||||
@@ -152,17 +206,18 @@ fn nothing_waits_on_page(structure: &Structure) -> bool {
|
||||
|
||||
/// Does the text document of `data` (read as `structure`) make the type of every text object, those
|
||||
/// that don't show included, with at least one that shows, and none of them type that a look draws?
|
||||
fn type_all_made(structure: &Structure, data: &[u8]) -> bool {
|
||||
/// The frames and the text document are read into `text` when it doesn't have them yet.
|
||||
fn type_all_made(structure: &Structure, data: &[u8], text: &mut ReadText) -> bool {
|
||||
let mut infos = vec![];
|
||||
collect_slots(&structure.doc.layers, true, &mut infos);
|
||||
if !infos.iter().any(|i| i.shown) || infos.iter().any(|i| i.look.is_some()) {
|
||||
return false;
|
||||
}
|
||||
let frames = ai::text_frames(data);
|
||||
let frames = text.frames(data);
|
||||
for info in &mut infos {
|
||||
info.art_path = info.story.and_then(|s| frames.get(&(s, info.frame))).map(|p| PathData::from_bezpath(&(structure.to_doc * p.clone())));
|
||||
}
|
||||
let Some(texts) = Texts::read(data) else { return false };
|
||||
let Some(texts) = text.texts(data) else { return false };
|
||||
let mut read: std::collections::BTreeMap<u32, Option<Arc<Story>>> = Default::default();
|
||||
let stories: Vec<Option<Arc<Story>>> = infos
|
||||
.iter()
|
||||
@@ -244,13 +299,14 @@ pub(super) fn build_from(
|
||||
trust: bool,
|
||||
unit: f64,
|
||||
) -> Result<(Document, Vec<String>), String> {
|
||||
build_weighing(structure, data, visible, page, outlined, trust, unit, &mut None)
|
||||
build_weighing(structure, data, visible, page, outlined, trust, unit, &mut None, &mut ReadText::default())
|
||||
}
|
||||
|
||||
/// [`build_from`]. When the layers with their live envelopes don't draw as the page, and don't with
|
||||
/// the drawn art of every live envelope put back either, `free` is set to the envelopes of type
|
||||
/// (by their place among them, as read) that opened live and that the page doesn't hold against
|
||||
/// them ([`held_back`]), whether or not the layers are then used, and however.
|
||||
/// them ([`held_back`]), whether or not the layers are then used, and however. The text of `data`
|
||||
/// is taken from `text`, and read into it when it doesn't have it yet.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub(super) fn build_weighing(
|
||||
structure: Structure,
|
||||
@@ -261,6 +317,7 @@ pub(super) fn build_weighing(
|
||||
trust: bool,
|
||||
unit: f64,
|
||||
free: &mut Option<Vec<usize>>,
|
||||
text: &mut ReadText,
|
||||
) -> Result<(Document, Vec<String>), String> {
|
||||
let Structure {
|
||||
mut doc,
|
||||
@@ -425,7 +482,7 @@ pub(super) fn build_weighing(
|
||||
collect_slots(&doc.layers, true, &mut infos);
|
||||
super::slots::limit_look_slots(&mut doc.layers, &mut infos, shown.len(), outlined);
|
||||
// Each text object's own frame or path, by its story and frame.
|
||||
let frames = ai::text_frames(data);
|
||||
let frames = text.frames(data);
|
||||
for info in &mut infos {
|
||||
info.art_path = info.story.and_then(|s| frames.get(&(s, info.frame))).map(|p| PathData::from_bezpath(&(to_doc * p.clone())));
|
||||
}
|
||||
@@ -439,14 +496,14 @@ pub(super) fn build_weighing(
|
||||
// The page's type that needs no text object of the layers: the layers' own legacy text, or
|
||||
// placed files that show it.
|
||||
let as_outlines = page_type_elsewhere(infos.is_empty(), infos.iter().all(|i| !i.shown), &mut shown, &mut hidden, &doc, &placed_elsewhere)?;
|
||||
let texts = Texts::read(data).map(|t| t.with_patterns(text_patterns));
|
||||
let texts = text.texts_with(data, text_patterns);
|
||||
// Each story is read once, however many text objects name it.
|
||||
let mut read: std::collections::BTreeMap<u32, Option<Arc<Story>>> = Default::default();
|
||||
let stories: Vec<Option<Arc<Story>>> = infos
|
||||
.iter()
|
||||
.map(|i| {
|
||||
let n = i.story?;
|
||||
read.entry(n).or_insert_with(|| texts.as_ref().and_then(|t| t.story(n as usize)).map(Arc::new)).clone()
|
||||
read.entry(n).or_insert_with(|| texts.and_then(|t| t.story(n as usize)).map(Arc::new)).clone()
|
||||
})
|
||||
.collect();
|
||||
if stories.iter().flatten().map(|s| s.len()).sum::<usize>() > MAX_TEXT {
|
||||
@@ -3311,4 +3368,72 @@ mod candidate_tests {
|
||||
assert!(typed && kept.node(drawn[0].0).is_none() && kept.node(drawn[1].0).is_some());
|
||||
assert!(!notes.iter().any(|n| n.starts_with(DREW_DIFFERENTLY)), "{notes:?}");
|
||||
}
|
||||
|
||||
/// The editing copy of a 100 × 100 file whose one layer holds a square and `stories` objects of
|
||||
/// point type, each its own story, with the text document that makes them.
|
||||
fn many_stories(stories: u32) -> Vec<u8> {
|
||||
use crate::import::tests_native::{Story, layer, native_with_text, square, text_object, unsplit_text_document};
|
||||
let texts: Vec<String> = (0..stories).map(|i| format!("Story {i}\r")).collect();
|
||||
let anchor = |i: u32| (8170.0 + f64::from(i % 40), 8180.0 + f64::from(i / 40 % 40));
|
||||
let list: Vec<Story<'_>> = (0..stories).zip(&texts).map(|(i, t)| (t.as_str(), 0, anchor(i), (0.0, 0.0), 0.0)).collect();
|
||||
let objects: String = (0..stories).map(text_object).collect();
|
||||
native_with_text(&layer("Art", true, &format!("{}\n{objects}", square(10, 10))), &unsplit_text_document(&list)).into_bytes()
|
||||
}
|
||||
|
||||
/// The check and the build of layers that open without the page, each reading the text of the
|
||||
/// editing copy afresh, as [`build_without_page`] did before it read it once for both.
|
||||
fn alone_reading_twice(structure: Structure, data: &[u8], pages: &[(f64, f64)]) -> Option<Built> {
|
||||
let scale = alone_scale(&structure, data, pages, 1.0, &mut ReadText::default())?;
|
||||
assert_eq!(scale, 1.0);
|
||||
Some(build_from(structure, data, None, Page::Artboard, false, false, 1.0))
|
||||
}
|
||||
|
||||
/// Layers that open without the page, their text read once for the check and the build, come in
|
||||
/// as they do with the text read afresh for each.
|
||||
#[test]
|
||||
fn layers_alone_read_their_text_once_and_come_in_as_with_two_reads() {
|
||||
let data = many_stories(12);
|
||||
let read = || ai::read_over_page(&data, false, ai::NameEncoding::default()).unwrap();
|
||||
let pages = [(100.0, 100.0)];
|
||||
let Some(Ok(twice)) = alone_reading_twice(read(), &data, &pages) else { panic!("didn't open without the page") };
|
||||
let Ok(Ok(once)) = build_without_page(read(), &data, &pages, 1.0, &mut ReadText::default()) else { panic!("didn't open without the page") };
|
||||
assert_eq!(once, twice);
|
||||
let mut texts = vec![];
|
||||
once.0.walk(|n| {
|
||||
if let NodeKind::Text(t) = &n.kind {
|
||||
texts.push(t.plain_text());
|
||||
}
|
||||
});
|
||||
assert_eq!(texts.len(), 12, "{:?}", once.1);
|
||||
assert!(texts.iter().enumerate().all(|(i, t)| *t == format!("Story {i}")), "{texts:?}");
|
||||
}
|
||||
|
||||
/// The check and the build of layers that open without the page, 2,000 objects of point type in
|
||||
/// them, timed with the text read afresh for each and read once for both, alternating, seven runs
|
||||
/// of each: `cargo test -p vectorcraft-eps --lib -- --ignored --nocapture text_read_once_timing`.
|
||||
#[test]
|
||||
#[ignore = "a timing, run by hand"]
|
||||
fn text_read_once_timing() {
|
||||
let data = many_stories(2000);
|
||||
let read = || ai::read_over_page(&data, false, ai::NameEncoding::default()).unwrap();
|
||||
let pages = [(100.0, 100.0)];
|
||||
let (mut twice, mut once) = (vec![], vec![]);
|
||||
for _ in 0..7 {
|
||||
let structure = read();
|
||||
let start = std::time::Instant::now();
|
||||
let Some(Ok(a)) = alone_reading_twice(structure, &data, &pages) else { panic!("didn't open without the page") };
|
||||
twice.push(start.elapsed());
|
||||
let structure = read();
|
||||
let start = std::time::Instant::now();
|
||||
let Ok(Ok(b)) = build_without_page(structure, &data, &pages, 1.0, &mut ReadText::default()) else {
|
||||
panic!("didn't open without the page")
|
||||
};
|
||||
once.push(start.elapsed());
|
||||
assert_eq!(a, b);
|
||||
}
|
||||
println!("read twice: {twice:?}\nread once: {once:?}");
|
||||
twice.sort();
|
||||
once.sort();
|
||||
println!("median: read twice {:?}, read once {:?}", twice[3], once[3]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::build::{
|
||||
PAGE_MOVE, Page, alone_scale, build, build_from, build_on_page, build_weighing, build_without_page, reid_page_art, scale_symbol_art,
|
||||
PAGE_MOVE, Page, ReadText, alone_scale, build, build_from, build_on_page, build_weighing, build_without_page, reid_page_art, scale_symbol_art,
|
||||
};
|
||||
use super::slots::LAYERS_UNREAD;
|
||||
use super::{Affine, Arc, Cow, Document, Imported, Node, NodeKind, PathData, Rect, Vec2, ai};
|
||||
@@ -149,7 +149,7 @@ pub fn layered_ai_from(
|
||||
all.push(format!("{LAYERS_UNREAD} from its editing data ({why}): they come from its PDF part"));
|
||||
all
|
||||
};
|
||||
let AiLayers { data, structure, alone } = layers;
|
||||
let AiLayers { data, structure, alone, mut text } = layers;
|
||||
let data = match data {
|
||||
Ok(data) => data,
|
||||
Err(why) => return (visible, unread(warnings, &why), false),
|
||||
@@ -194,7 +194,7 @@ pub fn layered_ai_from(
|
||||
let (mut free, mut count) = (None, 0);
|
||||
let built = structure.unwrap_or_else(|| ai::read_over_page(&data, false, names).map(Box::new)).and_then(|structure| {
|
||||
count = structure.warped_type.envelope_count();
|
||||
build_weighing(*structure, &data, Some(&visible), Page::Artboard, outlined, trust, unit, &mut free)
|
||||
build_weighing(*structure, &data, Some(&visible), Page::Artboard, outlined, trust, unit, &mut free, &mut text)
|
||||
});
|
||||
// Layers that waited on the page only for their envelopes of type open alone, as they would
|
||||
// have without them, unless one opened live with the layers drawing as the page. Alone, each
|
||||
@@ -210,7 +210,7 @@ pub fn layered_ai_from(
|
||||
if let Some(free) = free.as_deref().filter(|free| !free.is_empty()) {
|
||||
structure.warped_type.open_alone(free, count);
|
||||
}
|
||||
build_without_page(structure, &data, &pages, unit).ok()?.ok()
|
||||
build_without_page(structure, &data, &pages, unit, &mut text).ok()?.ok()
|
||||
})
|
||||
{
|
||||
done.setup.bleed = visible.setup.bleed;
|
||||
@@ -248,27 +248,28 @@ fn holds_type_envelope(nodes: &[Arc<Node>]) -> bool {
|
||||
pub fn ai_layers_alone(private: &[u8], pages: &[(f64, f64)], unit: f64, names: ai::NameEncoding) -> Result<(Document, Vec<String>), AiLayers> {
|
||||
let data = match ai::decode_private(private) {
|
||||
Ok(data) => data,
|
||||
Err(why) => return Err(AiLayers { data: Err(why), structure: None, alone: None }),
|
||||
Err(why) => return Err(AiLayers { data: Err(why), structure: None, alone: None, text: Box::default() }),
|
||||
};
|
||||
if !has_layers(&data) {
|
||||
return Err(AiLayers { data: Ok(data), structure: None, alone: None });
|
||||
return Err(AiLayers { data: Ok(data), structure: None, alone: None, text: Box::default() });
|
||||
}
|
||||
// An image past the hard limits is read as an unread box, which the PDF part's art replaces.
|
||||
let structure = match ai::read_over_page(&data, false, names) {
|
||||
Ok(structure) => structure,
|
||||
Err(why) => return Err(AiLayers { data: Ok(data), structure: Some(Err(why)), alone: None }),
|
||||
Err(why) => return Err(AiLayers { data: Ok(data), structure: Some(Err(why)), alone: None, text: Box::default() }),
|
||||
};
|
||||
let mut text = Box::<ReadText>::default();
|
||||
// An envelope of type opens live only where the layers with it draw as the page, as the other
|
||||
// live envelopes do: the PDF part is imported to compare them with. Should none open live, the
|
||||
// layers open alone as they would have, the envelopes keeping their drawn art ([`layered_ai_from`]).
|
||||
if structure.warped_type.has_envelopes() && alone_scale(&structure, &data, pages, unit).is_some() {
|
||||
if structure.warped_type.has_envelopes() && alone_scale(&structure, &data, pages, unit, &mut text).is_some() {
|
||||
let alone = Some((pages.to_vec(), unit));
|
||||
return Err(AiLayers { data: Ok(data), structure: Some(Ok(Box::new(structure))), alone });
|
||||
return Err(AiLayers { data: Ok(data), structure: Some(Ok(Box::new(structure))), alone, text });
|
||||
}
|
||||
match build_without_page(structure, &data, pages, unit) {
|
||||
match build_without_page(structure, &data, pages, unit, &mut text) {
|
||||
Ok(Ok((doc, notes))) => Ok((doc, notes)),
|
||||
Ok(_) => Err(AiLayers { data: Ok(data), structure: None, alone: None }),
|
||||
Err(structure) => Err(AiLayers { data: Ok(data), structure: Some(Ok(structure)), alone: None }),
|
||||
Ok(_) => Err(AiLayers { data: Ok(data), structure: None, alone: None, text }),
|
||||
Err(structure) => Err(AiLayers { data: Ok(data), structure: Some(Ok(structure)), alone: None, text }),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,12 +284,14 @@ pub struct AiLayers {
|
||||
/// The pages and their unit the layers open on without the PDF part, when they wait on it only
|
||||
/// for their envelopes of type ([`ai_layers_alone`]).
|
||||
alone: Option<(Vec<(f64, f64)>, f64)>,
|
||||
/// The text objects' frames and the text document of the editing copy, as far as they were read.
|
||||
text: Box<ReadText>,
|
||||
}
|
||||
|
||||
impl AiLayers {
|
||||
/// The editing copy `private` (as [`layered_ai`] takes it), decoded.
|
||||
pub fn decode(private: &[u8]) -> Self {
|
||||
Self { data: ai::decode_private(private), structure: None, alone: None }
|
||||
Self { data: ai::decode_private(private), structure: None, alone: None, text: Box::default() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ fn native_large_canvas(size: f64, scale: f64, layers: &str) -> String {
|
||||
}
|
||||
|
||||
/// A layer as the format writes it.
|
||||
fn layer(name: &str, visible: bool, body: &str) -> String {
|
||||
pub(super) fn layer(name: &str, visible: bool, body: &str) -> String {
|
||||
format!("%AI5_BeginLayer\n{} 1 1 1 0 0 1 0 79 128 255 0 50 0 Lb\n({name}) Ln\n{body}\nLB\n%AI5_EndLayer--\n", u8::from(visible))
|
||||
}
|
||||
|
||||
/// A yellow square of 4 points at (`x`, `y`) in the format's operators.
|
||||
fn square(x: u32, y: u32) -> String {
|
||||
pub(super) fn square(x: u32, y: u32) -> String {
|
||||
format!("0 0 1 0 k\n{x} {y} m\n{} {y} L\n{} {} L\n{x} {} L\nf", x + 4, x + 4, y + 4, y + 4)
|
||||
}
|
||||
|
||||
@@ -3243,9 +3243,9 @@ fn custom_colours_open_paths_and_planar_group_marks_are_read() {
|
||||
/// A text document of `stories` (each as the text, its alignment code, its anchor and the frame's
|
||||
/// translation, and the start of its first line from the anchor), one font and a 14 point default.
|
||||
/// A story: its text, alignment code, anchor, frame translation and first line's start.
|
||||
type Story<'a> = (&'a str, u8, (f64, f64), (f64, f64), f64);
|
||||
pub(super) type Story<'a> = (&'a str, u8, (f64, f64), (f64, f64), f64);
|
||||
|
||||
fn text_document(stories: &[Story<'_>]) -> String {
|
||||
pub(super) fn text_document(stories: &[Story<'_>]) -> String {
|
||||
let story = |(text, align, anchor, _t, start): &Story<'_>| {
|
||||
let n = text.chars().count();
|
||||
format!(
|
||||
@@ -3290,7 +3290,7 @@ fn named_text_document(stories: &[Story<'_>]) -> String {
|
||||
|
||||
/// The editing copy of a 100 × 100 file with `layers` and the text `document`; its template box is
|
||||
/// centred at (50, 50).
|
||||
fn native_with_text(layers: &str, document: &str) -> String {
|
||||
pub(super) fn native_with_text(layers: &str, document: &str) -> String {
|
||||
let lines: Vec<String> = ascii85(document.as_bytes()).as_bytes().chunks(60).map(|c| format!("%{}", String::from_utf8_lossy(c))).collect();
|
||||
format!(
|
||||
"%!PS-Adobe-3.0 \n%%BoundingBox: 0 0 100 100\n%%HiResBoundingBox: 0 0 100 100\n%AI3_Cropmarks: 0 0 100 100\n%AI3_TemplateBox: 50 50 50 50\n\
|
||||
@@ -3299,8 +3299,18 @@ fn native_with_text(layers: &str, document: &str) -> String {
|
||||
)
|
||||
}
|
||||
|
||||
/// [`text_document`] of `stories`, padded so that [`native_with_text`] doesn't split the end of its
|
||||
/// data, `~>`, across two lines.
|
||||
pub(super) fn unsplit_text_document(stories: &[Story<'_>]) -> String {
|
||||
let mut doc = text_document(stories);
|
||||
while ascii85(doc.as_bytes()).len() % 60 == 1 {
|
||||
doc.push('\n');
|
||||
}
|
||||
doc
|
||||
}
|
||||
|
||||
/// A text object of story `story`, as the layers hold it.
|
||||
fn text_object(story: u32) -> String {
|
||||
pub(super) fn text_object(story: u32) -> String {
|
||||
format!("/AI11Text :\n0 /FreeUndo ,\n0 /FrameIndex ,\n{story} /StoryIndex ,\n2 /TextAntialiasing ,\n;\n")
|
||||
}
|
||||
|
||||
@@ -6058,6 +6068,94 @@ fn an_envelope_of_type_waits_on_the_page_of_layers_that_would_open_alone() {
|
||||
assert_eq!(loose, [("Note".to_string(), true)], "{notes:?}");
|
||||
}
|
||||
|
||||
/// What `f` returns, with how many times it read a text document and scanned the text objects'
|
||||
/// frames of an editing copy on this thread; with `afresh`, each check and build reads them anew,
|
||||
/// keeping nothing for the next.
|
||||
fn text_reads<T>(afresh: bool, f: impl FnOnce() -> T) -> (T, u64, u64) {
|
||||
crate::import::ate::TEXTS_READS.set(0);
|
||||
crate::import::ai::TEXT_FRAME_SCANS.set(0);
|
||||
crate::import::native::READ_AFRESH.set(afresh);
|
||||
let out = f();
|
||||
crate::import::native::READ_AFRESH.set(false);
|
||||
(out, crate::import::ate::TEXTS_READS.get(), crate::import::ai::TEXT_FRAME_SCANS.get())
|
||||
}
|
||||
|
||||
/// A `.ai` that opens without its PDF part reads its text document and scans its text objects'
|
||||
/// frames once, for the check that its text document makes all of its type and for the build, and
|
||||
/// comes in as it does when each reads them anew.
|
||||
#[test]
|
||||
fn layers_that_open_alone_read_their_text_once() {
|
||||
let doc = unsplit_text_document(&[("Hi there\r", 0, (8200.0, 8180.0), (0.0, 0.0), 0.0), ("Mid\r", 2, (8191.5, 8191.5), (0.0, 0.0), -10.0)]);
|
||||
let art = layer("Art", true, &format!("{}\n{}{}", square(10, 10), text_object(0), text_object(1)));
|
||||
let file = private(&native_with_text(&art, &doc));
|
||||
let open = || crate::ai_layers_alone(&file, &[(100.0, 100.0)], 1.0, crate::NameEncoding::default()).ok();
|
||||
let (opened, texts, frames) = text_reads(false, open);
|
||||
let Some((d, notes)) = opened else { panic!("didn't open without the page") };
|
||||
assert_eq!((texts, frames), (1, 1), "{notes:?}");
|
||||
assert_eq!(text_of(&d.layers[0]).iter().map(|t| t.plain_text()).collect::<Vec<_>>(), ["Hi there", "Mid"], "{notes:?}");
|
||||
let (afresh, texts, frames) = text_reads(true, open);
|
||||
assert_eq!((texts, frames), (2, 2));
|
||||
assert_eq!(afresh, Some((d, notes)));
|
||||
}
|
||||
|
||||
/// Layers whose text document can't be read wait on the PDF part, which then doesn't read the text
|
||||
/// document or scan the frames again, and come in as they do when each check and build reads them
|
||||
/// anew.
|
||||
#[test]
|
||||
fn layers_whose_text_document_cannot_be_read_read_it_once_with_the_page() {
|
||||
let art = layer("Art", true, &format!("{}\n{}", square(10, 10), text_object(0)));
|
||||
let file = private(&native_with_text(&art, "not a text document"));
|
||||
let names = crate::NameEncoding::default();
|
||||
let open = || {
|
||||
let Err(layers) = crate::ai_layers_alone(&file, &[(100.0, 100.0)], 1.0, names) else { panic!("opened without the page") };
|
||||
crate::layered_ai_from(layers, pdf_part(10.0, 86.0), vec![], false, false, 1.0, names)
|
||||
};
|
||||
let (opened, texts, frames) = text_reads(false, open);
|
||||
assert_eq!((texts, frames), (1, 1), "{:?}", opened.1);
|
||||
let (afresh, texts, frames) = text_reads(true, open);
|
||||
assert_eq!((texts, frames), (2, 2), "{:?}", afresh.1);
|
||||
assert_eq!(opened, afresh);
|
||||
}
|
||||
|
||||
/// An envelope of type that waits on the PDF part reads the text document and scans the frames
|
||||
/// once, for the check before the PDF part is imported, the build with it, and the build without it
|
||||
/// that follows when the envelope doesn't open live, and the file comes in as it does when each of
|
||||
/// them reads them anew.
|
||||
#[test]
|
||||
fn an_envelope_of_type_waiting_on_the_page_reads_the_text_once() {
|
||||
let Some(family) = installed_family() else { return };
|
||||
let stories = [("FLUX\r", 0, (8170.0, 8180.0), (0.0, 0.0), 0.0), ("Note\r", 0, (8170.0, 8220.0), (0.0, 0.0), 0.0)];
|
||||
let mut doc = text_document(&stories).replace("(Helvetica)", &format!("({family})"));
|
||||
while ascii85(doc.as_bytes()).len() % 60 == 1 {
|
||||
doc.push('\n');
|
||||
}
|
||||
let (drawn, _) = drawn_envelope(&arc_envelope(&made_envelope_type(&doc), 30.0));
|
||||
let art = format!("u\n{}U\n{}", text_object(1), type_envelope(&arc_keys(0.3), &drawn));
|
||||
let file = private(&native_with_text(&layer("Art", true, &art), &doc));
|
||||
let names = crate::NameEncoding::default();
|
||||
let open = |page: Document| {
|
||||
let Err(layers) = crate::ai_layers_alone(&file, &[(100.0, 100.0)], 1.0, names) else { panic!("opened without the page") };
|
||||
crate::layered_ai_from(layers, page, vec![], false, false, 1.0, names)
|
||||
};
|
||||
// A PDF part the layers don't draw as: they open alone, after a build with the page and one without.
|
||||
let (opened, texts, frames) = text_reads(false, || open(pdf_part(80.0, 80.0)));
|
||||
assert_eq!((texts, frames), (1, 1), "{:?}", opened.1);
|
||||
let (afresh, texts, frames) = text_reads(true, || open(pdf_part(80.0, 80.0)));
|
||||
assert_eq!((texts, frames), (4, 4), "{:?}", afresh.1);
|
||||
assert_eq!(opened, afresh);
|
||||
let (envelopes, _) = envelopes_and_type(&opened.0);
|
||||
assert!(opened.2 && envelopes.is_empty(), "{envelopes:?} {:?}", opened.1);
|
||||
// A PDF part that draws as those layers, with the drawn art: the envelope opens live.
|
||||
let page = opened.0;
|
||||
let (opened, texts, frames) = text_reads(false, || open(page.clone()));
|
||||
assert_eq!((texts, frames), (1, 1), "{:?}", opened.1);
|
||||
let (afresh, texts, frames) = text_reads(true, || open(page));
|
||||
assert_eq!((texts, frames), (2, 2), "{:?}", afresh.1);
|
||||
assert_eq!(opened, afresh);
|
||||
let (envelopes, _) = envelopes_and_type(&opened.0);
|
||||
assert_eq!(envelopes, [vec!["FLUX".to_string()]], "{:?}", opened.1);
|
||||
}
|
||||
|
||||
/// The hidden type outside envelopes in the layers of `d`: each text object's name.
|
||||
fn loose_type_names(d: &Document) -> Vec<Option<String>> {
|
||||
let mut out = vec![];
|
||||
|
||||
@@ -1336,7 +1336,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"ui.dialogReset",
|
||||
"Reset",
|
||||
"",
|
||||
"{} the open dialog's Reset, which its Cancel button reads while Alt (Option on macOS) is held (Flare Tool Options, dialog `flareOptions`): its fields go back to their defaults and the dialog stays open, so OK applies them → the dialog; an error when no dialog is open or the open one has no Reset",
|
||||
"{} the open dialog's Reset, which its Cancel button reads while Alt (Option on macOS) is held (Flare Tool Options, dialog `flareOptions`; Save PDF, dialog `savePdf`): its fields go back to their defaults (Save PDF: the chosen preset's settings, with the path and artboards kept) and the dialog stays open, so OK applies them → the dialog; an error when no dialog is open, the open one has no Reset, or Save PDF's chosen preset was deleted (the fields stay as they are)",
|
||||
),
|
||||
(
|
||||
"ui.justification",
|
||||
|
||||
@@ -9,7 +9,7 @@ use vectorcraft_color::cms::{self, Cms, Model, ProfileKind};
|
||||
use vectorcraft_color::swatch::REGISTRATION;
|
||||
use vectorcraft_color::{BlendMode, Color, GradientKind, Paint};
|
||||
use vectorcraft_doc::inks::{Link, StopPlates, inks, plates, spot_color, stop_inks, visit_node_colors};
|
||||
use vectorcraft_doc::overprint::{darken_overprints, is_white};
|
||||
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};
|
||||
@@ -135,17 +135,26 @@ impl<'a> Separator<'a> {
|
||||
|
||||
/// Whether paint `p` puts none of ink `plate` down: a solid color, a gradient whose every stop
|
||||
/// does, or a freeform gradient with color points whose every point does (points carry no
|
||||
/// swatch link). On PostScript plates, to within half a percent (the other inks a black may
|
||||
/// carry and still count as black, [`vectorcraft_doc::overprint::is_black_ink`]).
|
||||
/// swatch link). Any ink above zero puts ink down, except on PostScript plates for a color that
|
||||
/// counts as 100% black ([`vectorcraft_doc::overprint::is_black_ink`], as
|
||||
/// [`vectorcraft_doc::overprint::OverprintBlack::default`] judges it) and is not linked to a
|
||||
/// spot swatch, to Registration or to a swatch the document lacks: up to the half a percent of
|
||||
/// another ink such a black may carry counts as none.
|
||||
fn no_ink(&self, plate: &str, p: &Paint) -> bool {
|
||||
let none = if self.postscript { 0.005 } else { 0.0 };
|
||||
let process = |swatch: Option<&str>| swatch.is_none_or(|n| n != REGISTRATION && self.doc.swatch(n).is_some_and(|w| !w.spot));
|
||||
let none = |c: &Color, process: bool, ink: f32| ink <= 0.0 || (self.postscript && process && ink <= 0.005 && is_black_ink(c, 1.0, false));
|
||||
match p {
|
||||
Paint::Solid { color, swatch, tint } => self.ink(plate, color, swatch.as_deref().map(|s| (s, *tint))) <= none,
|
||||
Paint::Solid { color, swatch, tint } => {
|
||||
none(color, process(swatch.as_deref()), self.ink(plate, color, swatch.as_deref().map(|s| (s, *tint))))
|
||||
}
|
||||
Paint::Gradient(g) => match g.freeform.as_ref().filter(|f| g.gradient.kind == GradientKind::Freeform && !f.points.is_empty()) {
|
||||
Some(f) => f.points.iter().all(|pt| self.ink(plate, &pt.color, None) <= none),
|
||||
Some(f) => f.points.iter().all(|pt| none(&pt.color, true, self.ink(plate, &pt.color, None))),
|
||||
None => {
|
||||
!g.gradient.stops.is_empty()
|
||||
&& g.gradient.stops.iter().all(|s| self.stop_ink(plate, &s.color, s.swatch.as_deref().map(|n| (n, s.tint)), s.plates) <= none)
|
||||
&& g.gradient.stops.iter().all(|s| {
|
||||
let ink = self.stop_ink(plate, &s.color, s.swatch.as_deref().map(|n| (n, s.tint)), s.plates);
|
||||
none(&s.color, s.plates.is_none() && process(s.swatch.as_deref()), ink)
|
||||
})
|
||||
}
|
||||
},
|
||||
_ => false,
|
||||
@@ -156,7 +165,9 @@ impl<'a> Separator<'a> {
|
||||
/// overprinting character fills and strokes, that put none of ink `plate` down leave its plate
|
||||
/// as it is: they are drawn as nothing on it (white ones with `discard_white` aside, which
|
||||
/// knock out). A writer without blending modes (PostScript) then keeps the ink below them,
|
||||
/// where it would draw their Darken as a knockout.
|
||||
/// where it would draw their Darken as a knockout. One that puts any ink down is drawn, and on
|
||||
/// a PostScript plate its ink replaces the ink below, as a nonzero component of an overprinting
|
||||
/// color replaces the backdrop's with overprint mode 1 (ISO 32000-1, 11.7.4.2).
|
||||
fn clear_inkless_overprints(&self, plate: &str, a: &mut Arc<Node>, discard_white: bool) {
|
||||
let inkless = |overprint: bool, p: &Paint| overprint && !p.is_none() && !(discard_white && is_white(p)) && self.no_ink(plate, p);
|
||||
let n = Arc::make_mut(a);
|
||||
|
||||
@@ -747,7 +747,7 @@ fn overprint_black_keeps_the_cyan_under_near_and_freeform_blacks_on_postscript_p
|
||||
#[test]
|
||||
fn an_overprinting_fill_keeps_its_faint_ink_on_pdf_plates() {
|
||||
// 0.4% cyan beside 100% K, set to overprint: a PDF plate draws it with Darken, a PostScript
|
||||
// plate draws it as nothing (it has no blending modes).
|
||||
// plate (it has no blending modes) draws it as nothing, since the color counts as black.
|
||||
let mut square = Node::path(
|
||||
vectorcraft_doc::NodeId(0),
|
||||
shapes::rectangle(Rect::new(10.0, 15.0, 30.0, 35.0)),
|
||||
@@ -767,6 +767,79 @@ fn an_overprinting_fill_keeps_its_faint_ink_on_pdf_plates() {
|
||||
assert_eq!((fills(false), fills(true)), (2, 1), "the cyan plate as PDF, as PostScript");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overprinting_paints_keep_their_faint_ink_on_postscript_plates() {
|
||||
// 0.4% cyan in a color that is not black, set to overprint, on a fill, a stroke, a character
|
||||
// fill, a linear gradient's stop and a freeform gradient's point: the cyan plate draws it on
|
||||
// PDF and PostScript plates alike. A magenta with no cyan at all draws as nothing.
|
||||
let faint = Color::cmyk(0.004, 0.5, 0.0, 0.0);
|
||||
let magenta = Color::cmyk(0.0, 0.5, 0.0, 0.0);
|
||||
let square = |x: f64, fill: Paint, stroke: Paint| {
|
||||
let mut n =
|
||||
Node::path(vectorcraft_doc::NodeId(0), shapes::rectangle(Rect::new(x, 15.0, x + 20.0, 35.0)), Appearance::basic(fill, stroke, 2.0));
|
||||
if let Some(f) = n.appearance.fill_mut() {
|
||||
f.overprint = true;
|
||||
}
|
||||
if let Some(s) = n.appearance.stroke_mut() {
|
||||
s.overprint = true;
|
||||
}
|
||||
n
|
||||
};
|
||||
let linear = GradientPaint::new(Gradient::new(GradientKind::Linear, vec![GradientStop::new(0.0, faint), GradientStop::new(1.0, magenta)]));
|
||||
let mut freeform =
|
||||
GradientPaint::new(Gradient::new(GradientKind::Freeform, vec![GradientStop::new(0.0, magenta), GradientStop::new(1.0, magenta)]));
|
||||
let points = vec![FreeformPoint::new(kurbo::Point::new(105.0, 20.0), magenta), FreeformPoint::new(kurbo::Point::new(115.0, 30.0), faint)];
|
||||
freeform.freeform = Some(Freeform { points, ..Default::default() });
|
||||
let style = vectorcraft_doc::CharStyle { fill: Paint::solid(faint), overprint_fill: true, ..Default::default() };
|
||||
let text = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::new(20.0, 60.0), "Hi", style);
|
||||
let d = over_cyan(vec![
|
||||
square(10.0, Paint::solid(faint), Paint::None),
|
||||
square(40.0, Paint::None, Paint::solid(faint)),
|
||||
square(70.0, Paint::Gradient(Box::new(linear)), Paint::None),
|
||||
square(100.0, Paint::Gradient(Box::new(freeform)), Paint::None),
|
||||
square(130.0, Paint::solid(magenta), Paint::None),
|
||||
Node::new(vectorcraft_doc::NodeId(0), NodeKind::Text(Box::new(text))),
|
||||
// A black linked to the spot swatch at a 0.4% tint: 0.4% on the spot plate, none on the cyan.
|
||||
square(160.0, Paint::Solid { color: Color::cmyk(0.0, 0.0, 0.0, 1.0), swatch: Some("Ink".into()), tint: 0.004 }, Paint::None),
|
||||
]);
|
||||
let opts = PrintOptions { settings: settings(json!({"output": {"mode": "separations"}})), postscript: true, ..Default::default() };
|
||||
let p = plan(&d, &opts).unwrap();
|
||||
let mut spot = vec![];
|
||||
p.plates[4].walk(|n| {
|
||||
spot.extend(n.appearance.fill().and_then(|f| f.paint.color()).map(|c| match c {
|
||||
Color::Gray { k } => (k * 1000.0).round(),
|
||||
c => panic!("{c:?}"),
|
||||
}))
|
||||
});
|
||||
assert!(spot.contains(&4.0), "the PostScript spot plate draws the spot tint: {spot:?}");
|
||||
// The fills, strokes and character fills the cyan plate draws, and the gray of the solid fills.
|
||||
let drawn = |postscript: bool| {
|
||||
let opts = PrintOptions { settings: settings(json!({"output": {"mode": "separations"}})), postscript, ..Default::default() };
|
||||
let p = plan(&d, &opts).unwrap();
|
||||
let (mut fills, mut strokes, mut chars, mut grays) = (0, 0, 0, vec![]);
|
||||
p.plates[0].walk(|n| {
|
||||
if let Some(f) = n.appearance.fill().filter(|f| !f.paint.is_none()) {
|
||||
fills += 1;
|
||||
if let Some(Color::Gray { k }) = f.paint.color() {
|
||||
grays.push((k * 1000.0).round());
|
||||
}
|
||||
}
|
||||
strokes += usize::from(n.appearance.stroke().is_some_and(|s| !s.paint.is_none()));
|
||||
if let NodeKind::Text(t) = &n.kind {
|
||||
chars += t.runs.iter().filter(|r| !r.style.fill.is_none()).count();
|
||||
}
|
||||
});
|
||||
(fills, strokes, chars, grays)
|
||||
};
|
||||
for postscript in [false, true] {
|
||||
let (fills, strokes, chars, grays) = drawn(postscript);
|
||||
let at = if postscript { "PostScript" } else { "PDF" };
|
||||
assert_eq!((strokes, chars), (1, 1), "{at}: the stroke and the character fill");
|
||||
assert_eq!(fills, 4, "{at}: the cyan, the faint fill and both gradients, not the magenta");
|
||||
assert_eq!(grays, [1000.0, 4.0], "{at}: the cyan and the faint fill's 0.4%");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn overprinting_type_leaves_the_inks_below_on_separations() {
|
||||
let style = vectorcraft_doc::CharStyle { fill: Paint::solid(Color::cmyk(0.0, 0.0, 0.0, 1.0)), ..Default::default() };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Raster export: render a document region with [`RasterExportOptions`] (resolution, background,
|
||||
//! anti-aliasing) and encode it as PNG ([`png`]: resolution in `pHYs`, Adam7 interlacing), JPEG
|
||||
//! ([`jpeg`]: RGB, CMYK or grey, progressive, resolution and colour profile), lossless WebP, or
|
||||
//! ([`jpeg`]: RGB, CMYK or grey, progressive, resolution and colour profile), lossless or lossy WebP, or
|
||||
//! a palette image ([`quantize`]) as PNG-8 or [`gif`], [`tiff`] (RGB, CMYK or grey, LZW, either byte
|
||||
//! order, the profile), [`bmp`] (1–32 bits, RLE) or [`tga`]; [`web`] adds what Save for Web optimises
|
||||
//! further (web snap, colour table edits, lossy GIF, comments); [`psd`] writes layered bitmaps.
|
||||
@@ -49,8 +49,10 @@ pub struct RasterExportOptions {
|
||||
pub anti_alias: AntiAlias,
|
||||
/// PNG, PNG-8: Adam7 interlacing; GIF: interlaced rows.
|
||||
pub interlaced: bool,
|
||||
/// JPEG quality 0–100.
|
||||
/// JPEG quality 0–100, and lossy WebP's.
|
||||
pub quality: u8,
|
||||
/// WebP: lossless (`true`), or lossy at [`Self::quality`].
|
||||
pub webp_lossless: bool,
|
||||
/// JPEG colour model, coding and profile.
|
||||
pub jpeg: jpeg::JpegOptions,
|
||||
/// PNG-8 and GIF: the colour reduction (also BMP's at 1, 4 and 8 bits).
|
||||
@@ -76,6 +78,7 @@ impl Default for RasterExportOptions {
|
||||
anti_alias: AntiAlias::Art,
|
||||
interlaced: false,
|
||||
quality: 90,
|
||||
webp_lossless: true,
|
||||
jpeg: jpeg::JpegOptions::default(),
|
||||
palette: quantize::PaletteOptions::default(),
|
||||
tiff: tiff::TiffOptions::default(),
|
||||
@@ -125,7 +128,7 @@ impl RasterExportOptions {
|
||||
};
|
||||
jpeg::encode(&px, img.width, img.height, self.quality, Some(self.ppi), &self.jpeg)
|
||||
}
|
||||
RasterFormat::WebP => webp(img),
|
||||
RasterFormat::WebP => webp(img, (!self.webp_lossless).then_some(self.quality)),
|
||||
RasterFormat::Png8 | RasterFormat::Gif => {
|
||||
let ix = quantize::quantize(&img.to_straight(), img.width, img.height, &self.palette);
|
||||
match format {
|
||||
@@ -184,8 +187,9 @@ pub fn on_white(p: &[u8; 4]) -> [u8; 3] {
|
||||
[0, 1, 2].map(|i| ((u32::from(p[i]) * a + 255 * (255 - a) + 127) / 255) as u8)
|
||||
}
|
||||
|
||||
/// Lossless WebP.
|
||||
pub(crate) fn webp(img: &Rendered) -> Result<Vec<u8>, String> {
|
||||
/// WebP: lossless (`VP8L`) when `lossy_quality` is `None`, else lossy (`VP8 `, with an `ALPH`
|
||||
/// chunk when some pixels are not opaque) at that quality 0–100.
|
||||
pub(crate) fn webp(img: &Rendered, lossy_quality: Option<u8>) -> Result<Vec<u8>, String> {
|
||||
let src = craft_image_codecs::Image::from_raw(
|
||||
img.width,
|
||||
img.height,
|
||||
@@ -194,8 +198,40 @@ pub(crate) fn webp(img: &Rendered) -> Result<Vec<u8>, String> {
|
||||
img.to_straight(),
|
||||
)
|
||||
.map_err(|e| format!("WebP encoding failed: {e}"))?;
|
||||
let opts = craft_image_codecs::EncodeOptions { webp_lossless: true, ..craft_image_codecs::EncodeOptions::default() };
|
||||
craft_image_codecs::encode(&src, craft_image_codecs::Format::WebP, &opts).map_err(|e| format!("WebP encoding failed: {e}"))
|
||||
let opts = craft_image_codecs::EncodeOptions {
|
||||
webp_lossless: lossy_quality.is_none(),
|
||||
webp_quality: lossy_quality.unwrap_or(100).min(100),
|
||||
..craft_image_codecs::EncodeOptions::default()
|
||||
};
|
||||
let file = craft_image_codecs::encode(&src, craft_image_codecs::Format::WebP, &opts).map_err(|e| format!("WebP encoding failed: {e}"))?;
|
||||
if lossy_quality.is_some() && vp8_partition_at_limit(&file) {
|
||||
return Err("WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless".into());
|
||||
}
|
||||
Ok(file)
|
||||
}
|
||||
|
||||
/// The largest first-partition size a VP8 key frame's 19-bit size field holds (RFC 6386 §9.1).
|
||||
const VP8_FIRST_PARTITION_LIMIT: u32 = (1 << 19) - 1;
|
||||
|
||||
/// Does the `VP8 ` chunk of RIFF WebP `file` give its first partition the size limit? The encoder
|
||||
/// writes the limit for a larger partition too, and a decoder then reads the token partition from
|
||||
/// the wrong offset, so a frame at the limit is not written.
|
||||
fn vp8_partition_at_limit(file: &[u8]) -> bool {
|
||||
let mut at = 12usize;
|
||||
while let Some(head) = file.get(at..).and_then(|rest| rest.get(..8)) {
|
||||
let len = u32::from_le_bytes([head[4], head[5], head[6], head[7]]);
|
||||
if &head[..4] == b"VP8 " {
|
||||
return file.get(at + 8..).and_then(|rest| rest.get(..3)).is_some_and(|tag| {
|
||||
let tag = u32::from(tag[0]) | (u32::from(tag[1]) << 8) | (u32::from(tag[2]) << 16);
|
||||
tag >> 5 >= VP8_FIRST_PARTITION_LIMIT
|
||||
});
|
||||
}
|
||||
let Some(next) = usize::try_from(u64::from(len) + u64::from(len % 2) + 8).ok().and_then(|n| at.checked_add(n)) else {
|
||||
break;
|
||||
};
|
||||
at = next;
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
/// Bounds of the art an export draws: visible objects off template layers (guides left out),
|
||||
|
||||
@@ -202,6 +202,84 @@ fn backgrounds_are_opaque_or_transparent() {
|
||||
assert_eq!(webp.get_pixel(0, 0).0, [0, 0, 0, 255]);
|
||||
}
|
||||
|
||||
/// The chunk types of RIFF WebP file `file`, in order.
|
||||
fn webp_chunks(file: &[u8]) -> Vec<[u8; 4]> {
|
||||
assert_eq!((&file[..4], &file[8..12]), (&b"RIFF"[..], &b"WEBP"[..]));
|
||||
let mut chunks = Vec::new();
|
||||
let mut at = 12;
|
||||
while at + 8 <= file.len() {
|
||||
let len = u32::from_le_bytes([file[at + 4], file[at + 5], file[at + 6], file[at + 7]]) as usize;
|
||||
chunks.push([file[at], file[at + 1], file[at + 2], file[at + 3]]);
|
||||
at += 8 + len + len % 2;
|
||||
}
|
||||
chunks
|
||||
}
|
||||
|
||||
/// Lossy WebP is a `VP8 ` picture; transparent pixels stay transparent through an `ALPH` chunk
|
||||
/// in a `VP8X` file, and opaque art stays opaque.
|
||||
#[test]
|
||||
fn lossy_webp_keeps_transparent_pixels_transparent() {
|
||||
let d = circle_doc();
|
||||
let lossless = Renderer::new().export_region(&d, d.artboards[0].rect, RasterFormat::WebP, &RasterExportOptions::default()).unwrap();
|
||||
assert_eq!(webp_chunks(&lossless), [*b"VP8L"], "lossless by default");
|
||||
let o = RasterExportOptions { webp_lossless: false, quality: 75, ..Default::default() };
|
||||
let file = Renderer::new().export_region(&d, d.artboards[0].rect, RasterFormat::WebP, &o).unwrap();
|
||||
assert_eq!(webp_chunks(&file), [*b"VP8X", *b"ALPH", *b"VP8 "]);
|
||||
let img = export(&d, RasterFormat::WebP, &o);
|
||||
assert_eq!(img.dimensions(), (40, 30));
|
||||
assert_eq!(img.get_pixel(0, 0)[3], 0, "a corner outside the circle");
|
||||
let middle = img.get_pixel(20, 15);
|
||||
assert!(middle[3] == 255 && middle[0] < 24, "{middle:?}");
|
||||
// Opaque art on a background is a plain `VP8 ` file.
|
||||
let opaque = RasterExportOptions { background: Some([255; 3]), ..o };
|
||||
let file = Renderer::new().export_region(&d, d.artboards[0].rect, RasterFormat::WebP, &opaque).unwrap();
|
||||
assert_eq!(webp_chunks(&file), [*b"VP8 "]);
|
||||
}
|
||||
|
||||
/// A lossy frame's tag (RFC 6386 §9.1) holds its first partition's size in 19 bits. A frame whose
|
||||
/// size field is at that limit may hold a larger partition, so it is refused; frames below it
|
||||
/// decode with another decoder at every quality, a 1 × 1 image and transparent pixels included.
|
||||
#[test]
|
||||
fn lossy_webp_refuses_a_first_partition_at_the_size_limit() {
|
||||
let circle = circle_doc();
|
||||
let dot = Document::new(1.0, 1.0);
|
||||
for (d, background) in [(&circle, None), (&circle, Some([255; 3])), (&dot, Some([40, 80, 120]))] {
|
||||
for quality in [0, 50, 100] {
|
||||
let o = RasterExportOptions { webp_lossless: false, quality, background, ..Default::default() };
|
||||
let mut file = Renderer::new().export_region(d, d.artboards[0].rect, RasterFormat::WebP, &o).unwrap();
|
||||
let decoded = image::load_from_memory_with_format(&file, image::ImageFormat::WebP).unwrap();
|
||||
let rect = d.artboards[0].rect;
|
||||
assert_eq!((decoded.width(), decoded.height()), (rect.width() as u32, rect.height() as u32), "quality {quality}");
|
||||
assert!(!vp8_partition_at_limit(&file), "quality {quality}");
|
||||
let vp8 = chunk_offset(&file, b"VP8 ") + 8;
|
||||
let tag = u32::from(file[vp8]) | (u32::from(file[vp8 + 1]) << 8) | (u32::from(file[vp8 + 2]) << 16);
|
||||
let len = u32::from_le_bytes(file[vp8 - 4..vp8].try_into().unwrap());
|
||||
assert_eq!((tag & 1, &file[vp8 + 3..vp8 + 6]), (0, &[0x9d, 0x01, 0x2a][..]), "a key frame with its start code");
|
||||
assert!((tag >> 5) + 10 <= len, "the first partition fits in the chunk");
|
||||
// The size field at its limit.
|
||||
let at_limit = (tag & 0x1f) | (VP8_FIRST_PARTITION_LIMIT << 5);
|
||||
file[vp8..vp8 + 3].copy_from_slice(&at_limit.to_le_bytes()[..3]);
|
||||
assert!(vp8_partition_at_limit(&file), "quality {quality}");
|
||||
}
|
||||
}
|
||||
let lossless = Renderer::new().export_region(&circle, circle.artboards[0].rect, RasterFormat::WebP, &RasterExportOptions::default()).unwrap();
|
||||
assert!(!vp8_partition_at_limit(&lossless));
|
||||
// Cut short or with a chunk length past the end, the scan stops without a frame.
|
||||
for bad in [&b"RIFF\0\0\0\0WEBP"[..], b"RIFF\0\0\0\0WEBPVP8 ", b"RIFF\0\0\0\0WEBPXXXX\xff\xff\xff\xffVP8 \x04\0\0\0\xff\xff\xff\0", b""] {
|
||||
assert!(!vp8_partition_at_limit(bad), "{bad:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// The offset of the first chunk of type `ty` in RIFF WebP `file`.
|
||||
fn chunk_offset(file: &[u8], ty: &[u8; 4]) -> usize {
|
||||
let mut at = 12;
|
||||
while &file[at..at + 4] != ty {
|
||||
let len = u32::from_le_bytes(file[at + 4..at + 8].try_into().unwrap()) as usize;
|
||||
at += 8 + len + len % 2;
|
||||
}
|
||||
at
|
||||
}
|
||||
|
||||
/// #787: translucent art over opaque art (or a background) stays exactly opaque, its anti-aliased
|
||||
/// edges too, so the file is written as RGB.
|
||||
#[test]
|
||||
|
||||
@@ -419,7 +419,7 @@ impl Rendered {
|
||||
}
|
||||
/// Encode as lossless WebP.
|
||||
pub fn to_webp(&self) -> Result<Vec<u8>, String> {
|
||||
encode::webp(self)
|
||||
encode::webp(self, None)
|
||||
}
|
||||
/// Straight-alpha RGBA at (x, y).
|
||||
pub fn pixel(&self, x: u32, y: u32) -> [u8; 4] {
|
||||
|
||||
@@ -267,6 +267,12 @@ impl VectorcraftApp {
|
||||
{
|
||||
self.ui.status = w.to_string();
|
||||
}
|
||||
// A renamed spot color swatch stays the Color Guide's base.
|
||||
if id == "swatch.edit"
|
||||
&& let (Some(from), Some(to)) = (params["name"].as_str(), v["name"].as_str())
|
||||
{
|
||||
crate::panels::color_guide::swatch_renamed(self, from, to);
|
||||
}
|
||||
if id == "file.new" {
|
||||
self.ui.status.clear();
|
||||
// New Document's Pixel preview mode (Overprint Preview is the engine's).
|
||||
|
||||
+174
-25
@@ -82,10 +82,8 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
ui.add_space(2.0);
|
||||
// With the macOS menu bar the menus are at the top of the screen instead.
|
||||
let menus_end = if app.services.native_menu.is_some() { ui.cursor().min.x } else { menus::menu_bar(app, ui) };
|
||||
// The right-side group fills the space after the menus from the right; when it runs
|
||||
// short, Discord goes first (it is also under Help), then Explore tutorials (also
|
||||
// Window › Learn), then the search icon (the palette stays under its shortcut), then
|
||||
// the workspace switcher narrows.
|
||||
// The right-side group fills the space after the menus from the right, in the order
|
||||
// [`fit_right_group`] gives.
|
||||
let full = ui.max_rect();
|
||||
let right_edge = if captions_right > 0.0 { full.right() - captions_right - 10.0 } else { full.right() };
|
||||
let right = egui::Rect::from_min_max(egui::pos2(menus_end + 8.0, full.top()), egui::pos2(right_edge, full.bottom()));
|
||||
@@ -97,21 +95,22 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let text = ui.painter().layout_no_wrap(label.text().to_string(), egui::FontId::proportional(12.0), t.warning);
|
||||
text.size().x + 2.0 * ui.spacing().button_padding.x + 8.0 + ui.spacing().item_spacing.x
|
||||
});
|
||||
let room = (right.width() - safe_w).max(0.0);
|
||||
let switcher = safe.is_none() || room >= 64.0 + 8.0;
|
||||
// Built-in workspace names translate; the user's own stay as typed.
|
||||
let ws_name =
|
||||
if crate::workspaces::is_builtin(&app.ui.workspace) { tl!(&app.ui.workspace).to_string() } else { app.ui.workspace.clone() };
|
||||
let ws = ui.painter().layout_no_wrap(ws_name, egui::FontId::proportional(12.0), t.text);
|
||||
let ws_w = (ws.size().x + 36.0).clamp(112.0, 190.0);
|
||||
let gap = ui.spacing().item_spacing.x;
|
||||
// The search icon, as in PhotoCraft: shown while a minimal switcher fits beside it.
|
||||
let icon = 28.0;
|
||||
let search = switcher && room >= 64.0 + 8.0 + gap + icon;
|
||||
let ws_w = ws_w.min(room - 8.0 - gap - if search { icon } else { 0.0 }).max(64.0);
|
||||
// Explore tutorials, beside the search icon, opens the Learn panel.
|
||||
let learn = search && room >= ws_w + 8.0 + 2.0 * (gap + icon);
|
||||
let discord = learn && room >= ws_w + 8.0 + 2.0 * (gap + icon) + 10.0 + gap + crate::community::discord_width(ui, false);
|
||||
let shortcut = menus::shortcut_of("help.commandPalette").map(menus::shown_shortcut);
|
||||
let field = SearchField::new(ui, &t, shortcut);
|
||||
let fit = fit_right_group(&RightWidths {
|
||||
room: (right.width() - safe_w).max(0.0),
|
||||
safe_mode: safe.is_some(),
|
||||
switcher: (ws.size().x + 36.0).clamp(112.0, 190.0),
|
||||
field: field.width,
|
||||
icon: BAR_ICON,
|
||||
gap: ui.spacing().item_spacing.x,
|
||||
community: crate::community::discord_width(ui, false),
|
||||
});
|
||||
let (switcher, ws_w, learn, discord) = (fit.switcher, fit.switcher_w, fit.learn, fit.community);
|
||||
let mut rui = ui.new_child(egui::UiBuilder::new().max_rect(right).layout(egui::Layout::right_to_left(egui::Align::Center)));
|
||||
let ui = &mut rui;
|
||||
// Workspace switcher: shows the current workspace, opens Window → Workspace.
|
||||
@@ -131,19 +130,33 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
ui.add_space(8.0);
|
||||
}
|
||||
// Search → command palette (its shortcut opens it too).
|
||||
if search {
|
||||
let tip = match menus::shortcut_of("help.commandPalette") {
|
||||
Some(sc) => format!("{} ({})", tl!("Search commands, tools, panels and effects"), menus::shown_shortcut(sc)),
|
||||
None => tl!("Search commands, tools, panels and effects").to_string(),
|
||||
};
|
||||
if widgets::icon_button(ui, "search", &tip, app.ui.palette_open, icon).clicked() {
|
||||
app.ui.palette_open = !app.ui.palette_open;
|
||||
app.ui.palette_query.clear();
|
||||
}
|
||||
let with_shortcut = |text: &str| match &field.shortcut {
|
||||
Some(sc) => format!("{text} ({sc})"),
|
||||
None => text.to_string(),
|
||||
};
|
||||
let tip = with_shortcut(tl!("Search commands, tools, panels and effects"));
|
||||
let name = with_shortcut(tl!("Search commands"));
|
||||
// The field and the icon toggle the palette as its shortcut does, and like the shortcut
|
||||
// they do nothing while a dialog is open, so they are drawn disabled then.
|
||||
let enabled = app.ui.dialog.is_none();
|
||||
let open = app.ui.palette_open;
|
||||
let clicked = ui
|
||||
.add_enabled_ui(enabled, |ui| match fit.search {
|
||||
Search::Field => field.show(ui, &t, &name, &tip, open).clicked(),
|
||||
Search::Icon => {
|
||||
let (_, resp) = ui.allocate_exact_size(vec2(BAR_ICON, BAR_ICON), Sense::click());
|
||||
widgets::paint_icon_button_named(ui, resp, "search", &name, &tip, open).clicked()
|
||||
}
|
||||
Search::Hidden => false,
|
||||
})
|
||||
.inner;
|
||||
if clicked && enabled {
|
||||
app.ui.palette_open = !app.ui.palette_open;
|
||||
app.ui.palette_query.clear();
|
||||
}
|
||||
if learn {
|
||||
let shown = crate::panels::learn::visible(&app.ui);
|
||||
if widgets::icon_button(ui, "graduation-cap", tl!("Explore tutorials"), shown, icon).clicked()
|
||||
if widgets::icon_button(ui, "graduation-cap", tl!("Explore tutorials"), shown, BAR_ICON).clicked()
|
||||
&& let Err(e) = app.run("window.learn", json!({}))
|
||||
{
|
||||
app.ui.status = e;
|
||||
@@ -168,6 +181,142 @@ pub fn app_bar(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The side of the app bar's square icon buttons (the search icon, Explore tutorials).
|
||||
const BAR_ICON: f32 = 28.0;
|
||||
/// The narrowest the workspace switcher gets.
|
||||
const MIN_SWITCHER: f32 = 64.0;
|
||||
|
||||
/// How the app bar shows the search that opens the command palette.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
enum Search {
|
||||
/// A field with the magnifier, "Search commands" and the palette's shortcut.
|
||||
Field,
|
||||
/// The magnifier alone.
|
||||
Icon,
|
||||
/// Not in the bar; the palette stays under its shortcut and Help › Search Commands….
|
||||
Hidden,
|
||||
}
|
||||
|
||||
/// The widths [`fit_right_group`] fits into `room`, in points.
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
struct RightWidths {
|
||||
/// The room after the menus, less the Safe Mode label's.
|
||||
room: f32,
|
||||
/// Whether the bar shows the Safe Mode label.
|
||||
safe_mode: bool,
|
||||
/// The workspace switcher's full width.
|
||||
switcher: f32,
|
||||
/// The search field's width.
|
||||
field: f32,
|
||||
/// The side of a square icon button.
|
||||
icon: f32,
|
||||
/// The space between two controls.
|
||||
gap: f32,
|
||||
/// The community button's width.
|
||||
community: f32,
|
||||
}
|
||||
|
||||
/// What the right-hand group of the app bar shows.
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
struct RightGroup {
|
||||
/// Whether the workspace switcher shows.
|
||||
switcher: bool,
|
||||
/// The workspace switcher's width.
|
||||
switcher_w: f32,
|
||||
/// How the search shows.
|
||||
search: Search,
|
||||
/// Whether Explore tutorials shows.
|
||||
learn: bool,
|
||||
/// Whether the community button shows.
|
||||
community: bool,
|
||||
}
|
||||
|
||||
/// The right-hand group for the room it has. As the room runs short, the community button goes first
|
||||
/// (it is also under Help), then Explore tutorials (also Window › Learn), then the search field becomes the
|
||||
/// search icon, then the workspace switcher narrows to [`MIN_SWITCHER`], then the icon goes. In Safe
|
||||
/// Mode the label's width is taken first, and the switcher (also under Window › Workspace) goes when
|
||||
/// a minimal one does not fit.
|
||||
fn fit_right_group(w: &RightWidths) -> RightGroup {
|
||||
let room = w.room;
|
||||
let switcher = !w.safe_mode || room >= MIN_SWITCHER + 8.0;
|
||||
let icon = switcher && room >= MIN_SWITCHER + 8.0 + w.gap + w.icon;
|
||||
let field = icon && room >= w.switcher + 8.0 + w.gap + w.field;
|
||||
let search = if field {
|
||||
Search::Field
|
||||
} else if icon {
|
||||
Search::Icon
|
||||
} else {
|
||||
Search::Hidden
|
||||
};
|
||||
let search_w = match search {
|
||||
Search::Field => w.gap + w.field,
|
||||
Search::Icon => w.gap + w.icon,
|
||||
Search::Hidden => 0.0,
|
||||
};
|
||||
let switcher_w = w.switcher.min(room - 8.0 - search_w).max(MIN_SWITCHER);
|
||||
let learn_end = switcher_w + 8.0 + search_w + w.gap + w.icon;
|
||||
let learn = field && room >= learn_end;
|
||||
let community = learn && room >= learn_end + 10.0 + w.gap + w.community;
|
||||
RightGroup { switcher, switcher_w, search, learn, community }
|
||||
}
|
||||
|
||||
/// The app bar's search field: a button drawn as a field. The command palette's popup holds the
|
||||
/// only text field.
|
||||
struct SearchField {
|
||||
hint: Arc<egui::Galley>,
|
||||
/// The palette's shortcut as the menus show it; none when the user cleared it.
|
||||
shortcut: Option<String>,
|
||||
key: Option<Arc<egui::Galley>>,
|
||||
width: f32,
|
||||
}
|
||||
|
||||
impl SearchField {
|
||||
/// Space from the field's left edge to the hint text (the magnifier sits in it).
|
||||
const TEXT_LEFT: f32 = 26.0;
|
||||
/// The widest the field gets.
|
||||
const MAX_WIDTH: f32 = 220.0;
|
||||
|
||||
fn new(ui: &Ui, t: &Tokens, shortcut: Option<String>) -> SearchField {
|
||||
let hint = ui.painter().layout_no_wrap(tl!("Search commands").to_string(), egui::FontId::proportional(12.0), t.text_dim);
|
||||
let text_w = Self::TEXT_LEFT + hint.size().x + 8.0;
|
||||
// A shortcut that leaves no room for the hint in the widest field is left to the tooltip.
|
||||
let key = shortcut
|
||||
.as_ref()
|
||||
.map(|s| ui.painter().layout_no_wrap(s.clone(), egui::FontId::proportional(11.0), t.text_dim))
|
||||
.filter(|k| text_w + 12.0 + k.size().x <= Self::MAX_WIDTH);
|
||||
let key_w = key.as_ref().map_or(0.0, |k| 12.0 + k.size().x);
|
||||
let width = (text_w + key_w + 24.0).clamp(120.0, Self::MAX_WIDTH);
|
||||
SearchField { hint, shortcut, key, width }
|
||||
}
|
||||
|
||||
/// Draws the field. A click, or Enter or Space with the keyboard on it, clicks it. Screen
|
||||
/// readers get a button called `name`, and hovering it shows `tip`.
|
||||
fn show(self, ui: &mut Ui, t: &Tokens, name: &str, tip: &str, open: bool) -> egui::Response {
|
||||
let (r, resp) = ui.allocate_exact_size(vec2(self.width, WIDGET_H), Sense::click());
|
||||
let fill = if open {
|
||||
t.tool_active
|
||||
} else if resp.hovered() {
|
||||
t.hover
|
||||
} else {
|
||||
t.input
|
||||
};
|
||||
let border = if resp.has_focus() { t.accent } else { t.input_border };
|
||||
ui.painter().rect(r, CornerRadius::same(4), fill, Stroke::new(1.0, border), egui::StrokeKind::Inside);
|
||||
icons::paint(ui, "search", egui::Rect::from_center_size(r.left_center() + vec2(14.0, 0.0), vec2(14.0, 14.0)), t.icon);
|
||||
let mut text_right = r.right() - 8.0;
|
||||
if let Some(key) = self.key {
|
||||
let at = egui::pos2(text_right - key.size().x, r.center().y - key.size().y / 2.0);
|
||||
text_right = at.x - 12.0;
|
||||
ui.painter().with_clip_rect(r).galley(at, key, t.text_dim);
|
||||
}
|
||||
let clip = egui::Rect::from_min_max(r.min, egui::pos2(text_right.max(r.left()), r.bottom()));
|
||||
let at = egui::pos2(r.left() + Self::TEXT_LEFT, r.center().y - self.hint.size().y / 2.0);
|
||||
ui.painter().with_clip_rect(clip).galley(at, self.hint, t.text_dim);
|
||||
resp.widget_info(|| widgets::icon_button_info(ui.is_enabled(), open, name));
|
||||
resp.on_hover_text(tip)
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether the window shows the system's title bar instead of the app drawing its own
|
||||
/// ([`VectorcraftApp::desktop_frame`]): Windows with Preferences › User Interface › System Title
|
||||
/// Bar, and Linux whenever the desktop draws the frame, with or without the preference. The
|
||||
|
||||
@@ -159,6 +159,412 @@ fn hints_name_keys_as_the_menus_do() {
|
||||
}
|
||||
}
|
||||
|
||||
/// The widths of the app bar's right-hand group used by the fitting tests.
|
||||
fn right_widths(room: f32, safe_mode: bool) -> super::RightWidths {
|
||||
super::RightWidths { room, safe_mode, switcher: 150.0, field: 170.0, icon: 28.0, gap: 8.0, community: 80.0 }
|
||||
}
|
||||
|
||||
/// What the group shows, in words, with the switcher's width as full, narrower or minimal.
|
||||
fn right_stage(g: &super::RightGroup) -> String {
|
||||
let switcher = match g.switcher_w {
|
||||
_ if !g.switcher => "no switcher",
|
||||
w if w >= 150.0 => "full switcher",
|
||||
w if w > super::MIN_SWITCHER => "narrower switcher",
|
||||
_ => "minimal switcher",
|
||||
};
|
||||
format!("community {}, learn {}, {:?}, {switcher}", g.community, g.learn, g.search)
|
||||
}
|
||||
|
||||
/// As the app bar's room runs short, the community button goes first, then Explore tutorials, then the search
|
||||
/// field becomes the icon, then the workspace switcher narrows to its minimum, then the icon goes.
|
||||
/// Whatever shows fits in the room, down to the minimal switcher alone.
|
||||
#[test]
|
||||
fn the_app_bar_gives_up_its_right_hand_controls_in_order() {
|
||||
let mut stages: Vec<String> = Vec::new();
|
||||
for room in (0..=700).rev().map(|r| r as f32) {
|
||||
let w = right_widths(room, false);
|
||||
let g = super::fit_right_group(&w);
|
||||
let stage = right_stage(&g);
|
||||
if stages.last() != Some(&stage) {
|
||||
stages.push(stage);
|
||||
}
|
||||
let search = match g.search {
|
||||
super::Search::Field => w.gap + w.field,
|
||||
super::Search::Icon => w.gap + w.icon,
|
||||
super::Search::Hidden => 0.0,
|
||||
};
|
||||
let learn = if g.learn { w.gap + w.icon } else { 0.0 };
|
||||
let community = if g.community { 10.0 + w.gap + w.community } else { 0.0 };
|
||||
let used = g.switcher_w + 8.0 + search + learn + community;
|
||||
assert!(used <= room || g.switcher_w == super::MIN_SWITCHER && g.search == super::Search::Hidden, "{room}: {g:?} needs {used}");
|
||||
}
|
||||
assert_eq!(
|
||||
stages,
|
||||
[
|
||||
"community true, learn true, Field, full switcher",
|
||||
"community false, learn true, Field, full switcher",
|
||||
"community false, learn false, Field, full switcher",
|
||||
"community false, learn false, Icon, full switcher",
|
||||
"community false, learn false, Icon, narrower switcher",
|
||||
"community false, learn false, Icon, minimal switcher",
|
||||
// Once the icon has gone, the switcher takes the room it leaves.
|
||||
"community false, learn false, Hidden, narrower switcher",
|
||||
"community false, learn false, Hidden, minimal switcher",
|
||||
]
|
||||
);
|
||||
// In Safe Mode the label's width is taken first (not counted in `room`), and the switcher goes
|
||||
// when a minimal one does not fit.
|
||||
let safe = |room| right_stage(&super::fit_right_group(&right_widths(room, true)));
|
||||
assert_eq!(safe(700.0), "community true, learn true, Field, full switcher");
|
||||
assert_eq!(safe(72.0), "community false, learn false, Hidden, minimal switcher");
|
||||
assert_eq!(safe(71.0), "community false, learn false, Hidden, no switcher");
|
||||
}
|
||||
|
||||
/// What screen readers call the app bar's search field, and the icon it becomes, before the shortcut.
|
||||
const SEARCH_NAME: &str = "Search commands";
|
||||
|
||||
/// A native menu bar that draws nothing.
|
||||
struct NoMenus;
|
||||
impl crate::native_menu::Backend for NoMenus {
|
||||
fn sync(&mut self, _: &crate::native_menu::MenuBar) {}
|
||||
fn drain(&mut self) -> Vec<crate::native_menu::Event> {
|
||||
Vec::new()
|
||||
}
|
||||
}
|
||||
|
||||
/// The app bar drawn alone, `width` points wide.
|
||||
struct AppBar {
|
||||
app: crate::VectorcraftApp,
|
||||
ctx: egui::Context,
|
||||
width: f32,
|
||||
/// Handle the app's keys before the bar and show the command palette after it, as the app's
|
||||
/// frame does. Off, Tab moves the keyboard focus through the bar's controls, as with a screen
|
||||
/// reader.
|
||||
keys: bool,
|
||||
}
|
||||
|
||||
/// The app bar's search control, as a screen reader and the painter see it.
|
||||
#[derive(Debug)]
|
||||
struct SearchSeen {
|
||||
name: String,
|
||||
rect: egui::Rect,
|
||||
texts: Vec<String>,
|
||||
}
|
||||
|
||||
impl AppBar {
|
||||
fn new(width: f32) -> AppBar {
|
||||
crate::i18n::set_current(crate::i18n::Lang::EN);
|
||||
let ctx = egui::Context::default();
|
||||
ctx.enable_accesskit();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
let app = crate::VectorcraftApp::new(Session::new(), Default::default());
|
||||
crate::shortcut_editor::sync(&app.ui);
|
||||
AppBar { app, ctx, width, keys: false }
|
||||
}
|
||||
|
||||
/// One frame; the accessibility nodes and the texts painted, with where each is.
|
||||
fn frame(&mut self, events: Vec<egui::Event>) -> (Vec<egui::accesskit::Node>, Vec<(String, egui::Rect)>) {
|
||||
fn walk(s: &egui::Shape, v: &mut Vec<(String, egui::Rect)>) {
|
||||
match s {
|
||||
egui::Shape::Text(t) => v.push((t.galley.text().to_string(), egui::Rect::from_min_size(t.pos, t.galley.size()))),
|
||||
egui::Shape::Vec(s) => s.iter().for_each(|s| walk(s, v)),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(self.width, 600.0));
|
||||
let (app, keys) = (&mut self.app, self.keys);
|
||||
let mut out = self.ctx.run_ui(egui::RawInput { events, screen_rect: Some(screen), ..Default::default() }, |ui| {
|
||||
if keys {
|
||||
crate::shortcuts::handle(app, ui.ctx());
|
||||
}
|
||||
super::app_bar(app, ui);
|
||||
if keys {
|
||||
crate::palette::show(app, ui.ctx());
|
||||
}
|
||||
});
|
||||
out.textures_delta.clear();
|
||||
let mut texts = vec![];
|
||||
out.shapes.iter().for_each(|c| walk(&c.shape, &mut texts));
|
||||
(out.platform_output.accesskit_update.map(|u| u.nodes.into_iter().map(|(_, n)| n).collect()).unwrap_or_default(), texts)
|
||||
}
|
||||
|
||||
/// The search control after two frames, if the bar shows it.
|
||||
fn search(&mut self) -> Option<SearchSeen> {
|
||||
self.frame(vec![]);
|
||||
let (nodes, texts) = self.frame(vec![]);
|
||||
let node = nodes.iter().find(|n| n.label().is_some_and(|l| l.starts_with(SEARCH_NAME)))?;
|
||||
let b = node.bounds()?;
|
||||
let rect = egui::Rect::from_min_max(egui::pos2(b.x0 as f32, b.y0 as f32), egui::pos2(b.x1 as f32, b.y1 as f32));
|
||||
// Without the icon set loaded, a test frame draws an icon as a warning sign; leave it out.
|
||||
let mut texts: Vec<(String, egui::Rect)> =
|
||||
texts.into_iter().filter(|(t, r)| rect.expand(0.5).contains_rect(*r) && !t.starts_with('\u{26a0}')).collect();
|
||||
texts.sort_by(|a, b| a.1.left().total_cmp(&b.1.left()));
|
||||
let texts = texts.into_iter().map(|(t, _)| t).collect();
|
||||
Some(SearchSeen { name: node.label().unwrap_or_default().to_string(), rect, texts })
|
||||
}
|
||||
|
||||
/// Where the in-window menus end: the right edge of the Help menu's title, if the bar shows it.
|
||||
fn menus_end(&mut self) -> Option<f32> {
|
||||
self.frame(vec![]);
|
||||
let nodes = self.frame(vec![]).0;
|
||||
nodes.iter().filter(|n| n.label() == Some("Help")).filter_map(|n| n.bounds()).map(|b| b.x1 as f32).reduce(f32::max)
|
||||
}
|
||||
|
||||
fn has(&mut self, name: &str) -> bool {
|
||||
self.frame(vec![]);
|
||||
self.frame(vec![]).0.iter().any(|n| n.label() == Some(name))
|
||||
}
|
||||
|
||||
fn click(&mut self, at: egui::Pos2) {
|
||||
let press = |pressed| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers: Default::default() };
|
||||
self.frame(vec![egui::Event::PointerMoved(at), press(true)]);
|
||||
self.frame(vec![press(false)]);
|
||||
}
|
||||
|
||||
/// Whether the widget at `rect` has the keyboard focus.
|
||||
fn focused_at(&self, rect: egui::Rect) -> bool {
|
||||
self.ctx.memory(|m| m.focused()).and_then(|id| self.ctx.read_response(id)).is_some_and(|r| r.rect == rect)
|
||||
}
|
||||
|
||||
/// A press and release of `key`; Space also types a space, as a keyboard does.
|
||||
fn key(&mut self, key: egui::Key) {
|
||||
let event = |pressed| egui::Event::Key { key, physical_key: None, pressed, repeat: false, modifiers: Default::default() };
|
||||
let mut press = vec![event(true)];
|
||||
if key == egui::Key::Space {
|
||||
press.push(egui::Event::Text(" ".into()));
|
||||
}
|
||||
self.frame(press);
|
||||
self.frame(vec![event(false)]);
|
||||
}
|
||||
}
|
||||
|
||||
/// A wide app bar shows a search field with the palette's shortcut in it, and screen readers get a
|
||||
/// button named [`SEARCH_NAME`] with the shortcut.
|
||||
#[test]
|
||||
fn a_wide_app_bar_shows_a_search_field_with_the_palette_shortcut() {
|
||||
let mut bar = AppBar::new(1400.0);
|
||||
let shortcut = crate::menus::shown_shortcut("Cmd+Shift+/");
|
||||
let seen = bar.search().expect("the search field shows");
|
||||
assert_eq!(seen.name, format!("{SEARCH_NAME} ({shortcut})"));
|
||||
assert!(seen.rect.width() >= 120.0 && seen.rect.width() <= 220.0, "a field, not the 28-point icon: {seen:?}");
|
||||
assert_eq!(seen.texts, [SEARCH_NAME.to_string(), shortcut], "{seen:?}");
|
||||
assert!(bar.has("Explore tutorials"));
|
||||
}
|
||||
|
||||
/// The field shows the palette's shortcut as the user set it, and no shortcut once it is cleared.
|
||||
#[test]
|
||||
fn the_search_field_follows_the_palettes_shortcut() {
|
||||
let mut bar = AppBar::new(1400.0);
|
||||
crate::keymap::set_override(&mut bar.app.ui.shortcut_overrides, "help.commandPalette", "Alt+F9");
|
||||
crate::shortcut_editor::sync(&bar.app.ui);
|
||||
let rebound = crate::menus::shown_shortcut("Alt+F9");
|
||||
let seen = bar.search().expect("the search field shows");
|
||||
assert_eq!(seen.name, format!("{SEARCH_NAME} ({rebound})"));
|
||||
assert_eq!(seen.texts, [SEARCH_NAME.to_string(), rebound], "{seen:?}");
|
||||
crate::keymap::set_override(&mut bar.app.ui.shortcut_overrides, "help.commandPalette", "");
|
||||
crate::shortcut_editor::sync(&bar.app.ui);
|
||||
let seen = bar.search().expect("the search field shows");
|
||||
assert_eq!(seen.name, SEARCH_NAME);
|
||||
assert_eq!(seen.texts, [SEARCH_NAME], "{seen:?}");
|
||||
bar.app.ui.shortcut_overrides.clear();
|
||||
crate::shortcut_editor::sync(&bar.app.ui);
|
||||
}
|
||||
|
||||
/// A shortcut too long to sit beside "Search commands" in the widest field is left to the tooltip
|
||||
/// and the screen-reader name, and "Search commands" stays readable.
|
||||
#[test]
|
||||
fn a_long_shortcut_leaves_the_search_hint_readable() {
|
||||
crate::i18n::set_current(crate::i18n::Lang::EN);
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
let long = format!("Ctrl+Alt+Shift+{}", "PageDown".repeat(4));
|
||||
let mut fields = vec![];
|
||||
for _ in 0..2 {
|
||||
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| {
|
||||
let t = Tokens::get(ui.ctx());
|
||||
fields = [Some("Ctrl+Shift+/".to_string()), Some(long.clone()), None]
|
||||
.into_iter()
|
||||
.map(|s| {
|
||||
let f = super::SearchField::new(ui, &t, s);
|
||||
(f.width, f.hint.size().x, f.key.as_ref().map(|k| k.size().x), f.shortcut.clone())
|
||||
})
|
||||
.collect();
|
||||
});
|
||||
out.textures_delta.clear();
|
||||
}
|
||||
let [(short_w, hint, short_key, _), (long_w, _, long_key, long_shortcut), (none_w, _, none_key, _)] = &fields[..] else {
|
||||
panic!("three fields: {fields:?}");
|
||||
};
|
||||
let short_key = short_key.expect("a short shortcut is shown");
|
||||
assert!(*short_w <= 220.0 && 26.0 + hint + 12.0 + short_key + 8.0 <= *short_w, "the hint and the shortcut fit side by side: {fields:?}");
|
||||
assert_eq!((*long_key, long_shortcut.as_deref()), (None, Some(long.as_str())), "a long one is left to the tooltip and the name");
|
||||
assert!(*long_w <= 220.0 && 26.0 + hint + 8.0 <= *long_w, "{fields:?}");
|
||||
assert!(none_key.is_none() && *none_w >= 120.0, "{fields:?}");
|
||||
}
|
||||
|
||||
/// A click on the field, or on the icon it becomes in a narrow bar, opens the command palette with an
|
||||
/// empty query, and a second click closes it, as the palette's shortcut does. While a dialog is open
|
||||
/// neither does anything, as the shortcut does.
|
||||
#[test]
|
||||
fn a_click_on_the_search_field_opens_the_palette() {
|
||||
for icon in [false, true] {
|
||||
let mut bar = AppBar::new(1400.0);
|
||||
if icon {
|
||||
let narrow = (300..1400).rev().step_by(10).find(|w| {
|
||||
bar.width = *w as f32;
|
||||
bar.search().is_some_and(|s| s.rect.width() == 28.0)
|
||||
});
|
||||
assert!(narrow.is_some(), "a narrow bar shows the icon");
|
||||
}
|
||||
let at = bar.search().expect("the search control shows").rect.center();
|
||||
bar.app.ui.palette_query = "old".into();
|
||||
bar.click(at);
|
||||
assert!(bar.app.ui.palette_open, "icon: {icon}");
|
||||
assert_eq!(bar.app.ui.palette_query, "", "icon: {icon}");
|
||||
bar.app.ui.palette_query = "typed".into();
|
||||
bar.click(at);
|
||||
assert!(!bar.app.ui.palette_open, "a second click closes it (icon: {icon})");
|
||||
assert_eq!(bar.app.ui.palette_query, "", "icon: {icon}");
|
||||
bar.app.ui.dialog = Some(crate::state::Dialog::new("about", json!({})));
|
||||
bar.click(at);
|
||||
assert!(!bar.app.ui.palette_open, "not over a dialog (icon: {icon})");
|
||||
}
|
||||
}
|
||||
|
||||
/// The icon a narrow bar shows has the field's screen-reader name, and while a dialog is open screen
|
||||
/// readers find the field and the icon disabled.
|
||||
#[test]
|
||||
fn the_search_icon_has_the_fields_name_and_both_are_disabled_under_a_dialog() {
|
||||
let shortcut = crate::menus::shown_shortcut("Cmd+Shift+/");
|
||||
for icon in [false, true] {
|
||||
let mut bar = AppBar::new(1400.0);
|
||||
if icon {
|
||||
let narrow = (300..1400).rev().step_by(10).find(|w| {
|
||||
bar.width = *w as f32;
|
||||
bar.search().is_some_and(|s| s.rect.width() == 28.0)
|
||||
});
|
||||
assert!(narrow.is_some(), "a narrow bar shows the icon");
|
||||
}
|
||||
let disabled = |bar: &mut AppBar| {
|
||||
bar.frame(vec![]);
|
||||
let nodes = bar.frame(vec![]).0;
|
||||
let node = nodes.iter().find(|n| n.label().is_some_and(|l| l.starts_with(SEARCH_NAME))).expect("the search control shows");
|
||||
(node.label().unwrap_or_default().to_string(), node.is_disabled())
|
||||
};
|
||||
assert_eq!(disabled(&mut bar), (format!("{SEARCH_NAME} ({shortcut})"), false), "icon: {icon}");
|
||||
bar.app.ui.dialog = Some(crate::state::Dialog::new("about", json!({})));
|
||||
assert_eq!(disabled(&mut bar), (format!("{SEARCH_NAME} ({shortcut})"), true), "icon: {icon}");
|
||||
}
|
||||
}
|
||||
|
||||
/// The keyboard focus reaches the field, Enter or Space opens the palette and does nothing else, and
|
||||
/// Tab then moves the focus on. This holds with the app's keys handled, the palette drawn after the
|
||||
/// bar, a document open, and an object selected with the Selection tool, whose Enter otherwise
|
||||
/// opens Move. In the app, Tab with no field focused shows and hides the panels instead of moving
|
||||
/// the focus, so the focus reaches the bar the way a screen reader moves it.
|
||||
#[test]
|
||||
fn the_keyboard_opens_the_palette_from_the_search_field() {
|
||||
let cases =
|
||||
[(egui::Key::Enter, 0), (egui::Key::Space, 0), (egui::Key::Enter, 1), (egui::Key::Space, 1), (egui::Key::Enter, 2), (egui::Key::Space, 2)];
|
||||
for (key, setup) in cases {
|
||||
let document = setup > 0;
|
||||
let mut bar = AppBar::new(1400.0);
|
||||
let field = bar.search().expect("the search field shows").rect;
|
||||
assert!(field.width() >= 120.0, "a field, not the icon: {field:?}");
|
||||
let mut reached = false;
|
||||
for _ in 0..40 {
|
||||
bar.key(egui::Key::Tab);
|
||||
if bar.focused_at(field) {
|
||||
reached = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert!(reached, "Tab reaches the search field");
|
||||
bar.keys = true;
|
||||
if document {
|
||||
bar.app.run("file.new", json!({"width": 100, "height": 100})).unwrap();
|
||||
}
|
||||
if setup == 2 {
|
||||
let id = bar.app.session.execute("shape.rectangle", &json!({"x": 10, "y": 10, "width": 50, "height": 30})).unwrap()["id"].clone();
|
||||
bar.app.select_tool("selection");
|
||||
bar.app.session.execute("select.set", &json!({"ids": [id]})).unwrap();
|
||||
}
|
||||
// The app's keys leave the focus on the field.
|
||||
bar.frame(vec![]);
|
||||
assert!(bar.focused_at(field), "{key:?} (setup {setup})");
|
||||
assert!(!bar.app.ui.palette_open);
|
||||
let status = bar.app.ui.status.clone();
|
||||
bar.key(key);
|
||||
// The key opens the palette and goes no further: it does not pick the first result, type a
|
||||
// space into the palette's field or open Move.
|
||||
assert!(bar.app.ui.palette_open, "{key:?} opens the palette (setup {setup})");
|
||||
assert!(bar.app.ui.dialog.is_none(), "{key:?} opened no dialog (setup {setup})");
|
||||
assert_eq!(bar.app.ui.palette_query, "", "{key:?} (setup {setup})");
|
||||
assert!(bar.app.ui.recent_commands.is_empty() && bar.app.ui.status == status, "{key:?} ran nothing (setup {setup})");
|
||||
}
|
||||
// Tab moves the focus off the field with the app's keys handled.
|
||||
let mut bar = AppBar::new(1400.0);
|
||||
let field = bar.search().expect("the search field shows").rect;
|
||||
for _ in 0..40 {
|
||||
if bar.focused_at(field) {
|
||||
break;
|
||||
}
|
||||
bar.key(egui::Key::Tab);
|
||||
}
|
||||
assert!(bar.focused_at(field), "Tab reaches the search field at {field:?}");
|
||||
bar.keys = true;
|
||||
let panels = (bar.app.ui.dock, bar.app.ui.toolbar);
|
||||
bar.key(egui::Key::Tab);
|
||||
assert!(!bar.focused_at(field), "Tab leaves the field");
|
||||
assert_eq!((bar.app.ui.dock, bar.app.ui.toolbar), panels, "Tab on the field does not hide the panels");
|
||||
}
|
||||
|
||||
/// As the window narrows, the search field becomes the icon after Explore tutorials has gone and
|
||||
/// before the icon goes, never overlapping the menus: with a long workspace name, with the menus in
|
||||
/// the system's menu bar, and with the window's own caption buttons.
|
||||
#[test]
|
||||
fn a_narrowing_app_bar_turns_the_search_field_into_the_icon() {
|
||||
for case in ["default", "long workspace name", "native menus", "caption buttons"] {
|
||||
let mut bar = AppBar::new(1400.0);
|
||||
match case {
|
||||
"long workspace name" => bar.app.ui.workspace = "A workspace with a very long name indeed".into(),
|
||||
"native menus" => bar.app.services.native_menu = Some(crate::native_menu::NativeMenu::new(Box::new(NoMenus))),
|
||||
"caption buttons" => bar.app.custom_titlebar = true,
|
||||
_ => {}
|
||||
}
|
||||
assert_eq!(bar.menus_end().is_some(), case != "native menus", "{case}: the in-window menus show");
|
||||
// 0: gone, 1: icon, 2: field.
|
||||
let mut last = 2;
|
||||
let mut seen_icon = false;
|
||||
for width in (300..=1400).rev().step_by(10) {
|
||||
bar.width = width as f32;
|
||||
let learn = bar.has("Explore tutorials");
|
||||
let search = bar.search();
|
||||
let now = match &search {
|
||||
Some(s) if s.rect.width() >= 120.0 => 2,
|
||||
Some(s) => {
|
||||
assert_eq!(s.rect.width(), 28.0, "{case} at {width}");
|
||||
assert!(s.texts.is_empty(), "the icon has no text: {case} at {width}");
|
||||
1
|
||||
}
|
||||
None => 0,
|
||||
};
|
||||
assert!(width < 1400 || now == 2, "{case}: a wide bar shows the field");
|
||||
assert!(now <= last, "{case} at {width}: the search came back as the bar narrowed");
|
||||
assert!(!learn || now == 2, "{case} at {width}: Explore tutorials outlasted the field");
|
||||
if let Some(s) = &search {
|
||||
assert!(s.rect.right() <= width as f32, "{case} at {width}: {s:?}");
|
||||
if let Some(menus_end) = bar.menus_end() {
|
||||
assert!(s.rect.left() >= menus_end, "{case} at {width}: the search overlaps the menus ending at {menus_end}: {s:?}");
|
||||
}
|
||||
}
|
||||
seen_icon |= now == 1;
|
||||
last = now;
|
||||
}
|
||||
assert!(seen_icon, "{case}: the field becomes the icon before it goes");
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct StatusText {
|
||||
text: String,
|
||||
|
||||
@@ -179,6 +179,9 @@ use crate::{VectorcraftApp, widgets};
|
||||
|
||||
type DialogResult = Result<Value, String>;
|
||||
|
||||
/// A dialog's Reset ([`DialogSpec::reset`]).
|
||||
type ResetFn = fn(&VectorcraftApp, &mut Dialog) -> Result<(), String>;
|
||||
|
||||
/// The shared dialog frame's inner margin, and the least room it leaves at the window's edges.
|
||||
const MARGIN: i8 = 22;
|
||||
const EDGE_GAP: f32 = 8.0;
|
||||
@@ -219,8 +222,8 @@ pub(crate) struct DialogSpec {
|
||||
pub alternate: Option<(&'static str, &'static str)>,
|
||||
/// Puts the fields back to their defaults. While Alt (Option on macOS) is held, the Cancel
|
||||
/// button of a dialog with an `ok` reads Reset; Reset (or `ui.dialogReset`) runs this and the
|
||||
/// dialog stays open.
|
||||
pub reset: Option<fn(&VectorcraftApp, &mut Dialog)>,
|
||||
/// dialog stays open. An error leaves the dialog as it was.
|
||||
pub reset: Option<ResetFn>,
|
||||
pub min_width: f32,
|
||||
pub max_width: Option<f32>,
|
||||
/// The body runs a live preview interaction that Cancel rolls back.
|
||||
@@ -728,12 +731,12 @@ pub(crate) fn can_reset(app: &VectorcraftApp) -> bool {
|
||||
}
|
||||
|
||||
/// Reset (`ui.dialogReset`, or Cancel while Alt or Option is held): the open dialog's fields go
|
||||
/// back to their defaults and it stays open → the dialog; an error when no dialog is open or the
|
||||
/// open one has no Reset.
|
||||
/// back to their defaults and it stays open → the dialog; an error when no dialog is open, the
|
||||
/// open one has no Reset, or its Reset fails (the dialog is then left as it was).
|
||||
pub(crate) fn reset(app: &mut VectorcraftApp) -> DialogResult {
|
||||
let Some(mut d) = app.ui.dialog.clone() else { return Err("no dialog open".into()) };
|
||||
let Some(reset) = spec(&d.kind).reset else { return Err("the open dialog has no Reset".into()) };
|
||||
reset(app, &mut d);
|
||||
reset(app, &mut d)?;
|
||||
let out = serde_json::to_value(&d).unwrap_or_default();
|
||||
app.ui.dialog = Some(d);
|
||||
Ok(out)
|
||||
|
||||
@@ -189,9 +189,9 @@ pub fn open(app: &mut VectorcraftApp) {
|
||||
}
|
||||
|
||||
/// The options format `id` starts with in Format Settings: the raster options dialogs' defaults
|
||||
/// (without quality and image maps: the rows choose quality, a map is another file), the SVG
|
||||
/// Options' first-use ones (without artboards and images: a linked image is another file), or the
|
||||
/// default PDF preset.
|
||||
/// (without image maps, a map being another file, and without quality but WebP's: JPEG rows choose
|
||||
/// their quality), the SVG Options' first-use ones (without artboards and images: a linked image is
|
||||
/// another file), or the default PDF preset.
|
||||
fn defaults(app: &VectorcraftApp, id: &str) -> Map<String, Value> {
|
||||
let mut o = match (id, fileio::format(id)) {
|
||||
("svg", _) => svg_options::first_use(),
|
||||
@@ -199,9 +199,12 @@ fn defaults(app: &VectorcraftApp, id: &str) -> Map<String, Value> {
|
||||
(_, Some(f)) => png_options::defaults(app, f),
|
||||
_ => Map::new(),
|
||||
};
|
||||
for k in ["quality", "imageMap", "useArtboards", "images"] {
|
||||
for k in ["imageMap", "useArtboards", "images"] {
|
||||
o.remove(k);
|
||||
}
|
||||
if id != "webp" {
|
||||
o.remove("quality");
|
||||
}
|
||||
o
|
||||
}
|
||||
|
||||
|
||||
@@ -136,10 +136,11 @@ fn preview_command(app: &VectorcraftApp, d: &Dialog) -> Option<(String, Value)>
|
||||
|
||||
/// Reset (Cancel with Alt or Option held): every option goes back to the Flare tool's default
|
||||
/// (`FLARE_OPTIONS`, with Rays and Rings on). The dialog keeps a click's `x` and `y`, so OK still draws there.
|
||||
fn reset(_: &VectorcraftApp, d: &mut Dialog) {
|
||||
fn reset(_: &VectorcraftApp, d: &mut Dialog) -> Result<(), String> {
|
||||
if let Value::Object(defaults) = vectorcraft_tools::create("flare").options() {
|
||||
d.fields.extend(defaults);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// OK: set the tool's options; opened by a click, draw a flare there with them.
|
||||
|
||||
@@ -40,9 +40,10 @@ pub fn open(app: &mut VectorcraftApp) -> Value {
|
||||
}
|
||||
|
||||
/// Reset: the center and 0.
|
||||
fn reset(_: &VectorcraftApp, d: &mut Dialog) {
|
||||
fn reset(_: &VectorcraftApp, d: &mut Dialog) -> Result<(), String> {
|
||||
d.fields.insert("pivot".into(), json!(CENTER));
|
||||
d.fields.insert("rotate".into(), json!(0.0));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
|
||||
@@ -61,8 +62,10 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {
|
||||
ui.add_space(8.0);
|
||||
let r = widgets::flat_button(ui, tl!("Reset"), 64.0);
|
||||
r.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, ui.is_enabled(), tl!("Reset")));
|
||||
if r.clicked() {
|
||||
reset(app, d);
|
||||
if r.clicked()
|
||||
&& let Err(e) = reset(app, d)
|
||||
{
|
||||
app.status(e);
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! The raster export options: PNG Options (resolution, background, anti-aliasing, interlaced),
|
||||
//! JPEG Options (no transparency; colour model, quality 0–10, method and scans, profile, image
|
||||
//! map), WebP Options, and PNG-8 and GIF Options (the palette: colour reduction, colours, dither,
|
||||
//! map), WebP Options (lossless, or lossy at a quality 0–100), and PNG-8 and GIF Options (the palette: colour reduction, colours, dither,
|
||||
//! transparency and matte), TIFF, BMP and Targa Options ([`super::tiff_bmp_tga`]) and PSD Options
|
||||
//! ([`super::psd_options`]). Fields
|
||||
//! are `document.export` params (format, path, artboard choice…); `__`-prefixed ones are the
|
||||
@@ -39,6 +39,10 @@ const MATTES: [&str; 3] = ["none", "white", "black"];
|
||||
const MATTE_LABELS: [&str; 4] = ["None", "White", "Black", "Other"];
|
||||
/// JPEG quality on the dialog's 0–10 scale: the band each step falls in.
|
||||
const QUALITY_BANDS: [&str; 11] = ["Low", "Low", "Low", "Medium", "Medium", "Medium", "High", "High", "Maximum", "Maximum", "Maximum"];
|
||||
/// WebP compression labels: `lossless` true, then false.
|
||||
const WEBP_COMPRESSION_LABELS: [&str; 2] = ["Lossless", "Lossy"];
|
||||
/// The lossy WebP quality a new export starts with (0–100).
|
||||
const WEBP_QUALITY: u8 = 90;
|
||||
|
||||
/// The dialog kind of a raster format (`pngOptions`, `jpgOptions`, `webpOptions`, `gifOptions`,
|
||||
/// `png8Options`).
|
||||
@@ -81,6 +85,9 @@ pub(super) fn defaults(app: &VectorcraftApp, f: &Format) -> Map<String, Value> {
|
||||
"png" => {
|
||||
o.insert("interlaced".into(), json!(false));
|
||||
}
|
||||
"webp" => {
|
||||
o.extend([("lossless".into(), json!(true)), ("quality".into(), json!(WEBP_QUALITY))]);
|
||||
}
|
||||
"jpg" => {
|
||||
let model = if cmyk { ColorModel::Cmyk } else { ColorModel::Rgb };
|
||||
let defaults = jpeg::JpegOptions::default();
|
||||
@@ -207,11 +214,7 @@ pub(super) fn option_rows(ui: &mut egui::Ui, d: &mut Dialog, id: &str, screens:
|
||||
}
|
||||
"jpg" => jpeg_rows(ui, d, &label, screens),
|
||||
"gif" | "png8" => palette_rows(ui, d, &label),
|
||||
"webp" => {
|
||||
ui.label("");
|
||||
label(ui, tl!("Lossless (lossy WebP isn't available yet)"));
|
||||
ui.end_row();
|
||||
}
|
||||
"webp" => webp_rows(ui, d, &label),
|
||||
"psd" => psd_options::rows(ui, d, &label),
|
||||
id => tiff_bmp_tga::rows(ui, d, id, &label),
|
||||
}
|
||||
@@ -252,6 +255,26 @@ fn quality_row(ui: &mut egui::Ui, d: &mut Dialog, label: &dyn Fn(&mut egui::Ui,
|
||||
ui.end_row();
|
||||
}
|
||||
|
||||
/// The WebP Options rows: Lossless or Lossy compression, and the quality 0–100 that Lossy uses
|
||||
/// (dimmed while Lossless is chosen, keeping its value).
|
||||
fn webp_rows(ui: &mut egui::Ui, d: &mut Dialog, label: &dyn Fn(&mut egui::Ui, &str) -> egui::Response) {
|
||||
label(ui, tl!("Compression:"));
|
||||
let lossless = d.fields.get("lossless").and_then(Value::as_bool).unwrap_or(true);
|
||||
if let Some(i) = widgets::dropdown(ui, "ro-webp", WEBP_COMPRESSION_LABELS[usize::from(!lossless)], &WEBP_COMPRESSION_LABELS, 150.0) {
|
||||
d.fields.insert("lossless".into(), json!(i == 0));
|
||||
}
|
||||
ui.end_row();
|
||||
|
||||
label(ui, tl!("Quality:"));
|
||||
let mut q = d.f64("quality", f64::from(WEBP_QUALITY)).round().clamp(0.0, 100.0) as u8;
|
||||
ui.add_enabled_ui(!lossless, |ui| {
|
||||
if widgets::slider(ui, egui::Slider::new(&mut q, 0..=100)).changed() {
|
||||
d.fields.insert("quality".into(), json!(q));
|
||||
}
|
||||
});
|
||||
ui.end_row();
|
||||
}
|
||||
|
||||
/// The JPEG method, and its scans when progressive.
|
||||
fn method_row(ui: &mut egui::Ui, d: &mut Dialog, label: &dyn Fn(&mut egui::Ui, &str) -> egui::Response) {
|
||||
label(ui, tl!("Method:"));
|
||||
|
||||
@@ -101,11 +101,12 @@ fn remembered(app: &VectorcraftApp) -> WebSettings {
|
||||
/// pending Done (`discard`, which a failed Done leaves), the preset name being typed and the
|
||||
/// selected color table entry are dropped. The view, zoom, connection speed and `path` stay,
|
||||
/// nothing is remembered or written, and the dialog stays open.
|
||||
fn reset(app: &VectorcraftApp, d: &mut Dialog) {
|
||||
fn reset(app: &VectorcraftApp, d: &mut Dialog) -> Result<(), String> {
|
||||
for key in ["preset", "discard", "__presetName", "__color"] {
|
||||
d.fields.remove(key);
|
||||
}
|
||||
d.fields.extend(settings_fields(&remembered(app)));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// The settings as dialog fields.
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
//! `document.pdfSettings`. Save Preset… names the settings as a preset (`pdf.preset.save`).
|
||||
//! Opened from Export As with Use Artboards off (`__artBounds`), the dialog has no Artboards
|
||||
//! section, and OK writes one page of the visible art's bounds through [`io::export`]; opened
|
||||
//! from Export Selection (`__selection` too), the page is the selection's crop.
|
||||
//! from Export Selection (`__selection` too), the page is the selection's crop. While Alt (Option
|
||||
//! on macOS) is held, Cancel reads Reset, which puts the options back to the chosen preset's
|
||||
//! settings and leaves the dialog open (`ui.dialogReset`).
|
||||
//!
|
||||
//! The same dialog edits a preset (kind `pdfPreset`, from Edit → PDF Presets): a `name` and
|
||||
//! `description` instead of the preset and artboards, and OK saves the preset.
|
||||
@@ -30,8 +32,15 @@ use crate::{VectorcraftApp, io, widgets};
|
||||
|
||||
pub(super) const KIND: &str = "savePdf";
|
||||
|
||||
pub(super) const SPEC: DialogSpec =
|
||||
DialogSpec { heading: |_| tl!("Save PDF").into(), body, confirm, ok: Some("Save PDF"), inputs: |_| &["path"], ..DialogSpec::FORM };
|
||||
pub(super) const SPEC: DialogSpec = DialogSpec {
|
||||
heading: |_| tl!("Save PDF").into(),
|
||||
body,
|
||||
confirm,
|
||||
ok: Some("Save PDF"),
|
||||
inputs: |_| &["path"],
|
||||
reset: Some(reset),
|
||||
..DialogSpec::FORM
|
||||
};
|
||||
|
||||
/// The dialog kind of the preset editor (New / Edit in Edit → PDF Presets).
|
||||
pub(super) const PRESET_KIND: &str = "pdfPreset";
|
||||
@@ -502,13 +511,33 @@ fn preset_rows(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) {
|
||||
fn apply_preset(app: &mut VectorcraftApp, d: &mut Dialog, name: &str) {
|
||||
match settings_fields(app, &json!({ "preset": name })) {
|
||||
Ok(settings) => {
|
||||
d.fields.extend(settings);
|
||||
replace_settings(d, settings);
|
||||
d.fields.insert("preset".into(), json!(name));
|
||||
}
|
||||
Err(e) => app.status(e),
|
||||
}
|
||||
}
|
||||
|
||||
/// The UI-only fields that stand for options: the Security section's password checkboxes.
|
||||
const OPTION_FLAGS: [&str; 2] = ["__requireOpenPassword", "__restrictPermissions"];
|
||||
|
||||
/// Replace every option with `settings` (from [`settings_fields`]), the password checkboxes
|
||||
/// included. The preset, the artboard choice, the path and the other UI-only fields (the section,
|
||||
/// the Save Preset name) stay.
|
||||
fn replace_settings(d: &mut Dialog, settings: Map<String, Value>) {
|
||||
d.fields.retain(|k, _| matches!(k.as_str(), "preset" | "range" | "path") || (k.starts_with("__") && !OPTION_FLAGS.contains(&k.as_str())));
|
||||
d.fields.extend(settings);
|
||||
}
|
||||
|
||||
/// Reset (Cancel with Alt or Option held): the options go back to the chosen preset's settings, as
|
||||
/// choosing that preset sets them, and the dialog stays open. A preset that can no longer be found
|
||||
/// (a saved one deleted while the dialog is open) is an error, and the dialog is left as it is.
|
||||
fn reset(app: &VectorcraftApp, d: &mut Dialog) -> Result<(), String> {
|
||||
let settings = settings_fields(app, &json!({ "preset": d.str("preset") }))?;
|
||||
replace_settings(d, settings);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// General: the options, then the artboards (Save PDF) or the description (preset editor).
|
||||
fn general(ui: &mut egui::Ui, d: &mut Dialog, editor: bool) {
|
||||
heading(ui, tl!("Options"));
|
||||
|
||||
@@ -346,6 +346,74 @@ fn presets_reset_the_settings_and_fields_fall_back_to_defaults() {
|
||||
assert!(app.run("ui.savePdfDialog", json!({"compatibility": "1.0"})).is_err(), "bad options are refused");
|
||||
}
|
||||
|
||||
/// Reset (`ui.dialogReset`, or Cancel with Alt or Option held) puts every option back to the
|
||||
/// chosen preset's settings, passwords and their checkboxes included, and keeps the preset, the
|
||||
/// path, the artboard range, the section and the dialog. After another preset is chosen, Reset
|
||||
/// goes back to that one, and choosing it also clears the password checkboxes.
|
||||
#[test]
|
||||
fn reset_puts_the_chosen_presets_settings_back_and_keeps_the_path_and_artboards() {
|
||||
let (mut app, written, _) = app();
|
||||
app.run("pdf.preset.save", json!({"name": "Mine", "compatibility": "1.5", "marks": {"trim": true}})).unwrap();
|
||||
app.run("ui.savePdfDialog", json!({"path": "/tmp/reset.pdf", "preset": "Mine"})).unwrap();
|
||||
set_field(&mut app, "__allArtboards", json!(false));
|
||||
set_field(&mut app, "range", json!("2"));
|
||||
set_field(&mut app, "__section", json!("Security"));
|
||||
set_field(&mut app, "compatibility", json!("1.7"));
|
||||
set_field(&mut app, "marks.trim", json!(false));
|
||||
set_field(&mut app, "compression.color.ppi", json!(72));
|
||||
set_field(&mut app, OPEN_PASSWORD, json!("secret"));
|
||||
set_field(&mut app, "__restrictPermissions", json!(true));
|
||||
let r = app.run("ui.dialogReset", json!({})).unwrap();
|
||||
assert_eq!(r["kind"], KIND);
|
||||
let d = app.ui.dialog.as_ref().expect("Reset leaves the dialog open");
|
||||
assert_eq!(get(d, "compatibility"), "1.5");
|
||||
assert_eq!(get(d, "marks.trim"), true);
|
||||
assert_eq!(get(d, "compression.color.ppi"), 300.0, "a nested option goes back too");
|
||||
assert_eq!(get(d, OPEN_PASSWORD).as_str().unwrap_or_default(), "", "the password is cleared");
|
||||
assert!(!d.fields.contains_key("__restrictPermissions"), "the checkbox is cleared");
|
||||
assert_eq!(
|
||||
(d.str("preset"), d.str("path"), d.str("range"), d.str("__section")),
|
||||
("Mine".to_string(), "/tmp/reset.pdf".to_string(), "2".to_string(), "Security".to_string())
|
||||
);
|
||||
assert!(!d.bool("__allArtboards"));
|
||||
|
||||
let mut d = d.clone();
|
||||
d.fields.insert("__requireOpenPassword".into(), json!(true));
|
||||
apply_preset(&mut app, &mut d, pdf::DEFAULT_PRESET);
|
||||
assert!(!d.fields.contains_key("__requireOpenPassword"), "choosing a preset clears the checkbox");
|
||||
app.ui.dialog = Some(d);
|
||||
set_field(&mut app, "compatibility", json!("1.4"));
|
||||
app.run("ui.dialogReset", json!({})).unwrap();
|
||||
let d = app.ui.dialog.as_ref().expect("the dialog stays open");
|
||||
assert_eq!(d.str("preset"), pdf::DEFAULT_PRESET);
|
||||
assert_eq!(get(d, "compatibility"), "1.7");
|
||||
assert_eq!(get(d, "marks.trim"), false);
|
||||
// OK writes the reset options to the kept path and range.
|
||||
super::super::confirm(&mut app).unwrap();
|
||||
let w = written.borrow();
|
||||
assert_eq!((w.len(), w[0].0.as_str()), (1, "/tmp/reset.pdf"));
|
||||
assert!(w[0].1.starts_with(b"%PDF-1.7"));
|
||||
assert_eq!(vectorcraft_pdf::import(&w[0].1).unwrap().artboards.len(), 1, "range 2");
|
||||
}
|
||||
|
||||
/// Reset with a saved preset deleted while the dialog is open is an error naming the preset, and
|
||||
/// it leaves the options and the password as they are rather than switching to another preset's.
|
||||
#[test]
|
||||
fn reset_with_a_deleted_preset_is_an_error_and_keeps_the_options() {
|
||||
let (mut app, _, _) = app();
|
||||
app.run("pdf.preset.save", json!({"name": "Gone", "compatibility": "1.5"})).unwrap();
|
||||
app.run("ui.savePdfDialog", json!({"preset": "Gone"})).unwrap();
|
||||
set_field(&mut app, "compatibility", json!("1.6"));
|
||||
set_field(&mut app, OPEN_PASSWORD, json!("secret"));
|
||||
app.run("pdf.preset.delete", json!({"name": "Gone"})).unwrap();
|
||||
let e = app.run("ui.dialogReset", json!({})).unwrap_err();
|
||||
assert!(e.contains("unknown PDF preset `Gone`"), "{e}");
|
||||
let d = app.ui.dialog.as_ref().expect("the dialog stays open");
|
||||
assert_eq!(d.str("preset"), "Gone");
|
||||
assert_eq!(get(d, "compatibility"), "1.6");
|
||||
assert_eq!(get(d, OPEN_PASSWORD), "secret");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn marks_and_bleeds_reach_the_pdf() {
|
||||
let (mut app, written, _) = app();
|
||||
|
||||
@@ -402,7 +402,15 @@ fn linked_size_form(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) {
|
||||
let mut rows: Option<egui::Rect> = None;
|
||||
egui::Grid::new("shape-size-dlg").num_columns(3).spacing([10.0, 8.0]).show(ui, |ui| {
|
||||
for (key, label) in [("width", "Width:"), ("height", "Height:")] {
|
||||
let row = form::row_label(ui, label);
|
||||
let row = if key == "height" && d.kind == "ellipse" {
|
||||
let (row, pressed) = height_label_button(ui, label);
|
||||
if pressed {
|
||||
copy_width_to_height(d);
|
||||
}
|
||||
row
|
||||
} else {
|
||||
form::row_label(ui, label)
|
||||
};
|
||||
if ui.label_inputs_by(row.id, |ui| form::length(ui, d, key, unit, form::FIELD_W)) {
|
||||
follow_link(d, key);
|
||||
}
|
||||
@@ -424,6 +432,8 @@ fn linked_size_form(ui: &mut egui::Ui, d: &mut Dialog, unit: Unit) {
|
||||
let resp = ui.interact(rect, ui.scope_id().with("shape-size-link"), egui::Sense::click());
|
||||
let icon = if on { "link" } else { "link-2-off" };
|
||||
if widgets::paint_icon_button(ui, resp, icon, "Constrain Width and Height Proportions", on).clicked() {
|
||||
// Enter on the focused button turns the link on or off; it does not also press OK.
|
||||
ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Enter));
|
||||
d.fields.insert(LINK.into(), json!(!on));
|
||||
sync_link(ui.ctx(), d);
|
||||
}
|
||||
@@ -469,6 +479,61 @@ fn follow_link(d: &mut Dialog, typed: &str) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The Ellipse dialog's Height label: a button drawn as the other rows' labels are. Whether it was
|
||||
/// pressed: a click, or Enter or Space while it has the keyboard focus; that Enter does not also
|
||||
/// press OK. A click whose press took the focus from a field that then refused its text (Width
|
||||
/// left empty or not a distance) does not count, as such a click on OK does not. Screen readers
|
||||
/// read it as the button "Height:" (which also names the Height field) with the description "Copy
|
||||
/// Width to Height".
|
||||
fn height_label_button(ui: &mut egui::Ui, label: &str) -> (egui::Response, bool) {
|
||||
let t = crate::theme::Tokens::get(ui.ctx());
|
||||
let text = egui::RichText::new(tl!(label)).color(t.text_dim);
|
||||
let resp = ui.add(egui::Button::new(text).frame(false)).on_hover_cursor(egui::CursorIcon::PointingHand);
|
||||
let resp = resp.on_hover_text(tl!("Copy Width to Height"));
|
||||
let press = resp.id.with("press-pass");
|
||||
if resp.contains_pointer() && ui.input(|i| i.pointer.any_pressed()) {
|
||||
let pass = ui.ctx().cumulative_pass_nr();
|
||||
ui.data_mut(|m| m.insert_temp(press, pass));
|
||||
}
|
||||
if !resp.clicked() {
|
||||
// A press let go without a click (dragged off the button) leaves no press behind.
|
||||
if ui.input(|i| i.pointer.any_released()) {
|
||||
ui.data_mut(|m| m.remove::<u64>(press));
|
||||
}
|
||||
return (resp, false);
|
||||
}
|
||||
ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Enter));
|
||||
let (pressed_at, refused_at, refused_now) = ui.data_mut(|m| {
|
||||
let pressed_at = m.get_temp::<u64>(press);
|
||||
m.remove::<u64>(press);
|
||||
(pressed_at, m.get_temp::<u64>(widgets::dialog_reject_pass()), m.get_temp::<bool>(widgets::dialog_reject_commit_flag()))
|
||||
});
|
||||
let refused = refused_now == Some(true) || matches!((refused_at, pressed_at), (Some(r), Some(p)) if r >= p);
|
||||
(resp, !refused)
|
||||
}
|
||||
|
||||
/// Height takes the Width the dialog holds (help page "Draw ellipses",
|
||||
/// <https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=140>).
|
||||
/// A Width that is missing, empty, not a distance or not finite leaves Height as it is. With the
|
||||
/// link on, the link keeps the circle from then on (proportions 1 : 1), or keeps no proportions
|
||||
/// when Width is 0; the link stays on.
|
||||
fn copy_width_to_height(d: &mut Dialog) {
|
||||
let width = match d.fields.get("width") {
|
||||
Some(Value::Number(n)) => n.as_f64(),
|
||||
Some(Value::String(s)) => Unit::Points.parse(s),
|
||||
_ => None,
|
||||
};
|
||||
let Some(width) = width.filter(|w| w.is_finite()) else { return };
|
||||
d.fields.insert("height".into(), json!(width));
|
||||
if d.bool(LINK) {
|
||||
if width != 0.0 {
|
||||
d.fields.insert(RATIO.into(), json!(1.0));
|
||||
} else {
|
||||
d.fields.remove(RATIO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// The Ellipse dialog's Anchors: the nearest whole number from 2 to 1000 (4, a live ellipse, when
|
||||
/// left empty or not a number).
|
||||
fn ellipse_anchors(d: &Dialog) -> u64 {
|
||||
@@ -1063,6 +1128,237 @@ mod tests {
|
||||
assert_eq!(ellipse_anchors(h.state().ui.dialog.as_ref().unwrap()), 4);
|
||||
}
|
||||
|
||||
/// A harness drawing `app`'s dialog, with the app's fonts installed on its first frame.
|
||||
fn dialog_harness(app: VectorcraftApp) -> egui_kittest::Harness<'static, VectorcraftApp> {
|
||||
let mut fonts = false;
|
||||
let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(1100.0, 900.0)).build_ui_state(
|
||||
move |ui, app: &mut VectorcraftApp| {
|
||||
if !std::mem::replace(&mut fonts, true) {
|
||||
crate::theme::install_fonts(ui.ctx());
|
||||
return;
|
||||
}
|
||||
super::super::show(app, ui.ctx());
|
||||
},
|
||||
app,
|
||||
);
|
||||
h.run_steps(5);
|
||||
h
|
||||
}
|
||||
|
||||
/// The dialog's Width and Height in points.
|
||||
fn dialog_size(h: &egui_kittest::Harness<'_, VectorcraftApp>) -> (f64, f64) {
|
||||
let d = h.state().ui.dialog.as_ref().expect("the dialog is open");
|
||||
(d.f64("width", -1.0), d.f64("height", -1.0))
|
||||
}
|
||||
|
||||
/// Replaces the text of the field named `name` with `text` and leaves it with Tab.
|
||||
fn retype(h: &mut egui_kittest::Harness<'_, VectorcraftApp>, name: &str, text: &str) {
|
||||
use egui::accesskit::Role;
|
||||
use egui_kittest::kittest::Queryable;
|
||||
let all = egui::Modifiers { ctrl: true, command: true, ..Default::default() };
|
||||
h.get_by_role_and_label(Role::TextInput, name).focus();
|
||||
h.run_steps(2);
|
||||
h.key_press_modifiers(all, egui::Key::A);
|
||||
h.get_by_role_and_label(Role::TextInput, name).type_text(text);
|
||||
h.run_steps(2);
|
||||
h.key_press(egui::Key::Tab);
|
||||
h.run_steps(2);
|
||||
}
|
||||
|
||||
/// In the Ellipse dialog, a click on the word Height copies Width into Height, also a Width
|
||||
/// typed and not yet committed; the fields keep their names. Cancel discards it; OK draws the
|
||||
/// circle as one undo step.
|
||||
#[test]
|
||||
fn clicking_height_in_the_ellipse_dialog_copies_width_into_height() {
|
||||
use egui::accesskit::Role;
|
||||
use egui_kittest::kittest::{NodeT, Queryable};
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 300, "height": 300})).unwrap();
|
||||
super::super::open_tool_dialog(&mut app, "ellipse", json!({"x": 10.0, "y": 10.0}));
|
||||
let d = app.ui.dialog.as_mut().unwrap();
|
||||
d.fields.insert("width".into(), json!(80.0));
|
||||
d.fields.insert("height".into(), json!(30.0));
|
||||
let mut h = dialog_harness(app);
|
||||
h.check_accessibility();
|
||||
let button = h.get_by_role_and_label(Role::Button, "Height:");
|
||||
assert_eq!(button.accesskit_node().description().as_deref(), Some("Copy Width to Height"));
|
||||
h.get_by_role_and_label(Role::Button, "Height:").click();
|
||||
h.run_steps(2);
|
||||
assert_eq!(dialog_size(&h), (80.0, 80.0));
|
||||
let d = h.state().ui.dialog.as_ref().unwrap();
|
||||
assert!(!d.bool(LINK) && !d.fields.contains_key(RATIO), "the link stays off");
|
||||
// The value fields keep their names.
|
||||
h.get_by_role_and_label(Role::TextInput, "Width:");
|
||||
h.get_by_role_and_label(Role::TextInput, "Height:");
|
||||
|
||||
// A Width typed and not committed with Enter or Tab is the one copied.
|
||||
let all = egui::Modifiers { ctrl: true, command: true, ..Default::default() };
|
||||
h.get_by_role_and_label(Role::TextInput, "Width:").focus();
|
||||
h.run_steps(2);
|
||||
h.key_press_modifiers(all, egui::Key::A);
|
||||
h.get_by_role_and_label(Role::TextInput, "Width:").type_text("50 pt");
|
||||
h.run_steps(2);
|
||||
h.get_by_role_and_label(Role::Button, "Height:").click();
|
||||
h.run_steps(3);
|
||||
assert_eq!(dialog_size(&h), (50.0, 50.0));
|
||||
|
||||
// A Width the field refuses when the click takes its focus (not a distance, or empty)
|
||||
// is not copied: Height keeps its value.
|
||||
h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("height".into(), json!(30.0));
|
||||
h.run_steps(2);
|
||||
for typed in ["wide", ""] {
|
||||
h.get_by_role_and_label(Role::TextInput, "Width:").focus();
|
||||
h.run_steps(2);
|
||||
h.key_press_modifiers(all, egui::Key::A);
|
||||
if typed.is_empty() {
|
||||
h.key_press(egui::Key::Backspace);
|
||||
} else {
|
||||
h.get_by_role_and_label(Role::TextInput, "Width:").type_text(typed);
|
||||
}
|
||||
h.run_steps(2);
|
||||
h.get_by_role_and_label(Role::Button, "Height:").click();
|
||||
h.run_steps(3);
|
||||
assert_eq!(dialog_size(&h), (50.0, 30.0), "{typed:?}");
|
||||
}
|
||||
// The field shows its value again, and the next click copies it.
|
||||
h.get_by_role_and_label(Role::Button, "Height:").click();
|
||||
h.run_steps(3);
|
||||
assert_eq!(dialog_size(&h), (50.0, 50.0));
|
||||
|
||||
// A Height typed and not committed does not outlast the copy: a distance is replaced by
|
||||
// Width, and a Height the field refuses keeps the copy from happening, as it keeps OK from
|
||||
// confirming.
|
||||
for (typed, after) in [("70 pt", (50.0, 50.0)), ("tall", (50.0, 30.0))] {
|
||||
h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("height".into(), json!(30.0));
|
||||
h.run_steps(2);
|
||||
h.get_by_role_and_label(Role::TextInput, "Height:").focus();
|
||||
h.run_steps(2);
|
||||
h.key_press_modifiers(all, egui::Key::A);
|
||||
h.get_by_role_and_label(Role::TextInput, "Height:").type_text(typed);
|
||||
h.run_steps(2);
|
||||
h.get_by_role_and_label(Role::Button, "Height:").click();
|
||||
h.run_steps(3);
|
||||
assert_eq!(dialog_size(&h), after, "{typed:?}");
|
||||
}
|
||||
|
||||
// Cancel: nothing is drawn.
|
||||
let undo = |h: &egui_kittest::Harness<'_, VectorcraftApp>| h.state().session.active().unwrap().history.undo.len();
|
||||
let before = undo(&h);
|
||||
crate::dialogs::cancel(h.state_mut());
|
||||
h.run_steps(2);
|
||||
assert!(h.state().session.doc().unwrap().doc.layers[0].children().unwrap().is_empty());
|
||||
assert_eq!(undo(&h), before);
|
||||
|
||||
// OK: one circle, one undo step.
|
||||
super::super::open_tool_dialog(h.state_mut(), "ellipse", json!({"x": 10.0, "y": 10.0}));
|
||||
h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("width".into(), json!(64.0));
|
||||
h.run_steps(2);
|
||||
h.get_by_role_and_label(Role::Button, "Height:").click();
|
||||
h.run_steps(2);
|
||||
super::super::confirm(h.state_mut()).unwrap();
|
||||
assert!(h.state().ui.dialog.is_none());
|
||||
assert_eq!(undo(&h), before + 1);
|
||||
let doc = &h.state().session.doc().unwrap().doc;
|
||||
let b = doc.layers[0].children().unwrap()[0].geometric_bounds().unwrap();
|
||||
assert!((b.width() - 64.0).abs() < 1e-6 && (b.height() - 64.0).abs() < 1e-6, "{b:?}");
|
||||
}
|
||||
|
||||
/// The Height button works from the keyboard: Space and Enter copy Width into Height, and
|
||||
/// that Enter does not press OK. With the link on, the link stays on and keeps the circle when
|
||||
/// Width is typed next; a Width of 0 is copied and leaves the link no proportions to keep.
|
||||
#[test]
|
||||
fn the_ellipse_height_button_copies_width_from_the_keyboard_and_keeps_the_link_round() {
|
||||
use egui::accesskit::Role;
|
||||
use egui_kittest::kittest::Queryable;
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 300, "height": 300})).unwrap();
|
||||
super::super::open_tool_dialog(&mut app, "ellipse", json!({"x": 10.0, "y": 10.0}));
|
||||
let d = app.ui.dialog.as_mut().unwrap();
|
||||
d.fields.insert("width".into(), json!(80.0));
|
||||
d.fields.insert("height".into(), json!(20.0));
|
||||
d.fields.insert(LINK.into(), json!(true));
|
||||
let mut h = dialog_harness(app);
|
||||
assert_eq!(h.state().ui.dialog.as_ref().unwrap().f64(RATIO, 0.0), 0.25);
|
||||
h.get_by_role_and_label(Role::Button, "Height:").focus();
|
||||
h.run_steps(2);
|
||||
h.key_press(egui::Key::Space);
|
||||
h.run_steps(2);
|
||||
assert_eq!(dialog_size(&h), (80.0, 80.0));
|
||||
let d = h.state().ui.dialog.as_ref().unwrap();
|
||||
assert!(d.bool(LINK), "the link stays on");
|
||||
assert_eq!(d.f64(RATIO, 0.0), 1.0);
|
||||
// The link now keeps the circle.
|
||||
retype(&mut h, "Width:", "40 pt");
|
||||
assert_eq!(dialog_size(&h), (40.0, 40.0));
|
||||
|
||||
// Enter on the button copies, and the dialog stays open.
|
||||
h.state_mut().ui.dialog.as_mut().unwrap().fields.insert("width".into(), json!(0.0));
|
||||
h.run_steps(2);
|
||||
h.get_by_role_and_label(Role::Button, "Height:").focus();
|
||||
h.run_steps(2);
|
||||
h.key_press(egui::Key::Enter);
|
||||
h.run_steps(2);
|
||||
assert!(h.state().ui.dialog.is_some(), "Enter on the Height button does not press OK");
|
||||
assert_eq!(dialog_size(&h), (0.0, 0.0));
|
||||
let d = h.state().ui.dialog.as_ref().unwrap();
|
||||
assert!(d.bool(LINK) && !d.fields.contains_key(RATIO), "no proportions to keep at 0");
|
||||
assert!(h.state().session.doc().unwrap().doc.layers[0].children().unwrap().is_empty());
|
||||
}
|
||||
|
||||
/// Enter on the focused link button turns the link on and leaves the dialog open, as Space does.
|
||||
#[test]
|
||||
fn enter_on_the_link_button_turns_the_link_on_without_pressing_ok() {
|
||||
use egui::accesskit::Role;
|
||||
use egui_kittest::kittest::Queryable;
|
||||
const LINK_NAME: &str = "Constrain Width and Height Proportions";
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 300, "height": 300})).unwrap();
|
||||
super::super::open_tool_dialog(&mut app, "rectangle", json!({"x": 10.0, "y": 10.0}));
|
||||
let mut h = dialog_harness(app);
|
||||
assert!(!h.state().ui.dialog.as_ref().unwrap().bool(LINK));
|
||||
h.get_by_role_and_label(Role::Button, LINK_NAME).focus();
|
||||
h.run_steps(2);
|
||||
h.key_press(egui::Key::Enter);
|
||||
h.run_steps(2);
|
||||
let d = h.state().ui.dialog.as_ref().expect("Enter on the link button does not press OK");
|
||||
assert!(d.bool(LINK));
|
||||
assert!(h.state().session.doc().unwrap().doc.layers[0].children().unwrap().is_empty());
|
||||
}
|
||||
|
||||
/// Rectangle and Rounded Rectangle keep plain Width and Height labels.
|
||||
#[test]
|
||||
fn only_the_ellipse_dialog_has_the_height_button() {
|
||||
use egui::accesskit::Role;
|
||||
use egui_kittest::kittest::Queryable;
|
||||
for kind in ["rectangle", "roundedRectangle"] {
|
||||
let mut app = VectorcraftApp::new(Session::new(), Default::default());
|
||||
app.run("file.new", json!({"width": 300, "height": 300})).unwrap();
|
||||
super::super::open_tool_dialog(&mut app, kind, json!({"x": 10.0, "y": 10.0}));
|
||||
let h = dialog_harness(app);
|
||||
h.get_by_role_and_label(Role::TextInput, "Height:");
|
||||
assert!(h.query_by_role_and_label(Role::Button, "Height:").is_none(), "{kind}");
|
||||
}
|
||||
}
|
||||
|
||||
/// A Width that is missing, empty, not a distance or not finite leaves Height as it is; a
|
||||
/// Width with a unit is copied in points, and 0 is copied.
|
||||
#[test]
|
||||
fn copying_width_takes_only_a_width_that_reads() {
|
||||
for width in [None, Some(json!("")), Some(json!("wide")), Some(json!("inf")), Some(json!(null)), Some(json!(true))] {
|
||||
let mut d = Dialog::new("ellipse", json!({"height": 30.0}));
|
||||
if let Some(w) = width.clone() {
|
||||
d.fields.insert("width".into(), w);
|
||||
}
|
||||
copy_width_to_height(&mut d);
|
||||
assert_eq!(d.fields.get("height"), Some(&json!(30.0)), "{width:?}");
|
||||
}
|
||||
for (width, want) in [(json!("1 in"), 72.0), (json!(0), 0.0), (json!(12.5), 12.5)] {
|
||||
let mut d = Dialog::new("ellipse", json!({"width": width.clone(), "height": 30.0}));
|
||||
copy_width_to_height(&mut d);
|
||||
assert_eq!(d.f64("height", -1.0), want, "{width}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn ellipse_anchors_take_the_nearest_whole_number_from_2_to_1000() {
|
||||
let d = |v: Value| Dialog::new("ellipse", json!({ "anchors": v }));
|
||||
|
||||
@@ -2524,6 +2524,31 @@ fn flare_options_alt_turns_cancel_into_reset() {
|
||||
);
|
||||
}
|
||||
|
||||
/// While Alt is held, Save PDF's Cancel button reads Reset; Reset puts the chosen preset's settings
|
||||
/// back and leaves the dialog open with its path, letting Alt go shows Cancel again, and Cancel
|
||||
/// closes the dialog.
|
||||
#[test]
|
||||
fn save_pdf_alt_turns_cancel_into_reset() {
|
||||
let mut app = app();
|
||||
app.run("ui.savePdfDialog", json!({"path": "/tmp/alt.pdf"})).unwrap();
|
||||
app.ui.dialog.as_mut().unwrap().fields.insert("compatibility".into(), json!("1.4"));
|
||||
let mut f = Frames::new();
|
||||
f.button(&mut app, "Cancel");
|
||||
f.run(&mut app, vec![egui::Event::ModifiersChanged(egui::Modifiers::ALT)]);
|
||||
let reset = f.button(&mut app, "Reset");
|
||||
let texts = f.texts(&mut app);
|
||||
assert!(!texts.iter().any(|(t, _)| t == "Cancel"), "Reset takes Cancel's place: {texts:?}");
|
||||
f.press(&mut app, reset, true);
|
||||
f.press(&mut app, reset, false);
|
||||
let d = app.ui.dialog.as_ref().expect("Reset leaves the dialog open");
|
||||
assert_eq!((d.str("compatibility"), d.str("path")), ("1.7".to_string(), "/tmp/alt.pdf".to_string()));
|
||||
f.run(&mut app, vec![egui::Event::ModifiersChanged(egui::Modifiers::NONE)]);
|
||||
let cancel = f.button(&mut app, "Cancel");
|
||||
f.press(&mut app, cancel, true);
|
||||
f.press(&mut app, cancel, false);
|
||||
assert!(app.ui.dialog.is_none(), "Cancel closes the dialog");
|
||||
}
|
||||
|
||||
/// While Alt is held, Save for Web's Cancel button reads Reset; Reset puts the remembered settings
|
||||
/// back without remembering anything and leaves the dialog open, and letting Alt go shows Cancel again.
|
||||
#[test]
|
||||
|
||||
@@ -101,13 +101,48 @@ fn text_export_options_write_the_stories() {
|
||||
assert_eq!((path.as_str(), bytes.as_slice()), ("/out/Untitled-1.txt", &b"Hello\r\nthere\r\n"[..]));
|
||||
}
|
||||
|
||||
/// WebP Options: Lossless by default, with the Quality slider disabled; Lossy enables it, and OK
|
||||
/// writes a lossy file at that quality, without a note.
|
||||
#[test]
|
||||
fn webp_options_say_the_file_is_lossless() {
|
||||
let (mut app, _) = app(1);
|
||||
fn webp_options_choose_lossless_or_lossy_at_a_quality() {
|
||||
use crate::widgets::accessibility_tests::tree;
|
||||
use egui::accesskit::Role;
|
||||
let quality_disabled = |app: &mut VectorcraftApp| {
|
||||
let t = tree(|ui| show(app, ui.ctx()));
|
||||
t.iter().find(|n| n.role() == Role::Slider).expect("the Quality slider").is_disabled()
|
||||
};
|
||||
let (mut app, written) = app(1);
|
||||
app.run("file.exportAs", json!({"format": "webp"})).unwrap();
|
||||
confirm(&mut app).unwrap();
|
||||
assert_eq!(kind(&app), Some("webpOptions"));
|
||||
let d = app.ui.dialog.as_ref().unwrap();
|
||||
assert_eq!((&d.fields["lossless"], &d.fields["quality"]), (&json!(true), &json!(90)));
|
||||
assert!(quality_disabled(&mut app), "Quality applies to Lossy");
|
||||
frame(&mut app);
|
||||
confirm(&mut app).unwrap();
|
||||
assert_eq!(&written.borrow()[0].1[12..16], b"VP8L", "lossless by default");
|
||||
|
||||
app.run("file.exportAs", json!({"format": "webp"})).unwrap();
|
||||
confirm(&mut app).unwrap();
|
||||
set(&mut app, "lossless", json!(false));
|
||||
set(&mut app, "quality", json!(40));
|
||||
assert!(!quality_disabled(&mut app), "Lossy enables Quality");
|
||||
frame(&mut app);
|
||||
// The dialog's options, as `document.export` takes them.
|
||||
let mut options = app.ui.dialog.as_ref().unwrap().fields.clone();
|
||||
options.retain(|k, _| !k.starts_with("__") && k != "path");
|
||||
let r = confirm(&mut app).unwrap();
|
||||
assert_eq!(r["warnings"], json!([]), "{r}");
|
||||
let file = written.borrow().last().unwrap().1.clone();
|
||||
assert!(file.windows(4).any(|w| w == b"VP8 ") && !file.windows(4).any(|w| w == b"VP8L"), "lossy");
|
||||
// The file is the one `document.export` writes with those options at quality 40.
|
||||
let at = |app: &mut VectorcraftApp, q: u8| {
|
||||
let mut p = options.clone();
|
||||
p.insert("quality".into(), json!(q));
|
||||
vectorcraft_format::base64_decode(app.run("document.export", serde_json::Value::Object(p)).unwrap()["dataBase64"].as_str().unwrap()).unwrap()
|
||||
};
|
||||
assert_eq!(file, at(&mut app, 40));
|
||||
assert_ne!(file, at(&mut app, 90));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -592,6 +592,7 @@ font-technology Variable Променливи
|
||||
Consolidate All Windows Обединяване на всички прозорци
|
||||
Constrain Angle Заключване на ъгъла
|
||||
Constrain Width and Height Proportions Запазване на пропорциите на ширина и височина
|
||||
Copy Width to Height Копиране на ширината във височината
|
||||
Construction Guides Конструкционни водачи
|
||||
Contextual Alternates Контекстни алтернативи
|
||||
Contextual Task Bar Контекстна лента със задачи
|
||||
@@ -1956,7 +1957,8 @@ font-technology Variable Променливи
|
||||
Lock Others Заключване на другите
|
||||
Lock Slices Заключване на фрагментите
|
||||
Lock Station Point Заключване на базовата точка
|
||||
Lossless (lossy WebP isn't available yet) Без загуба (загубеният WebP все още не е наличен)
|
||||
Lossless Без загуба
|
||||
Lossy Със загуба
|
||||
Lossy: С загуба:
|
||||
Low Ниско
|
||||
lowercase малки букви
|
||||
@@ -2993,7 +2995,7 @@ digits Malayalam Малаялам
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Радиусите на динамичните ъгли се мащабират заедно с графиката, освен ако мащабирането не избере друго.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Дебелините на щрихите, тиретата и разстоянията на ефектите се мащабират заедно с графиката, освен ако мащабирането не избере друго.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Колелцето на мишката мащабира платното, вместо да го превърта.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Докато „Мащабиране с колелцето на мишката“ е изключено, колелцето с натиснат Cmd/Ctrl превърта платното настрани.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колелцето на мишката с натиснат Cmd/Ctrl превърта платното настрани.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Влаченето настрани върху етикета на числово поле променя стойността на полето.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Жест за завъртане с два пръста върху тъчпад завърта изгледа на платното.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Задържането на клавишната комбинация на инструмент го избира, докато я пуснете, а след това отново се избира предишният инструмент.
|
||||
@@ -3273,6 +3275,7 @@ digits Malayalam Малаялам
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} от {n} резултат. Продължете да пишете, за да ги стесните.|{shown} от {n} резултата. Продължете да пишете, за да ги стесните.
|
||||
Recent Commands Последни команди
|
||||
No recent commands Няма последни команди
|
||||
Search commands Търсене на команди
|
||||
Search Commands… Търсене на команди…
|
||||
Secondary Вторичен
|
||||
Section Symbol Символ за раздел
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1304,6 +1304,7 @@ lighting Light Svjetlo
|
||||
Search commands, tools, panels and effects Pretraži naredbe, alate, panele i efekte
|
||||
Style: Stil:
|
||||
Switch workspace Promijeni radni prostor
|
||||
Search commands Pretraži naredbe
|
||||
Show all open documents Prikaži sve otvorene dokumente
|
||||
Use Koristite
|
||||
the object to select | objekat za odabir |
|
||||
@@ -2825,7 +2826,8 @@ digits Malayalam Malajalam
|
||||
Hide Video Rulers Sakrij video ravnala
|
||||
Client-side (.html) Na strani klijenta (.html)
|
||||
Color Reduction: Smanjenje boja:
|
||||
Lossless (lossy WebP isn't available yet) Bez gubitaka (WebP s gubicima još nije dostupan)
|
||||
Lossless Bez gubitaka
|
||||
Lossy S gubicima
|
||||
Scans: Skenovi:
|
||||
Server-side (.map) Na strani servera (.map)
|
||||
{format} Options Opcije za {format}
|
||||
@@ -3888,6 +3890,7 @@ theme Appearance Izgled
|
||||
Command Click to Select Objects Behind Command-klik za odabir objekata iza
|
||||
Constrain Angle Ograniči ugao
|
||||
Constrain Width and Height Proportions Zadrži proporcije širine i visine
|
||||
Copy Width to Height Kopiraj širinu u visinu
|
||||
Construction Guides Konstrukcijske vodilice
|
||||
Curvature Tool Alat zakrivljenost
|
||||
Data Recovery Oporavak podataka
|
||||
@@ -4429,7 +4432,7 @@ font-technology Variable Varijabilni
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Poluprečnici dinamičnih uglova skaliraju se zajedno s grafikom, osim ako skaliranje ne odabere drugačije.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Debljine poteza, crtice i udaljenosti efekata skaliraju se zajedno s grafikom, osim ako skaliranje ne odabere drugačije.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Točkić miša zumira platno umjesto da ga pomjera.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Dok je Zumiraj točkićem miša isključeno, točkić miša uz pritisnut Cmd/Ctrl pomjera platno u stranu.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Točkić miša uz pritisnut Cmd/Ctrl pomjera platno u stranu.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Prevlačenje u stranu po oznaci brojčanog polja mijenja vrijednost polja.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Pokret rotacije s dva prsta na dodirnoj podlozi rotira prikaz platna.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Držanje prečice alata bira taj alat dok je ne pustite, a zatim se ponovo bira prethodni alat.
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -884,6 +884,7 @@ antiAlias Sharp Nítid
|
||||
Constrain Restringeix
|
||||
Constrain Angle Angle de restricció
|
||||
Constrain Width and Height Proportions Restringeix les proporcions d’amplada i alçada
|
||||
Copy Width to Height Copia l’amplada a l’alçada
|
||||
Construction Guides Guies de construcció
|
||||
Contextual Alternates Alternatives contextuals
|
||||
Contextual Task Bar Barra de tasques contextual
|
||||
@@ -2561,7 +2562,8 @@ digits Malayalam Malaiàlam
|
||||
Long Lines Línies llargues
|
||||
Long Strokes Traços llargs
|
||||
Longest: El més llarg:
|
||||
Lossless (lossy WebP isn't available yet) Sense pèrdua (el WebP amb pèrdua encara no està disponible)
|
||||
Lossless Sense pèrdua
|
||||
Lossy Amb pèrdua
|
||||
Lossy: Amb pèrdua:
|
||||
Low Baix
|
||||
Low Fidelity Photo Foto de baixa fidelitat
|
||||
@@ -3823,7 +3825,7 @@ digits Malayalam Malaiàlam
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Els radis de cantonada dinàmics s’escalen amb la il·lustració, tret que l’escalat triï una altra cosa.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Els gruixos de traç, els guions i les distàncies dels efectes s’escalen amb la il·lustració, tret que l’escalat triï una altra cosa.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. La roda del ratolí fa zoom al llenç en lloc de desplaçar-lo.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mentre Zoom amb la roda del ratolí està desactivat, la roda amb Cmd/Ctrl premut desplaça el llenç en horitzontal.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La roda del ratolí amb Cmd/Ctrl premut desplaça el llenç en horitzontal.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Arrossegar en horitzontal sobre l’etiqueta d’un camp numèric canvia el valor del camp.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Un gest de rotació amb dos dits al trackpad gira la vista del llenç.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Mantenir premuda la drecera d’una eina la tria fins que la deixeu anar, i després es torna a triar l’eina anterior.
|
||||
@@ -4202,6 +4204,7 @@ digits Malayalam Malaiàlam
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultat. Continueu escrivint per reduir-los.|{shown} de {n} resultats. Continueu escrivint per reduir-los.
|
||||
Recent Commands Ordres recents
|
||||
No recent commands No hi ha ordres recents
|
||||
Search commands Cerca ordres
|
||||
Search Commands… Cerca ordres…
|
||||
Search Fonts Folder Cerca a la carpeta de tipus de lletra
|
||||
Searching… Cercant…
|
||||
@@ -7972,6 +7975,7 @@ breakText Glyphs Glifs
|
||||
@msg Too many Revolve faces for visibility evaluation Massa cares de Revolució per avaluar-ne la visibilitat
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft llegeix com a màxim {ASE_MAX_ENTRIES} colors i grups d’un fitxer d’intercanvi de mostres, i aquesta biblioteca en té {entries}
|
||||
@msg WebP encoding failed: {e} La codificació WebP ha fallat: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless La codificació WebP ha fallat: la imatge és massa gran per a WebP amb pèrdua: reduïu la resolució o trieu Sense pèrdua
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `index` must be a whole number `index` ha de ser un nombre enter
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -1328,6 +1328,7 @@ lighting Light Světlo
|
||||
Search commands, tools, panels and effects Hledat příkazy, nástroje, panely a efekty
|
||||
Style: Styl:
|
||||
Switch workspace Přepnout pracovní prostor
|
||||
Search commands Hledat příkazy
|
||||
Show all open documents Zobrazit všechny otevřené dokumenty
|
||||
Use Příkazem
|
||||
the object to select | na objekt jej vybere |
|
||||
@@ -2909,7 +2910,8 @@ digits Malayalam Malajálamské
|
||||
Hide Video Rulers Skrýt video pravítka
|
||||
Client-side (.html) Na straně klienta (.html)
|
||||
Color Reduction: Redukce barev:
|
||||
Lossless (lossy WebP isn't available yet) Bezeztrátový (ztrátový WebP zatím není k dispozici)
|
||||
Lossless Bezeztrátový
|
||||
Lossy Ztrátový
|
||||
Scans: Průchody:
|
||||
Server-side (.map) Na straně serveru (.map)
|
||||
{format} Options Možnosti {format}
|
||||
@@ -3990,6 +3992,7 @@ theme Appearance Motiv
|
||||
Command Click to Select Objects Behind Kliknutím s Cmd vybírat objekty vzadu
|
||||
Constrain Angle Úhel omezení
|
||||
Constrain Width and Height Proportions Zachovat proporce šířky a výšky
|
||||
Copy Width to Height Kopírovat šířku do výšky
|
||||
Construction Guides Konstrukční vodítka
|
||||
Curvature Tool Nástroj Zakřivení
|
||||
Data Recovery Obnovení dat
|
||||
@@ -4533,7 +4536,7 @@ font-technology Variable Variabilní
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Poloměry živých rohů se mění s velikostí kresby, pokud změna velikosti nezvolí jinak.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Tloušťky tahů, čárky a vzdálenosti efektů se mění s velikostí kresby, pokud změna velikosti nezvolí jinak.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Kolečko myši plátno zvětšuje a zmenšuje místo posouvání.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Dokud je Zvětšovat kolečkem myši vypnuto, kolečko myši s podrženou klávesou Cmd/Ctrl posouvá plátno do stran.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Kolečko myši s podrženou klávesou Cmd/Ctrl posouvá plátno do stran.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Tažení do stran po popisku číselného pole mění hodnotu pole.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Gesto otočení dvěma prsty na trackpadu otáčí zobrazení plátna.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Podržení zkratky nástroje vybere nástroj, dokud ji nepustíte, a pak se znovu vybere předchozí nástroj.
|
||||
@@ -7879,6 +7882,7 @@ breakText Glyphs Glyfy
|
||||
@msg Too many Revolve faces for visibility evaluation Rotační těleso má příliš mnoho stěn pro výpočet viditelnosti
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft čte ze souboru pro výměnu vzorníku nejvýše {ASE_MAX_ENTRIES} barev a skupin a tato knihovna jich má {entries}
|
||||
@msg WebP encoding failed: {e} kódování WebP selhalo: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless kódování WebP selhalo: obrázek je pro ztrátový WebP příliš velký: snižte rozlišení nebo zvolte Bezeztrátový
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` je smallThumb, mediumThumb, largeThumb, smallList nebo largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1007,6 +1007,7 @@ liquify-list-end {0}, {1} {0} og {1}
|
||||
@msg Trap: more than {_1} pairs of objects lie close enough to trap, or too many objects share a horizontal range; trap fewer objects at a time Trap: mere end {_1} par objekter ligger tæt nok til overfyldning, eller for mange objekter deler et vandret område; anvend Trap på færre objekter ad gangen
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft læser højst {ASE_MAX_ENTRIES} farver og grupper fra en farveprøveudvekslingsfil, og dette bibliotek har {entries}
|
||||
@msg WebP encoding failed: {e} WebP-kodning mislykkedes: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP-kodning mislykkedes: billedet er for stort til WebP med tab: sænk opløsningen, eller vælg Tabsfri
|
||||
@msg Weed Box and Lines: no weeding line fits outside the art, and the weed box is off Lugeramme og lugelinjer: ingen lugelinje passer uden for grafikken, og lugerammen er slået fra
|
||||
@msg \\ at end of pattern \\ i slutningen af mønsteret
|
||||
@msg `alignOn` cannot be empty `alignOn` må ikke være tom
|
||||
@@ -3924,6 +3925,7 @@ lighting Light Lys
|
||||
Search commands, tools, panels and effects Søg i kommandoer, værktøjer, paneler og effekter
|
||||
Style: Typografi:
|
||||
Switch workspace Skift arbejdsområde
|
||||
Search commands Søg i kommandoer
|
||||
Show all open documents Vis alle åbne dokumenter
|
||||
Use Brug
|
||||
the object to select | på objektet for at markere det |
|
||||
@@ -5376,7 +5378,8 @@ digits Malayalam Malayalam
|
||||
Hide Video Rulers Skjul videolinealer
|
||||
Client-side (.html) Klientbaseret (.html)
|
||||
Color Reduction: Farvereduktion:
|
||||
Lossless (lossy WebP isn't available yet) Tabsfri (WebP med tab er ikke tilgængelig endnu)
|
||||
Lossless Tabsfri
|
||||
Lossy Med tab
|
||||
Scans: Scanninger:
|
||||
Server-side (.map) Serverbaseret (.map)
|
||||
{format} Options Indstillinger for {format}
|
||||
@@ -6406,6 +6409,7 @@ theme Appearance Udseende
|
||||
Command Click to Select Objects Behind Command-klik for at markere objekter bagved
|
||||
Constrain Angle Fastlåsningsvinkel
|
||||
Constrain Width and Height Proportions Fasthold forholdet mellem bredde og højde
|
||||
Copy Width to Height Kopiér bredde til højde
|
||||
Construction Guides Konstruktionshjælpelinjer
|
||||
Curvature Tool Krumningsværktøj
|
||||
Data Recovery Datgendannelse
|
||||
@@ -6926,7 +6930,7 @@ font-technology Variable Variable
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Live-hjørneradier skaleres med grafikken, medmindre skaleringen vælger andet.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Stregtykkelser, streger i stiplede linjer og effektafstande skaleres med grafikken, medmindre skaleringen vælger andet.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Musehjulet zoomer lærredet i stedet for at rulle det.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mens Zoom med musehjul er slået fra, ruller musehjulet med Cmd/Ctrl holdt nede lærredet sidelæns.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Musehjulet med Cmd/Ctrl holdt nede ruller lærredet sidelæns.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Når du trækker sidelæns på et talfelts etiket, ændres feltets værdi.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. En rotationsbevægelse med to fingre på en pegeplade roterer visningen af lærredet.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Når du holder et værktøjs genvejstast nede, er værktøjet valgt, indtil du slipper, og derefter vælges det forrige værktøj igen.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -585,6 +585,7 @@ font-technology Variable Variabel
|
||||
Consolidate All Windows Alle Fenster zusammenführen
|
||||
Constrain Angle Winkelbeschränkung
|
||||
Constrain Width and Height Proportions Proportionen von Breite und Höhe beibehalten
|
||||
Copy Width to Height Breite in Höhe kopieren
|
||||
Construction Guides Konstruktionslinien
|
||||
Contextual Alternates Kontextbedingte Varianten
|
||||
Contextual Task Bar Kontextbezogene Taskleiste
|
||||
@@ -2036,7 +2037,8 @@ file-filter Templates Vorlagen
|
||||
Lock Others Andere sperren
|
||||
Lock Slices Slices sperren
|
||||
Lock Station Point Standpunkt sperren
|
||||
Lossless (lossy WebP isn't available yet) Verlustfrei (verlustbehaftetes WebP ist noch nicht verfügbar)
|
||||
Lossless Verlustfrei
|
||||
Lossy Verlustbehaftet
|
||||
Lossy: Verlustbehaftet:
|
||||
Low Niedrig
|
||||
lowercase kleinbuchstaben
|
||||
@@ -3043,7 +3045,7 @@ digits Malayalam Malayalam
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Live-Eckenradien skalieren mit dem Bildmaterial, sofern die Skalierung nichts anderes wählt.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Konturstärken, Striche und Effektabstände skalieren mit dem Bildmaterial, sofern die Skalierung nichts anderes wählt.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Das Mausrad zoomt die Arbeitsfläche, statt sie zu scrollen.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Solange „Mit Mausrad zoomen“ aus ist, scrollt das Mausrad mit gedrückter Befehls-/Strg-Taste die Arbeitsfläche seitwärts.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mit gedrückter Befehls-/Strg-Taste scrollt das Mausrad die Arbeitsfläche seitwärts.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Seitliches Ziehen auf der Beschriftung eines Zahlenfelds ändert den Wert des Felds.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Eine Drehgeste mit zwei Fingern auf einem Trackpad dreht die Ansicht der Arbeitsfläche.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Solange Sie das Tastaturkürzel eines Werkzeugs gedrückt halten, ist dieses Werkzeug gewählt; danach wird wieder das vorherige gewählt.
|
||||
@@ -3337,6 +3339,7 @@ digits Malayalam Malayalam
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} von {n} Ergebnis. Tippen Sie weiter, um sie einzugrenzen.|{shown} von {n} Ergebnissen. Tippen Sie weiter, um sie einzugrenzen.
|
||||
Recent Commands Zuletzt verwendete Befehle
|
||||
No recent commands Keine zuletzt verwendeten Befehle
|
||||
Search commands Befehle suchen
|
||||
Search Commands… Befehle suchen…
|
||||
Secondary Sekundär
|
||||
Section Symbol Paragrafenzeichen
|
||||
@@ -9344,6 +9347,7 @@ breakText Glyphs Glyphen
|
||||
@msg Too many Revolve faces for visibility evaluation Zu viele Kreiseln-Flächen für die Sichtbarkeitsberechnung
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft liest höchstens {ASE_MAX_ENTRIES} Farben und Gruppen aus einer Farbfeld-Austauschdatei, und diese Bibliothek hat {entries}
|
||||
@msg WebP encoding failed: {e} WebP-Kodierung fehlgeschlagen: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP-Kodierung fehlgeschlagen: Das Bild ist für verlustbehaftetes WebP zu groß: Verringern Sie die Auflösung oder wählen Sie Verlustfrei
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` ist smallThumb, mediumThumb, largeThumb, smallList oder largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -566,6 +566,7 @@ font-technology Variable Μεταβλητές
|
||||
Consolidate All Windows Συγχώνευση όλων των παραθύρων
|
||||
Constrain Angle Περιορισμός γωνίας
|
||||
Constrain Width and Height Proportions Διατήρηση αναλογιών πλάτους και ύψους
|
||||
Copy Width to Height Αντιγραφή πλάτους στο ύψος
|
||||
Construction Guides Οδηγοί κατασκευής
|
||||
Contextual Alternates Εναλλακτικοί χαρακτήρες βάσει συμφραζομένων
|
||||
Contextual Task Bar Γραμμή εργασιών βάσει περιβάλλοντος
|
||||
@@ -3105,7 +3106,8 @@ theme Appearance Εμφάνιση
|
||||
Lock Grid Κλείδωμα πλέγματος
|
||||
Lock Others Κλείδωμα υπόλοιπων
|
||||
Lock Station Point Κλείδωμα σταθερού σημείου
|
||||
Lossless (lossy WebP isn't available yet) Χωρίς απώλειες (το WebP με απώλειες δεν υποστηρίζεται ακόμη)
|
||||
Lossless Χωρίς απώλειες
|
||||
Lossy Με απώλειες
|
||||
Lossy: Με απώλειες:
|
||||
lowercase πεζά
|
||||
LZW Compression Συμπίεση LZW
|
||||
@@ -3858,7 +3860,7 @@ digits Malayalam Μαλαγιάλαμ
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Οι ακτίνες των δυναμικών γωνιών κλιμακώνονται μαζί με το γραφικό, εκτός αν η κλιμάκωση επιλέξει κάτι άλλο.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Τα πάχη περιγράμματος, οι παύλες και οι αποστάσεις των εφέ κλιμακώνονται μαζί με το γραφικό, εκτός αν η κλιμάκωση επιλέξει κάτι άλλο.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Ο τροχός του ποντικιού κάνει ζουμ στον καμβά αντί να τον κυλά.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Όσο το Ζουμ με τον τροχό του ποντικιού είναι ανενεργό, ο τροχός με πατημένο το Cmd/Ctrl κυλά τον καμβά οριζόντια.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Ο τροχός του ποντικιού με πατημένο το Cmd/Ctrl κυλά τον καμβά οριζόντια.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Η μεταφορά προς τα πλάγια πάνω στην ετικέτα ενός αριθμητικού πεδίου αλλάζει την τιμή του πεδίου.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Μια κίνηση περιστροφής με δύο δάχτυλα σε επιφάνεια αφής περιστρέφει την προβολή του καμβά.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Όσο κρατάτε πατημένη τη συντόμευση ενός εργαλείου, το εργαλείο είναι επιλεγμένο, και μετά επιλέγεται ξανά το προηγούμενο εργαλείο.
|
||||
@@ -4039,6 +4041,7 @@ digits Malayalam Μαλαγιάλαμ
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} από {n} αποτέλεσμα. Συνεχίστε να πληκτρολογείτε για να τα περιορίσετε.|{shown} από {n} αποτελέσματα. Συνεχίστε να πληκτρολογείτε για να τα περιορίσετε.
|
||||
Recent Commands Πρόσφατες εντολές
|
||||
No recent commands Δεν υπάρχουν πρόσφατες εντολές
|
||||
Search commands Αναζήτηση εντολών
|
||||
Search Commands… Αναζήτηση εντολών…
|
||||
Secondary Δευτερεύον
|
||||
Section Symbol Σύμβολο ενότητας
|
||||
@@ -7946,6 +7949,7 @@ breakText Glyphs Γλύφοι
|
||||
@msg Too many Revolve faces for visibility evaluation Πάρα πολλές έδρες περιστροφής για τον έλεγχο ορατότητας
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} Το VectorCraft διαβάζει το πολύ {ASE_MAX_ENTRIES} χρώματα και ομάδες από ένα αρχείο ανταλλαγής δειγμάτων, και αυτή η βιβλιοθήκη έχει {entries}
|
||||
@msg WebP encoding failed: {e} Η κωδικοποίηση WebP απέτυχε: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Η κωδικοποίηση WebP απέτυχε: η εικόνα είναι πολύ μεγάλη για WebP με απώλειες: μειώστε την ανάλυση ή επιλέξτε Χωρίς απώλειες
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `index` must be a whole number Το `index` πρέπει να είναι ακέραιος αριθμός
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList Το `view` είναι smallThumb, mediumThumb, largeThumb, smallList ή largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -607,6 +607,7 @@ font-technology Variable Variables
|
||||
Consolidate All Windows Consolidar todas las ventanas
|
||||
Constrain Angle Restringir ángulo
|
||||
Constrain Width and Height Proportions Restringir proporciones de anchura y altura
|
||||
Copy Width to Height Copiar anchura en altura
|
||||
Construction Guides Guías de construcción
|
||||
Contextual Alternates Alternativas contextuales
|
||||
Contextual Task Bar Barra de tareas contextual
|
||||
@@ -2037,7 +2038,8 @@ font-technology Variable Variables
|
||||
Lock Others Bloquear otros
|
||||
Lock Slices Bloquear sectores
|
||||
Lock Station Point Bloquear punto de estación
|
||||
Lossless (lossy WebP isn't available yet) Sin pérdida (WebP con pérdida aún no está disponible)
|
||||
Lossless Sin pérdida
|
||||
Lossy Con pérdida
|
||||
Lossy: Con pérdida:
|
||||
Low Baja
|
||||
lowercase minúsculas
|
||||
@@ -3083,7 +3085,7 @@ digits Malayalam Malayálam
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Los radios de esquina dinámicos se escalan con la ilustración, salvo que el escalado indique otra cosa.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Los grosores de trazo, los guiones y las distancias de los efectos se escalan con la ilustración, salvo que el escalado indique otra cosa.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. La rueda del mouse aplica zoom al lienzo en lugar de desplazarlo.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mientras Zoom con la rueda del mouse está desactivado, la rueda con Cmd/Ctrl pulsado desplaza el lienzo en horizontal.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La rueda del mouse con Cmd/Ctrl pulsado desplaza el lienzo en horizontal.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Arrastrar en horizontal sobre la etiqueta de un campo numérico cambia el valor del campo.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Un gesto de giro con dos dedos en un trackpad gira la vista del lienzo.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Mantener pulsado el atajo de una herramienta la elige hasta que lo suelta, y después vuelve a elegirse la herramienta anterior.
|
||||
@@ -3375,6 +3377,7 @@ digits Malayalam Malayálam
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultado. Sigue escribiendo para acotarlos.|{shown} de {n} resultados. Sigue escribiendo para acotarlos.
|
||||
Recent Commands Comandos recientes
|
||||
No recent commands No hay comandos recientes
|
||||
Search commands Buscar comandos
|
||||
Search Commands… Buscar comandos…
|
||||
Secondary Secundario
|
||||
Section Symbol Símbolo de sección
|
||||
@@ -7793,6 +7796,7 @@ breakText Glyphs Glifos
|
||||
@msg Too many Revolve faces for visibility evaluation Demasiadas caras de Revolución para evaluar la visibilidad
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft lee como máximo {ASE_MAX_ENTRIES} colores y grupos de un archivo de intercambio de muestras, y esta biblioteca tiene {entries}
|
||||
@msg WebP encoding failed: {e} Error al codificar WebP: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Error al codificar WebP: la imagen es demasiado grande para WebP con pérdida: reduzca la resolución o elija Sin pérdida
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` es smallThumb, mediumThumb, largeThumb, smallList o largeList
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -1306,6 +1306,7 @@ lighting Light Valo
|
||||
Search commands, tools, panels and effects Hae komentoja, työkaluja, paneeleita ja tehosteita
|
||||
Style: Tyyli:
|
||||
Switch workspace Vaihda työtilaa
|
||||
Search commands Hae komentoja
|
||||
Show all open documents Näytä kaikki avoimet asiakirjat
|
||||
Use Käytä
|
||||
the object to select | objektia valitaksesi sen |
|
||||
@@ -2853,7 +2854,8 @@ digits Malayalam Malajalam
|
||||
Hide Video Rulers Piilota videoviivaimet
|
||||
Client-side (.html) Asiakaspuoli (.html)
|
||||
Color Reduction: Värien vähennys:
|
||||
Lossless (lossy WebP isn't available yet) Häviötön (häviöllinen WebP ei ole vielä käytettävissä)
|
||||
Lossless Häviötön
|
||||
Lossy Häviöllinen
|
||||
Scans: Läpikäynnit:
|
||||
Server-side (.map) Palvelinpuoli (.map)
|
||||
{format} Options {format}-asetukset
|
||||
@@ -3928,6 +3930,7 @@ theme Appearance Ulkoasu
|
||||
Command Click to Select Objects Behind Valitse takana olevat objektit Komento-napsautuksella
|
||||
Constrain Angle Rajoita kulmaa
|
||||
Constrain Width and Height Proportions Säilytä leveyden ja korkeuden suhde
|
||||
Copy Width to Height Kopioi leveys korkeudeksi
|
||||
Construction Guides Rakenneapuviivat
|
||||
Curvature Tool Kaarevuustyökalu
|
||||
Data Recovery Tietojen palautus
|
||||
@@ -4452,7 +4455,7 @@ font-technology Variable Muuttuvat
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Dynaamisten kulmien säteet skaalautuvat grafiikan mukana, ellei skaalaus valitse toisin.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Viivojen paksuudet, katkoviivat ja tehosteiden etäisyydet skaalautuvat grafiikan mukana, ellei skaalaus valitse toisin.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Hiiren rulla zoomaa piirtopintaa vierittämisen sijaan.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Kun Zoomaa hiiren rullalla ei ole käytössä, hiiren rulla vierittää piirtopintaa sivuttain, kun Cmd/Ctrl on painettuna.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Hiiren rulla vierittää piirtopintaa sivuttain, kun Cmd/Ctrl on painettuna.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Numerokentän nimiön vetäminen sivuttain muuttaa kentän arvoa.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Kahden sormen kiertoele kosketuslevyllä kiertää piirtopinnan näkymää.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Työkalun pikanäppäimen pitäminen painettuna valitsee työkalun, kunnes päästät irti, ja sitten edellinen työkalu valitaan uudelleen.
|
||||
@@ -8027,6 +8030,7 @@ breakText Glyphs Merkit
|
||||
@msg Too many Revolve faces for visibility evaluation Pyöräytä-tehosteessa on liian monta tahkoa näkyvyyden arviointiin
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft lukee värimallien vaihtotiedostosta enintään {ASE_MAX_ENTRIES} väriä ja ryhmää, ja tässä kirjastossa niitä on {entries}
|
||||
@msg WebP encoding failed: {e} WebP-koodaus epäonnistui: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP-koodaus epäonnistui: kuva on liian suuri häviölliseen WebP-muotoon: pienennä tarkkuutta tai valitse Häviötön
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `index` must be a whole number `index` on oltava kokonaisluku
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2 and column 73.
|
@@ -608,6 +608,7 @@ font-technology Variable Variables
|
||||
Consolidate All Windows Regrouper toutes les fenêtres
|
||||
Constrain Angle Contraindre l’angle
|
||||
Constrain Width and Height Proportions Conserver les proportions de largeur et de hauteur
|
||||
Copy Width to Height Copier la largeur dans la hauteur
|
||||
Construction Guides Repères de construction
|
||||
Contextual Alternates Variantes contextuelles
|
||||
Contextual Task Bar Barre des tâches contextuelle
|
||||
@@ -2027,7 +2028,8 @@ font-technology Variable Variables
|
||||
Lock Others Verrouiller les autres
|
||||
Lock Slices Verrouiller les tranches
|
||||
Lock Station Point Verrouiller le point d’observation
|
||||
Lossless (lossy WebP isn't available yet) Sans perte (le WebP avec perte n’est pas encore disponible)
|
||||
Lossless Sans perte
|
||||
Lossy Avec perte
|
||||
Lossy: Avec perte :
|
||||
Low Faible
|
||||
lowercase minuscules
|
||||
@@ -3071,7 +3073,7 @@ digits Malayalam Malayalam
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Les rayons d’angle dynamiques se mettent à l’échelle avec l’illustration, sauf si la mise à l’échelle en décide autrement.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Les épaisseurs de contour, les tirets et les distances des effets se mettent à l’échelle avec l’illustration, sauf si la mise à l’échelle en décide autrement.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. La molette de la souris zoome sur la zone de travail au lieu de la faire défiler.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Tant que Zoom avec la molette de la souris est désactivé, la molette avec Cmd/Ctrl enfoncée fait défiler la zone de travail latéralement.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La molette de la souris avec Cmd/Ctrl enfoncée fait défiler la zone de travail latéralement.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Faire glisser latéralement le libellé d’un champ numérique modifie la valeur du champ.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Un geste de rotation à deux doigts sur un pavé tactile fait pivoter la vue de la zone de travail.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Maintenir le raccourci d’un outil choisit cet outil jusqu’à ce que vous le relâchiez, puis l’outil précédent est de nouveau choisi.
|
||||
@@ -3363,6 +3365,7 @@ digits Malayalam Malayalam
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} sur {n} résultat. Continuez à taper pour les affiner.|{shown} sur {n} résultats. Continuez à taper pour les affiner.
|
||||
Recent Commands Commandes récentes
|
||||
No recent commands Aucune commande récente
|
||||
Search commands Chercher des commandes
|
||||
Search Commands… Rechercher des commandes…
|
||||
Secondary Secondaire
|
||||
Section Symbol Symbole de section
|
||||
@@ -9755,6 +9758,7 @@ breakText Glyphs Glyphes
|
||||
@msg Too many Revolve faces for visibility evaluation Trop de faces de révolution pour évaluer la visibilité
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft lit au plus {ASE_MAX_ENTRIES} couleurs et groupes d’un fichier d’échange de nuances, et cette bibliothèque en contient {entries}
|
||||
@msg WebP encoding failed: {e} Échec de l’encodage WebP : {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Échec de l’encodage WebP : l’image est trop grande pour le WebP avec perte : réduisez la résolution ou choisissez Sans perte
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}` : {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` vaut smallThumb, mediumThumb, largeThumb, smallList ou largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -704,6 +704,7 @@
|
||||
Constrain મર્યાદિત કરો
|
||||
Constrain Angle ખૂણો મર્યાદિત કરો
|
||||
Constrain Width and Height Proportions પહોળાઈ અને ઊંચાઈનો પ્રમાણ મર્યાદિત કરો
|
||||
Copy Width to Height પહોળાઈને ઊંચાઈમાં નકલ કરો
|
||||
Construction Guides બાંધકામ ગાઇડ્સ
|
||||
Contextual Alternates સંદર્ભિત વૈકલ્પિક અક્ષરો
|
||||
Contextual Task Bar સંદર્ભિત ટાસ્ક બાર
|
||||
@@ -2101,7 +2102,8 @@
|
||||
Locked લૉક કરેલું
|
||||
Long લાંબું
|
||||
Longest: સૌથી લાંબું:
|
||||
Lossless (lossy WebP isn't available yet) લોસલેસ (લોસી WebP હજી ઉપલબ્ધ નથી)
|
||||
Lossless લોસલેસ
|
||||
Lossy લોસી
|
||||
Lossy: લોસી:
|
||||
Luminosity લ્યુમિનોસિટી
|
||||
Magic Wand મૅજિક વૅન્ડ
|
||||
@@ -3151,7 +3153,7 @@
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. લાઇવ ખૂણાઓની ત્રિજ્યાઓ આર્ટવર્ક સાથે સ્કેલ થાય છે, સિવાય કે સ્કેલિંગ બીજું પસંદ કરે.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. સ્ટ્રોકની જાડાઈ, ડેશ અને ઇફેક્ટના અંતરો આર્ટવર્ક સાથે સ્કેલ થાય છે, સિવાય કે સ્કેલિંગ બીજું પસંદ કરે.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. માઉસ વ્હીલ કેનવાસને સ્ક્રોલ કરવાને બદલે ઝૂમ કરે છે.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. માઉસ વ્હીલથી ઝૂમ કરો બંધ હોય ત્યારે, Cmd/Ctrl દબાવી રાખીને માઉસ વ્હીલ ફેરવવાથી કેનવાસ બાજુમાં સ્ક્રોલ થાય છે.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl દબાવી રાખીને માઉસ વ્હીલ ફેરવવાથી કેનવાસ બાજુમાં સ્ક્રોલ થાય છે.
|
||||
Dragging sideways on a numeric field's label changes the field's value. સંખ્યાત્મક ફીલ્ડના લેબલ પર બાજુમાં ખેંચવાથી ફીલ્ડનું મૂલ્ય બદલાય છે.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. ટ્રેકપેડ પર બે આંગળીથી ફેરવવાનો હાવભાવ કેનવાસનું દૃશ્ય ફેરવે છે.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ટૂલની શોર્ટકટ કી દબાવી રાખવાથી છોડો ત્યાં સુધી તે ટૂલ પસંદ રહે છે, પછી અગાઉનું ટૂલ ફરી પસંદ થાય છે.
|
||||
@@ -3479,6 +3481,7 @@
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} માંથી {shown} પરિણામ. તેમને સંકુચિત કરવા લખતા રહો.|{n} માંથી {shown} પરિણામો. તેમને સંકુચિત કરવા લખતા રહો.
|
||||
Recent Commands તાજેતરના આદેશો
|
||||
No recent commands કોઈ તાજેતરના આદેશો નથી
|
||||
Search commands આદેશો શોધો
|
||||
Search images છબીઓ શોધો
|
||||
Searching… શોધી રહ્યા છીએ…
|
||||
Secondary ગૌણ
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 72 and column 5.
|
@@ -1019,6 +1019,7 @@ antiAlias Sharp शार्प
|
||||
Constrain सीमित करें
|
||||
Constrain Angle कंस्ट्रेन एंगल
|
||||
Constrain Width and Height Proportions चौड़ाई और ऊंचाई का अनुपात बनाए रखें
|
||||
Copy Width to Height चौड़ाई को ऊंचाई में कॉपी करें
|
||||
Construction Guides निर्माण गाइड
|
||||
Conté Crayon कॉन्टे क्रेयॉन
|
||||
Conté Crayon… कॉन्टे क्रेयॉन…
|
||||
@@ -2805,7 +2806,8 @@ antiAlias Sharp शार्प
|
||||
Long Lines लंबी रेखाएँ
|
||||
Long Strokes लंबे स्ट्रोक
|
||||
Longest: सबसे लंबे:
|
||||
Lossless (lossy WebP isn't available yet) लॉसलेस (लॉसी WebP अभी उपलब्ध नहीं है)
|
||||
Lossless लॉसलेस
|
||||
Lossy लॉसी
|
||||
Lossy: हानि:
|
||||
Low निम्न
|
||||
Low Fidelity Photo लो फिडेलिटी फोटो
|
||||
@@ -4193,7 +4195,7 @@ antiAlias Sharp शार्प
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. लाइव कोनों की त्रिज्याएँ आर्टवर्क के साथ स्केल होती हैं, जब तक स्केलिंग कुछ और न चुने।
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. स्ट्रोक की मोटाई, डैश और इफ़ेक्ट की दूरियाँ आर्टवर्क के साथ स्केल होती हैं, जब तक स्केलिंग कुछ और न चुने।
|
||||
The mouse wheel zooms the canvas instead of scrolling it. माउस व्हील कैनवास को स्क्रॉल करने की जगह ज़ूम करता है।
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. जब माउस व्हील के साथ ज़ूम बंद हो, तब Cmd/Ctrl दबाकर माउस व्हील घुमाने से कैनवास बगल की ओर स्क्रॉल होता है।
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl दबाकर माउस व्हील घुमाने से कैनवास बगल की ओर स्क्रॉल होता है।
|
||||
Dragging sideways on a numeric field's label changes the field's value. किसी संख्या वाले फ़ील्ड के लेबल पर बगल की ओर ड्रैग करने से फ़ील्ड का मान बदलता है।
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. ट्रैकपैड पर दो उंगलियों से घुमाने का जेस्चर कैनवास के व्यू को घुमाता है।
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. किसी टूल की शॉर्टकट कुंजी दबाए रखने पर वह टूल छोड़ने तक चुना रहता है, फिर पिछला टूल दोबारा चुना जाता है।
|
||||
@@ -4552,6 +4554,7 @@ antiAlias Sharp शार्प
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} में से {shown} परिणाम। इन्हें सीमित करने के लिए लिखते रहें।|{n} में से {shown} परिणाम। इन्हें सीमित करने के लिए लिखते रहें।
|
||||
Recent Commands हाल के आदेश
|
||||
No recent commands कोई हाल का आदेश नहीं
|
||||
Search commands आदेश खोजें
|
||||
Search Commands… कमांड खोजें…
|
||||
Search Fonts Folder खोज फ़ॉन्ट फ़ोल्डर
|
||||
Search images इमेज खोजना
|
||||
@@ -9370,6 +9373,7 @@ theme Appearance अपीयरेंस
|
||||
@msg Too many Revolve faces for visibility evaluation दृश्यता की गणना के लिए रिवॉल्व के फ़ेस बहुत अधिक हैं
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft स्वॉच एक्सचेंज फ़ाइल से अधिकतम {ASE_MAX_ENTRIES} रंग और ग्रुप पढ़ता है, और इस लाइब्रेरी में {entries} हैं
|
||||
@msg WebP encoding failed: {e} WebP एन्कोडिंग विफल: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP एन्कोडिंग विफल: छवि लॉसी WebP के लिए बहुत बड़ी है: रिज़ॉल्यूशन कम करें या लॉसलेस चुनें
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `index` must be a whole number `index` पूरी संख्या होनी चाहिए
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` smallThumb, mediumThumb, largeThumb, smallList या largeList होता है
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -801,6 +801,7 @@ font-technology Variable Változó
|
||||
Constrain Korlátozás
|
||||
Constrain Angle Korlátozási szög
|
||||
Constrain Width and Height Proportions Szélesség és magasság arányának megtartása
|
||||
Copy Width to Height Szélesség másolása a magasságba
|
||||
Construction Guides Szerkesztési segédvonalak
|
||||
Contextual Alternates Környezetfüggő változatok
|
||||
Contextual Task Bar Helyzetérzékeny műveletsáv
|
||||
@@ -2543,7 +2544,8 @@ file-filter Templates Sablonok
|
||||
Long Lines Hosszú vonalak
|
||||
Long Strokes Hosszú vonások
|
||||
Longest: Leghosszabb:
|
||||
Lossless (lossy WebP isn't available yet) Veszteségmentes (a veszteséges WebP még nem érhető el)
|
||||
Lossless Veszteségmentes
|
||||
Lossy Veszteséges
|
||||
Lossy: Veszteség:
|
||||
Low Alacsony
|
||||
Low Fidelity Photo Kis pontosságú fotó
|
||||
@@ -3664,7 +3666,7 @@ mark-style Japanese Japán
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Az élő sarkok sugara a grafikával együtt méreteződik, hacsak a méretezés mást nem választ.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. A körvonalvastagságok, a szaggatások és az effektustávolságok a grafikával együtt méreteződnek, hacsak a méretezés mást nem választ.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Az egérgörgő görgetés helyett nagyítja vagy kicsinyíti a vásznat.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Amíg a Nagyítás egérgörgővel ki van kapcsolva, az egérgörgő lenyomott Cmd/Ctrl billentyűvel oldalirányban görgeti a vásznat.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Az egérgörgő lenyomott Cmd/Ctrl billentyűvel oldalirányban görgeti a vásznat.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Egy számmező címkéjén oldalirányban húzva módosul a mező értéke.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Az érintőpadon végzett kétujjas forgató kézmozdulat elforgatja a vászon nézetét.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Egy eszköz billentyűparancsát lenyomva tartva az eszköz a felengedésig ki van választva, utána ismét az előző eszköz lesz kiválasztva.
|
||||
@@ -3996,6 +3998,7 @@ mark-style Japanese Japán
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} találatból {shown} látható. Gépeljen tovább a szűkítéshez.
|
||||
Recent Commands Legutóbbi parancsok
|
||||
No recent commands Nincsenek legutóbbi parancsok
|
||||
Search commands Parancsok keresése
|
||||
Search Commands… Parancsok keresése…
|
||||
Search Fonts Folder Keresés betűtípusmappában
|
||||
Searching… Keresés…
|
||||
@@ -9756,6 +9759,7 @@ breakText Glyphs Glifák
|
||||
@msg Too many Revolve faces for visibility evaluation Túl sok lap a láthatóság kiértékeléséhez (Forgatás tengely körül)
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} A VectorCraft legfeljebb {ASE_MAX_ENTRIES} színt és csoportot olvas be egy színmintacsere-fájlból, ebben a könyvtárban pedig ennyi van: {entries}
|
||||
@msg WebP encoding failed: {e} A WebP-kódolás sikertelen: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless A WebP-kódolás sikertelen: a kép túl nagy a veszteséges WebP-hez: csökkentse a felbontást, vagy válassza a Veszteségmentes lehetőséget
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `index` must be a whole number `index`: egész szám kell
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view`: smallThumb, mediumThumb, largeThumb, smallList vagy largeList lehet
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1231,6 +1231,7 @@ lighting Light Cahaya
|
||||
Search commands, tools, panels and effects Cari perintah, alat, panel, dan efek
|
||||
Style: Gaya:
|
||||
Switch workspace Ganti ruang kerja
|
||||
Search commands Cari perintah
|
||||
Show all open documents Tampilkan semua dokumen terbuka
|
||||
Use Gunakan
|
||||
the object to select | objek untuk memilihnya |
|
||||
@@ -2634,7 +2635,8 @@ digits Malayalam Malayalam
|
||||
Hide Video Rulers Sembunyikan penggaris video
|
||||
Client-side (.html) Sisi klien (.html)
|
||||
Color Reduction: Reduksi warna:
|
||||
Lossless (lossy WebP isn't available yet) Tanpa kehilangan (WebP lossy belum tersedia)
|
||||
Lossless Tanpa kehilangan
|
||||
Lossy Dengan kehilangan
|
||||
Scans: Pemindaian:
|
||||
Server-side (.map) Sisi server (.map)
|
||||
{format} Options Opsi {format}
|
||||
@@ -3664,6 +3666,7 @@ theme Appearance Tampilan
|
||||
Command Click to Select Objects Behind Command-klik untuk memilih objek di belakang
|
||||
Constrain Angle Sudut kendala
|
||||
Constrain Width and Height Proportions Kendalikan proporsi lebar dan tinggi
|
||||
Copy Width to Height Salin lebar ke tinggi
|
||||
Construction Guides Panduan konstruksi
|
||||
Curvature Tool Alat kelengkungan
|
||||
Data Recovery Pemulihan data
|
||||
@@ -4184,7 +4187,7 @@ font-technology Variable Variabel
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Radius sudut dinamis ikut diskalakan dengan karya seni, kecuali penskalaan memilih lain.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Ketebalan stroke, garis putus, dan jarak efek ikut diskalakan dengan karya seni, kecuali penskalaan memilih lain.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Roda mouse melakukan zum pada kanvas, bukan menggulirnya.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Selama Zum dengan roda mouse nonaktif, roda mouse dengan Cmd/Ctrl ditahan menggulir kanvas ke samping.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Roda mouse dengan Cmd/Ctrl ditahan menggulir kanvas ke samping.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Menyeret ke samping pada label bidang angka mengubah nilai bidang itu.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Gerakan putar dua jari pada trackpad memutar tampilan kanvas.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Menahan tombol pintasan alat memilih alat itu sampai Anda melepasnya, lalu alat sebelumnya dipilih lagi.
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 2496 and column 5.
|
@@ -607,6 +607,7 @@ font-technology Variable Variabili
|
||||
Consolidate All Windows Consolida tutte le finestre
|
||||
Constrain Angle Vincola angolo
|
||||
Constrain Width and Height Proportions Vincola proporzioni di larghezza e altezza
|
||||
Copy Width to Height Copia la larghezza nell’altezza
|
||||
Construction Guides Guide di costruzione
|
||||
Contextual Alternates Alternative contestuali
|
||||
Contextual Task Bar Barra attività contestuale
|
||||
@@ -2073,7 +2074,8 @@ file-filter Templates Modelli
|
||||
Lock Others Blocca altri
|
||||
Lock Slices Blocca sezioni
|
||||
Lock Station Point Blocca punto di osservazione
|
||||
Lossless (lossy WebP isn't available yet) Senza perdita (WebP con perdita non è ancora disponibile)
|
||||
Lossless Senza perdita
|
||||
Lossy Con perdita
|
||||
Lossy: Con perdita:
|
||||
Low Bassa
|
||||
lowercase minuscole
|
||||
@@ -3124,7 +3126,7 @@ digits Malayalam Malayalam
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. I raggi degli angoli dinamici si ridimensionano con la grafica, a meno che il ridimensionamento scelga diversamente.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Spessori delle tracce, trattini e distanze degli effetti si ridimensionano con la grafica, a meno che il ridimensionamento scelga diversamente.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. La rotellina del mouse esegue lo zoom dell'area di lavoro invece di scorrerla.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Finché Zoom con la rotellina del mouse è disattivato, la rotellina con Cmd/Ctrl premuto scorre l'area di lavoro in orizzontale.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. La rotellina del mouse con Cmd/Ctrl premuto scorre l'area di lavoro in orizzontale.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Trascinare in orizzontale sull'etichetta di un campo numerico ne cambia il valore.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Un gesto di rotazione con due dita sul trackpad ruota la vista dell'area di lavoro.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Tenere premuta la scorciatoia di uno strumento lo sceglie finché non la rilasci, poi viene scelto di nuovo lo strumento precedente.
|
||||
@@ -3418,6 +3420,7 @@ digits Malayalam Malayalam
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} di {n} risultato. Continua a digitare per restringerli.|{shown} di {n} risultati. Continua a digitare per restringerli.
|
||||
Recent Commands Comandi recenti
|
||||
No recent commands Nessun comando recente
|
||||
Search commands Cerca comandi
|
||||
Search Commands… Cerca comandi…
|
||||
Secondary Secondario
|
||||
Section Symbol Simbolo di sezione
|
||||
@@ -9379,6 +9382,7 @@ breakText Glyphs Glifi
|
||||
@msg Too many Revolve faces for visibility evaluation Troppe facce di Rivoluzione per il calcolo della visibilità
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft legge al massimo {ASE_MAX_ENTRIES} colori e gruppi da un file di scambio campioni, e questa libreria ne ha {entries}
|
||||
@msg WebP encoding failed: {e} Codifica WebP non riuscita: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Codifica WebP non riuscita: l'immagine è troppo grande per il WebP con perdita: riduci la risoluzione o scegli Senza perdita
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` è smallThumb, mediumThumb, largeThumb, smallList o largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1369,6 +1369,7 @@ antiAlias Sharp シャープ
|
||||
Conflict {n} of {count} 競合 {n} / {count}
|
||||
Constrain Angle 角度を制限
|
||||
Constrain Width and Height Proportions 幅と高さの縦横比を固定
|
||||
Copy Width to Height 幅を高さにコピー
|
||||
Construction Guides 作図ガイド
|
||||
Contextual Alternates 前後関係に依存する字形
|
||||
Convert 変換
|
||||
@@ -2330,7 +2331,8 @@ antiAlias Sharp シャープ
|
||||
Location 場所
|
||||
Location: 位置:
|
||||
Lock (⌘2) ロック (⌘2)
|
||||
Lossless (lossy WebP isn't available yet) ロスレス (非可逆 WebP は未対応)
|
||||
Lossless ロスレス
|
||||
Lossy 非可逆
|
||||
Lossy: 圧縮率:
|
||||
Luminosity 輝度
|
||||
Magic Wand Options 自動選択オプション
|
||||
@@ -3101,7 +3103,7 @@ mark-style Japanese 日本式
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. 拡大・縮小で別の指定をしない限り、ライブコーナーの半径をアートワークと一緒に拡大・縮小します。
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. 拡大・縮小で別の指定をしない限り、線幅、破線、効果の距離をアートワークと一緒に拡大・縮小します。
|
||||
The mouse wheel zooms the canvas instead of scrolling it. マウスホイールでカンバスをスクロールせずにズームします。
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. マウスホイールでズームがオフの間、Cmd/Ctrl キーを押しながらホイールを回すとカンバスを横にスクロールします。
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl キーを押しながらマウスホイールを回すとカンバスを横にスクロールします。
|
||||
Dragging sideways on a numeric field's label changes the field's value. 数値フィールドのラベルを横にドラッグすると、フィールドの値が変わります。
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. トラックパッドで 2 本指の回転ジェスチャーをすると、カンバスの表示が回転します。
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ツールのショートカットキーを押している間はそのツールを選び、離すと前のツールに戻ります。
|
||||
@@ -3296,6 +3298,7 @@ mark-style Japanese 日本式
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} 件中 {shown} 件。続けて入力すると絞り込めます。
|
||||
Recent Commands 最近使ったコマンド
|
||||
No recent commands 最近使ったコマンドはありません
|
||||
Search commands コマンドを検索
|
||||
Secondary セカンダリ
|
||||
Select All Art on Layer レイヤー上のすべてのアートを選択
|
||||
Select All Assets すべてのアセットを選択
|
||||
@@ -9456,6 +9459,7 @@ breakText Glyphs 字形
|
||||
@msg Too many Revolve faces for visibility evaluation 可視判定を行うには回転体の面が多すぎます
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft がスウォッチ交換ファイルから読み込めるカラーとグループは {ASE_MAX_ENTRIES} 個までですが、このライブラリには {entries} 個あります
|
||||
@msg WebP encoding failed: {e} WebP のエンコードに失敗しました: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP のエンコードに失敗しました: 画像が大きすぎて非可逆 WebP にできません: 解像度を下げるか、ロスレスを選択してください
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` には smallThumb、mediumThumb、largeThumb、smallList、largeList のいずれかを指定してください
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -161,6 +161,7 @@
|
||||
@msg Trap: more than {_1} pairs of objects lie close enough to trap, or too many objects share a horizontal range; trap fewer objects at a time ტრეპინგი: ობიექტების {_1}-ზე მეტი წყვილი ტრეპინგისთვის საკმარისად ახლოს მდებარეობს, ან ზედმეტად ბევრ ობიექტს საერთო ჰორიზონტალური დიაპაზონი აქვს; ერთდროულად ნაკლებ ობიექტზე გამოიყენეთ ტრეპინგი
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft ფერის ნიმუშების გაცვლის ფაილიდან კითხულობს მაქსიმუმ {ASE_MAX_ENTRIES} ფერსა და ჯგუფს, ამ ბიბლიოთეკაში კი არის {entries}
|
||||
@msg WebP encoding failed: {e} WebP-ის კოდირება ვერ მოხერხდა: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP-ის კოდირება ვერ მოხერხდა: სურათი ძალიან დიდია დანაკარგიანი WebP-ისთვის: შეამცირეთ გარჩევადობა ან აირჩიეთ უდანაკარგო
|
||||
@msg Weed Box and Lines: no weeding line fits outside the art, and the weed box is off ნარჩენის მოსაცილებელი ჩარჩო და ხაზები: ნახატის გარეთ ნარჩენის მოსაცილებელი არცერთი ხაზი არ ეტევა, ნარჩენის ჩარჩო კი გამორთულია
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg \\ at end of pattern \\ შაბლონის ბოლოს
|
||||
@@ -3388,6 +3389,7 @@ lighting Light სინათლე
|
||||
Search commands, tools, panels and effects ბრძანებების, ხელსაწყოების, პანელებისა და ეფექტების ძიება
|
||||
Style: სტილი:
|
||||
Switch workspace სამუშაო სივრცის გადართვა
|
||||
Search commands ბრძანებების ძიება
|
||||
Show all open documents ყველა ღია დოკუმენტის ჩვენება
|
||||
Use გამოიყენეთ
|
||||
the object to select | ობიექტზე — მოსანიშნად |
|
||||
@@ -4805,7 +4807,8 @@ digits Malayalam მალაიალამური
|
||||
Hide Video Rulers ვიდეოს სახაზავების დამალვა
|
||||
Client-side (.html) კლიენტის მხარე (.html)
|
||||
Color Reduction: ფერების შემცირება:
|
||||
Lossless (lossy WebP isn't available yet) უდანაკარგო (დანაკარგიანი WebP ჯერ მიუწვდომელია)
|
||||
Lossless უდანაკარგო
|
||||
Lossy დანაკარგიანი
|
||||
Scans: სკანირებები:
|
||||
Server-side (.map) სერვერის მხარე (.map)
|
||||
{format} Options {format}: პარამეტრები
|
||||
@@ -5757,6 +5760,7 @@ theme Appearance იერსახე
|
||||
Command Click to Select Objects Behind Command-დაწკაპუნებით უკან მდებარე ობიექტების მონიშვნა
|
||||
Constrain Angle კუთხის შეზღუდვა
|
||||
Constrain Width and Height Proportions სიგანისა და სიმაღლის პროპორციების შენარჩუნება
|
||||
Copy Width to Height სიგანის კოპირება სიმაღლეში
|
||||
Construction Guides სამშენებლო დამხმარე ხაზები
|
||||
Curvature Tool მრუდის ხელსაწყო
|
||||
Data Recovery მონაცემების აღდგენა
|
||||
@@ -6252,6 +6256,7 @@ font-technology Variable ცვლადი
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. კონტურის სისქე, შტრიხები და ეფექტების მანძილები ნახატთან ერთად მასშტაბირდება, თუ მასშტაბირება სხვას არ აირჩევს.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. მაუსის ბორბალი ტილოს გადახვევის ნაცვლად მასშტაბს ცვლის.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. სანამ მაუსის ბორბლით მასშტაბირება გამორთულია, დაჭერილი Cmd/Ctrl-ით მაუსის ბორბალი ტილოს გვერდულად გადაახვევს.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. დაჭერილი Cmd/Ctrl-ით მაუსის ბორბალი ტილოს გვერდულად გადაახვევს.
|
||||
Dragging sideways on a numeric field's label changes the field's value. რიცხვითი ველის წარწერაზე გვერდულად გადათრევა ველის მნიშვნელობას ცვლის.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. ტრეკპადზე ორი თითით მობრუნების ჟესტი ტილოს ხედს აბრუნებს.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. ხელსაწყოს მალსახმობი კლავიშის დაჭერით ხელსაწყო არჩეულია მის აშვებამდე, შემდეგ კი ისევ წინა ხელსაწყო აირჩევა.
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1359,6 +1359,7 @@ antiAlias Sharp 날카롭게
|
||||
Conflict {n} of {count} 충돌 {n}/{count}
|
||||
Constrain Angle 각도 제한
|
||||
Constrain Width and Height Proportions 너비와 높이 비율 고정
|
||||
Copy Width to Height 너비를 높이로 복사
|
||||
Construction Guides 작도 안내선
|
||||
Contextual Alternates 문맥 대체 글자
|
||||
Convert 변환
|
||||
@@ -2320,7 +2321,8 @@ antiAlias Sharp 날카롭게
|
||||
Location 위치
|
||||
Location: 위치:
|
||||
Lock (⌘2) 잠금 (⌘2)
|
||||
Lossless (lossy WebP isn't available yet) 무손실 (손실 WebP는 아직 지원되지 않음)
|
||||
Lossless 무손실
|
||||
Lossy 손실
|
||||
Lossy: 손실 압축:
|
||||
Luminosity 광도
|
||||
Magic Wand Options 마술봉 옵션
|
||||
@@ -3090,7 +3092,7 @@ mark-style Japanese 일본식
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. 크기 조정에서 달리 선택하지 않는 한, 라이브 모퉁이 반지름이 아트웍과 함께 크기 조정됩니다.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. 크기 조정에서 달리 선택하지 않는 한, 선 두께, 대시, 효과 거리가 아트웍과 함께 크기 조정됩니다.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. 마우스 휠로 캔버스를 스크롤하지 않고 확대/축소합니다.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 마우스 휠로 확대/축소가 꺼져 있는 동안 Cmd/Ctrl 키를 누른 채 마우스 휠을 돌리면 캔버스가 가로로 스크롤됩니다.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl 키를 누른 채 마우스 휠을 돌리면 캔버스가 가로로 스크롤됩니다.
|
||||
Dragging sideways on a numeric field's label changes the field's value. 숫자 필드의 레이블을 옆으로 드래그하면 필드 값이 바뀝니다.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. 트랙패드에서 두 손가락으로 회전하는 동작을 하면 캔버스 보기가 회전합니다.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 도구의 바로 가기 키를 누르고 있는 동안 그 도구가 선택되고, 키를 놓으면 이전 도구가 다시 선택됩니다.
|
||||
@@ -3285,6 +3287,7 @@ mark-style Japanese 일본식
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 결과 {n}개 중 {shown}개. 계속 입력하여 범위를 좁히세요.
|
||||
Recent Commands 최근 명령
|
||||
No recent commands 최근 명령 없음
|
||||
Search commands 명령 검색
|
||||
Secondary 보조
|
||||
Select All Art on Layer 레이어의 모든 아트웍 선택
|
||||
Select All Assets 모든 에셋 선택
|
||||
@@ -7542,6 +7545,7 @@ breakText Glyphs 글리프
|
||||
@msg Too many Revolve faces for visibility evaluation 회전체의 면이 너무 많아 가시성을 계산할 수 없습니다
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft는 견본 교환 파일에서 색상과 그룹을 최대 {ASE_MAX_ENTRIES}개까지 읽는데, 이 라이브러리에는 {entries}개가 있습니다
|
||||
@msg WebP encoding failed: {e} WebP 인코딩 실패: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP 인코딩 실패: 이미지가 너무 커서 손실 WebP로 만들 수 없습니다: 해상도를 낮추거나 무손실을 선택하세요
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `index` must be a whole number `index`은(는) 정수여야 합니다
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1799,6 +1799,7 @@ lighting Light Licht
|
||||
Search commands, tools, panels and effects Opdrachten, gereedschappen, panelen en effecten zoeken
|
||||
Style: Stijl:
|
||||
Switch workspace Werkruimte wisselen
|
||||
Search commands Opdrachten zoeken
|
||||
Show all open documents Alle geopende documenten tonen
|
||||
Use Gebruik
|
||||
the object to select | op het object om te selecteren |
|
||||
@@ -3251,7 +3252,8 @@ digits Malayalam Malayalam
|
||||
Hide Video Rulers Videolinialen verbergen
|
||||
Client-side (.html) Client-side (.html)
|
||||
Color Reduction: Kleurreductie:
|
||||
Lossless (lossy WebP isn't available yet) Verliesvrij (WebP met verlies is nog niet beschikbaar)
|
||||
Lossless Verliesvrij
|
||||
Lossy Met verlies
|
||||
Scans: Scans:
|
||||
Server-side (.map) Server-side (.map)
|
||||
{format} Options Opties voor {format}
|
||||
@@ -4281,6 +4283,7 @@ theme Appearance Vormgeving
|
||||
Command Click to Select Objects Behind Command-klik om objecten erachter te selecteren
|
||||
Constrain Angle Vastleghoek
|
||||
Constrain Width and Height Proportions Breedte- en hoogteverhouding vastleggen
|
||||
Copy Width to Height Breedte naar hoogte kopiëren
|
||||
Construction Guides Bouwhulplijnen
|
||||
Curvature Tool Krommingsgereedschap
|
||||
Data Recovery Gegevensherstel
|
||||
@@ -4801,7 +4804,7 @@ font-technology Variable Variabel
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Dynamische hoekradii schalen mee met de illustratie, tenzij het schalen anders kiest.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Contourdiktes, streepjes en effectafstanden schalen mee met de illustratie, tenzij het schalen anders kiest.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Het muiswiel zoomt het canvas in plaats van het te schuiven.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Zolang Zoomen met muiswiel uit staat, schuift het muiswiel met Cmd/Ctrl ingedrukt het canvas zijwaarts.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Het muiswiel met Cmd/Ctrl ingedrukt schuift het canvas zijwaarts.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Zijwaarts slepen over het label van een numeriek veld wijzigt de waarde van het veld.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Een draaigebaar met twee vingers op een trackpad draait de weergave van het canvas.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Als u de sneltoets van een gereedschap ingedrukt houdt, is dat gereedschap gekozen tot u loslaat, en daarna wordt het vorige gereedschap weer gekozen.
|
||||
@@ -9801,6 +9804,7 @@ breakText Glyphs Glyphs
|
||||
@msg Too many Revolve faces for visibility evaluation Te veel vlakken van Draaien om de zichtbaarheid te bepalen
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft leest maximaal {ASE_MAX_ENTRIES} kleuren en groepen uit een uitwisselingsbestand voor stalen, en deze bibliotheek heeft er {entries}
|
||||
@msg WebP encoding failed: {e} WebP-codering mislukt: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP-codering mislukt: de afbeelding is te groot voor WebP met verlies: verlaag de resolutie of kies Verliesvrij
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `index` must be a whole number `index` moet een geheel getal zijn
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -1258,6 +1258,7 @@ lighting Light Światło
|
||||
Search commands, tools, panels and effects Szukaj poleceń, narzędzi, paneli i efektów
|
||||
Style: Styl:
|
||||
Switch workspace Przełącz obszar roboczy
|
||||
Search commands Szukaj poleceń
|
||||
Show all open documents Pokaż wszystkie otwarte dokumenty
|
||||
Use Użyj
|
||||
the object to select | obiekt, aby go zaznaczyć |
|
||||
@@ -2822,7 +2823,8 @@ digits Malayalam Malajalam
|
||||
Hide Video Rulers Ukryj linijki wideo
|
||||
Client-side (.html) Po stronie klienta (.html)
|
||||
Color Reduction: Redukcja kolorów:
|
||||
Lossless (lossy WebP isn't available yet) Bezstratny (stratny WebP nie jest jeszcze dostępny)
|
||||
Lossless Bezstratny
|
||||
Lossy Stratny
|
||||
Scans: Skany:
|
||||
Server-side (.map) Po stronie serwera (.map)
|
||||
{format} Options Opcje: {format}
|
||||
@@ -3867,6 +3869,7 @@ theme Appearance Wygląd
|
||||
Command Click to Select Objects Behind Kliknięcie z Command zaznacza obiekty pod spodem
|
||||
Constrain Angle Kąt ograniczenia
|
||||
Constrain Width and Height Proportions Zachowaj proporcje szerokości i wysokości
|
||||
Copy Width to Height Kopiuj szerokość do wysokości
|
||||
Construction Guides Linie konstrukcyjne
|
||||
Curvature Tool Narzędzie Krzywizna
|
||||
Data Recovery Odzyskiwanie danych
|
||||
@@ -4374,7 +4377,7 @@ font-technology Variable Zmienne
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Promienie narożników dynamicznych skalują się razem z grafiką, chyba że skalowanie wybierze inaczej.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Grubości obrysów, kreski i odległości efektów skalują się razem z grafiką, chyba że skalowanie wybierze inaczej.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Kółko myszy powiększa obszar roboczy zamiast go przewijać.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Gdy Powiększaj kółkiem myszy jest wyłączone, kółko myszy z wciśniętym Cmd/Ctrl przewija obszar roboczy w poziomie.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Kółko myszy z wciśniętym Cmd/Ctrl przewija obszar roboczy w poziomie.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Przeciąganie w bok po etykiecie pola liczbowego zmienia wartość pola.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Gest obrotu dwoma palcami na gładziku obraca widok obszaru roboczego.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Przytrzymanie skrótu narzędzia wybiera je do momentu puszczenia klawisza, a potem ponownie wybierane jest poprzednie narzędzie.
|
||||
@@ -9622,6 +9625,7 @@ breakText Glyphs Glify
|
||||
@msg Too many Revolve faces for visibility evaluation Zbyt wiele ścian efektu Obrót do obliczenia widoczności
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft odczytuje z pliku wymiany próbek najwyżej {ASE_MAX_ENTRIES} kolorów i grup, a ta biblioteka ma ich {entries}
|
||||
@msg WebP encoding failed: {e} Kodowanie WebP nie powiodło się: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Kodowanie WebP nie powiodło się: obraz jest za duży dla stratnego WebP: zmniejsz rozdzielczość lub wybierz Bezstratny
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` ma wartość smallThumb, mediumThumb, largeThumb, smallList lub largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -552,6 +552,7 @@ antiAlias Sharp Nítido
|
||||
Consolidate All Windows Consolidar Todas as Janelas
|
||||
Constrain Angle Ângulo de Restrição
|
||||
Constrain Width and Height Proportions Restringir Proporções de Largura e Altura
|
||||
Copy Width to Height Copiar Largura para Altura
|
||||
Construction Guides Guias de Construção
|
||||
Contextual Alternates Variantes Contextuais
|
||||
Contextual Task Bar Barra de Tarefas Contextual
|
||||
@@ -1717,7 +1718,8 @@ antiAlias Sharp Nítido
|
||||
Artboard Guides with Cmd/Ctrl + Ruler Drag Guias de Prancheta com Cmd/Ctrl + Arrastar da Régua
|
||||
Lock Slices Bloquear Fatias
|
||||
Lock Station Point Bloquear Ponto de Estação
|
||||
Lossless (lossy WebP isn't available yet) Sem Perdas (WebP com perdas ainda não está disponível)
|
||||
Lossless Sem Perdas
|
||||
Lossy Com Perdas
|
||||
Lossy: Com Perdas:
|
||||
Luminosity Luminosidade
|
||||
Magic Wand Varinha Mágica
|
||||
@@ -2575,7 +2577,7 @@ digits Malayalam Malaiala
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Os raios de canto dinâmicos mudam de escala com a arte, a menos que a escala escolha outra coisa.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Espessuras de traçado, traços e distâncias de efeitos mudam de escala com a arte, a menos que a escala escolha outra coisa.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. A roda do mouse aplica zoom na tela em vez de rolá-la.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Enquanto Zoom com a Roda do Mouse está desativado, a roda do mouse com Cmd/Ctrl pressionado rola a tela para os lados.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. A roda do mouse com Cmd/Ctrl pressionado rola a tela para os lados.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Arrastar para os lados sobre o rótulo de um campo numérico muda o valor do campo.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Um gesto de rotação com dois dedos no trackpad gira a visualização da tela.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Manter pressionado o atalho de uma ferramenta a escolhe até você soltar, e então a ferramenta anterior é escolhida de novo.
|
||||
@@ -2834,6 +2836,7 @@ digits Malayalam Malaiala
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} de {n} resultado. Continue digitando para filtrá-los.|{shown} de {n} resultados. Continue digitando para filtrá-los.
|
||||
Recent Commands Comandos recentes
|
||||
No recent commands Nenhum comando recente
|
||||
Search commands Pesquisar comandos
|
||||
Secondary Secundária
|
||||
Section Symbol Símbolo de Seção
|
||||
Select Selecionar
|
||||
@@ -7443,6 +7446,7 @@ breakText Glyphs Glifos
|
||||
@msg Too many Revolve faces for visibility evaluation Faces de Revolver demais para avaliar a visibilidade
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} O VectorCraft lê no máximo {ASE_MAX_ENTRIES} cores e grupos de um arquivo de intercâmbio de amostras, e esta biblioteca tem {entries}
|
||||
@msg WebP encoding failed: {e} Falha na codificação WebP: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Falha na codificação WebP: a imagem é grande demais para WebP com perdas: reduza a resolução ou escolha Sem Perdas
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` é smallThumb, mediumThumb, largeThumb, smallList ou largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -605,6 +605,7 @@ font-technology Variable Вариативные
|
||||
Consolidate All Windows Объединить все окна
|
||||
Constrain Angle Ограничить угол
|
||||
Constrain Width and Height Proportions Сохранять пропорции ширины и высоты
|
||||
Copy Width to Height Копировать ширину в высоту
|
||||
Construction Guides Направляющие построения
|
||||
Contextual Alternates Контекстные альтернативы
|
||||
Contextual Task Bar Контекстная панель задач
|
||||
@@ -2064,7 +2065,8 @@ file-filter Templates Шаблоны
|
||||
Lock Others Заблокировать остальные
|
||||
Lock Slices Заблокировать фрагменты
|
||||
Lock Station Point Заблокировать точку стояния
|
||||
Lossless (lossy WebP isn't available yet) Без потерь (WebP с потерями пока недоступен)
|
||||
Lossless Без потерь
|
||||
Lossy С потерями
|
||||
Lossy: С потерями:
|
||||
Low Низкая
|
||||
lowercase строчные
|
||||
@@ -3113,7 +3115,7 @@ digits Malayalam Малаялам
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Радиусы динамических углов масштабируются вместе с графикой, если масштабирование не задаёт иное.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Толщина обводок, штрихи и расстояния эффектов масштабируются вместе с графикой, если масштабирование не задаёт иное.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Колесо мыши масштабирует холст, а не прокручивает его.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Пока «Масштабировать колесом мыши» выключено, колесо мыши с нажатой Cmd/Ctrl прокручивает холст по горизонтали.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колесо мыши с нажатой Cmd/Ctrl прокручивает холст по горизонтали.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Перетаскивание по подписи числового поля в сторону меняет значение поля.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Жест поворота двумя пальцами на трекпаде поворачивает вид холста.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Пока вы удерживаете клавишу инструмента, он остаётся выбранным, а после отпускания снова выбирается предыдущий инструмент.
|
||||
@@ -3407,6 +3409,7 @@ digits Malayalam Малаялам
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} из {n} результата. Продолжайте вводить, чтобы сузить их.|{shown} из {n} результатов. Продолжайте вводить, чтобы сузить их.|{shown} из {n} результатов. Продолжайте вводить, чтобы сузить их.
|
||||
Recent Commands Недавние команды
|
||||
No recent commands Нет недавних команд
|
||||
Search commands Поиск команд
|
||||
Search Commands… Поиск команд…
|
||||
Secondary Вторичный
|
||||
Section Symbol Символ параграфа
|
||||
@@ -9862,6 +9865,7 @@ shape Open Открытый
|
||||
@msg Too many Revolve faces for visibility evaluation Слишком много граней вращения для расчёта видимости
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft читает из файла обмена образцами не более {ASE_MAX_ENTRIES} цветов и групп, а в этой библиотеке их {entries}
|
||||
@msg WebP encoding failed: {e} Ошибка кодирования WebP: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Ошибка кодирования WebP: изображение слишком велико для WebP с потерями: уменьшите разрешение или выберите «Без потерь»
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` принимает значения smallThumb, mediumThumb, largeThumb, smallList или largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -594,6 +594,7 @@ font-technology Variable Variabla
|
||||
Consolidate All Windows Samla alla fönster
|
||||
Constrain Angle Begränsa vinkel
|
||||
Constrain Width and Height Proportions Behåll proportioner för bredd och höjd
|
||||
Copy Width to Height Kopiera bredd till höjd
|
||||
Construction Guides Konstruktionsstödlinjer
|
||||
Contextual Alternates Kontextuella alternativ
|
||||
Contextual Task Bar Kontextuellt aktivitetsfält
|
||||
@@ -1972,7 +1973,8 @@ font-technology Variable Variabla
|
||||
Lock Others Lås övriga
|
||||
Lock Slices Lås skivor
|
||||
Lock Station Point Lås betraktarpunkt
|
||||
Lossless (lossy WebP isn't available yet) Förlustfri (förlustbehäftad WebP är inte tillgänglig än)
|
||||
Lossless Förlustfri
|
||||
Lossy Förlustbehäftad
|
||||
Lossy: Förlust:
|
||||
Low Låg
|
||||
lowercase gemener
|
||||
@@ -3013,7 +3015,7 @@ digits Malayalam Malayalam
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Dynamiska hörnradier skalas med grafiken, om inte skalningen väljer annat.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Konturtjocklekar, streck och effektavstånd skalas med grafiken, om inte skalningen väljer annat.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Mushjulet zoomar arbetsytan i stället för att rulla den.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Medan Zooma med mushjulet är av rullar mushjulet med Cmd/Ctrl nedtryckt arbetsytan i sidled.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Mushjulet med Cmd/Ctrl nedtryckt rullar arbetsytan i sidled.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Att dra i sidled på ett sifferfälts etikett ändrar fältets värde.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. En rotationsgest med två fingrar på en styrplatta roterar arbetsytans vy.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. När du håller ned ett verktygs kortkommando är verktyget valt tills du släpper, och sedan väljs det föregående verktyget igen.
|
||||
@@ -3293,6 +3295,7 @@ digits Malayalam Malayalam
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} av {n} resultat. Fortsätt skriva för att begränsa dem.|{shown} av {n} resultat. Fortsätt skriva för att begränsa dem.
|
||||
Recent Commands Senaste kommandon
|
||||
No recent commands Inga senaste kommandon
|
||||
Search commands Sök kommandon
|
||||
Search Commands… Sök kommandon…
|
||||
Secondary Sekundär
|
||||
Section Symbol Paragraftecken
|
||||
@@ -9452,6 +9455,7 @@ digits Hindi Hindi
|
||||
@msg Too many Revolve faces for visibility evaluation För många ytor i Rotera runt axel för synlighetsberäkningen
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft läser högst {ASE_MAX_ENTRIES} färger och grupper från en fil för färgruteutbyte, och det här biblioteket har {entries}
|
||||
@msg WebP encoding failed: {e} WebP-kodningen misslyckades: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP-kodningen misslyckades: bilden är för stor för förlustbehäftad WebP: sänk upplösningen eller välj Förlustfri
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `index` must be a whole number `index` måste vara ett heltal
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` är smallThumb, mediumThumb, largeThumb, smallList eller largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -587,6 +587,7 @@ font-technology Variable Değişken
|
||||
Consolidate All Windows Tüm Pencereleri Birleştir
|
||||
Constrain Angle Açıyı Sınırla
|
||||
Constrain Width and Height Proportions Genişlik ve Yükseklik Oranlarını Sınırla
|
||||
Copy Width to Height Genişliği Yüksekliğe Kopyala
|
||||
Construction Guides İnşaat Kılavuzları
|
||||
Contextual Alternates Bağlamsal Alternatifler
|
||||
Contextual Task Bar Bağlamsal Görev Çubuğu
|
||||
@@ -1857,7 +1858,8 @@ font-technology Variable Değişken
|
||||
Lock Others Diğerlerini Kilitle
|
||||
Lock Slices Dilimleri Kilitle
|
||||
Lock Station Point Kilit İstasyon Noktası
|
||||
Lossless (lossy WebP isn't available yet) Kayıpsız (kayıplı WebP henüz mevcut değil)
|
||||
Lossless Kayıpsız
|
||||
Lossy Kayıplı
|
||||
Lossy: Kayıplı:
|
||||
Low Düşük
|
||||
lowercase küçük harf
|
||||
@@ -2850,7 +2852,7 @@ digits Malayalam Malayalam
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Canlı köşe yarıçapları, ölçekleme başka bir seçim yapmadıkça resimle birlikte ölçeklenir.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Kontur kalınlıkları, kesik çizgiler ve efekt mesafeleri, ölçekleme başka bir seçim yapmadıkça resimle birlikte ölçeklenir.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Fare tekerleği tuvali kaydırmak yerine yakınlaştırır.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Fare Tekerleği ile Yakınlaştırma kapalıyken, Cmd/Ctrl basılı tutulan fare tekerleği tuvali yana kaydırır.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Cmd/Ctrl basılıyken fare tekerleği tuvali yana kaydırır.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Sayısal bir alanın etiketi üzerinde yana sürüklemek alanın değerini değiştirir.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. İzleme dörtgeninde iki parmakla döndürme hareketi tuvalin görünümünü döndürür.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Bir aracın kısayol tuşunu basılı tutmak, tuşu bırakana kadar o aracı seçer, ardından önceki araç yeniden seçilir.
|
||||
@@ -3165,6 +3167,7 @@ digits Malayalam Malayalam
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {n} sonuçtan {shown} tanesi. Daraltmak için yazmaya devam edin.
|
||||
Recent Commands Son komutlar
|
||||
No recent commands Son komut yok
|
||||
Search commands Komutları arayın
|
||||
Search Commands… Arama Komutları…
|
||||
Secondary İkincil
|
||||
Section Symbol Bölüm Sembolü
|
||||
@@ -5361,6 +5364,7 @@ liquify-list-end {0}, {1} {0} ve {1}
|
||||
@msg Targa depth {_1}: 16, 24 or 32 bits per pixel Targa derinliği {_1}: piksel başına 16, 24 veya 32 bit olmalıdır
|
||||
@msg Targa encoding failed: the pixel buffer doesn't match the image size Targa kodlaması başarısız oldu: piksel arabelleği görüntü boyutuyla eşleşmiyor
|
||||
@msg WebP encoding failed: {e} WebP kodlaması başarısız oldu: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP kodlaması başarısız oldu: görüntü kayıplı WebP için çok büyük: çözünürlüğü düşürün veya Kayıpsız seçeneğini seçin
|
||||
@msg the pixel buffer doesn't match the image size piksel arabelleği görüntü boyutuyla eşleşmiyor
|
||||
@msg too many layers for PSD (at most 32767) PSD için çok fazla katman (en fazla 32767)
|
||||
@msg {_1} × {_2} pixels is too large for GIF (at most 65535 pixels a side): lower the resolution {_1} × {_2} piksel GIF için çok büyük (kenar başına en fazla 65535 piksel): çözünürlüğü düşürün
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -601,6 +601,7 @@ font-technology Variable Варіативні
|
||||
Consolidate All Windows Об’єднати всі вікна
|
||||
Constrain Angle Обмежити кут
|
||||
Constrain Width and Height Proportions Зберігати пропорції ширини та висоти
|
||||
Copy Width to Height Копіювати ширину у висоту
|
||||
Construction Guides Напрямні побудови
|
||||
Contextual Alternates Контекстні альтернативи
|
||||
Contextual Task Bar Контекстна панель завдань
|
||||
@@ -2067,7 +2068,8 @@ file-filter Templates Шаблони
|
||||
Lock Others Заблокувати решту
|
||||
Lock Slices Заблокувати фрагменти
|
||||
Lock Station Point Заблокувати точку стояння
|
||||
Lossless (lossy WebP isn't available yet) Без втрат (WebP із втратами поки недоступний)
|
||||
Lossless Без втрат
|
||||
Lossy Із втратами
|
||||
Lossy: Із втратами:
|
||||
Low Низька
|
||||
lowercase малі
|
||||
@@ -3116,7 +3118,7 @@ digits Malayalam Малаялам
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Радіуси динамічних кутів масштабуються разом із графікою, якщо масштабування не задає іншого.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Товщина обведень, штрихи та відстані ефектів масштабуються разом із графікою, якщо масштабування не задає іншого.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Колесо миші масштабує полотно, а не прокручує його.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Поки «Масштабувати колесом миші» вимкнено, колесо миші з натиснутою Cmd/Ctrl прокручує полотно по горизонталі.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Колесо миші з натиснутою Cmd/Ctrl прокручує полотно по горизонталі.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Перетягування вбік по підпису числового поля змінює значення поля.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Жест обертання двома пальцями на трекпаді обертає вигляд полотна.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Поки ви утримуєте клавішу інструмента, його вибрано, а після відпускання знову вибирається попередній інструмент.
|
||||
@@ -3410,6 +3412,7 @@ digits Malayalam Малаялам
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} з {n} результату. Продовжуйте вводити, щоб звузити їх.|{shown} з {n} результатів. Продовжуйте вводити, щоб звузити їх.|{shown} з {n} результатів. Продовжуйте вводити, щоб звузити їх.
|
||||
Recent Commands Нещодавні команди
|
||||
No recent commands Немає нещодавніх команд
|
||||
Search commands Пошук команд
|
||||
Search Commands… Пошук команд…
|
||||
Secondary Вторинний
|
||||
Section Symbol Символ параграфа
|
||||
@@ -7431,6 +7434,7 @@ breakText Glyphs Гліфи
|
||||
@msg Too many Revolve faces for visibility evaluation Забагато граней обертання для обчислення видимості
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft читає з файлу обміну зразками не більше {ASE_MAX_ENTRIES} кольорів і груп, а в цій бібліотеці їх {entries}
|
||||
@msg WebP encoding failed: {e} Не вдалося закодувати WebP: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Не вдалося закодувати WebP: зображення завелике для WebP із втратами: зменште роздільність або виберіть «Без втрат»
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` має бути smallThumb, mediumThumb, largeThumb, smallList або largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -705,6 +705,7 @@ font-technology Variable Biến thiên
|
||||
Constrain Giữ tỷ lệ
|
||||
Constrain Angle Ràng buộc góc
|
||||
Constrain Width and Height Proportions Ràng buộc tỷ lệ chiều rộng và chiều cao
|
||||
Copy Width to Height Sao chép chiều rộng sang chiều cao
|
||||
Construction Guides Đường căn xây dựng
|
||||
Contextual Alternates Ký tự thay thế theo ngữ cảnh
|
||||
Contextual Task Bar Thanh tác vụ theo ngữ cảnh
|
||||
@@ -2376,7 +2377,8 @@ digits Hindi Hindi
|
||||
Long Lines Nét dài
|
||||
Long Strokes Nét vẽ dài
|
||||
Longest: Dài nhất:
|
||||
Lossless (lossy WebP isn't available yet) Không mất dữ liệu (WebP mất dữ liệu chưa hỗ trợ)
|
||||
Lossless Không mất dữ liệu
|
||||
Lossy Mất dữ liệu
|
||||
Lossy: Mất dữ liệu:
|
||||
Low Thấp
|
||||
lowercase chữ thường
|
||||
@@ -3431,7 +3433,7 @@ mark-style Japanese Kiểu Nhật
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. Bán kính góc động co giãn cùng hình minh họa, trừ khi phép co giãn chọn khác.
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. Độ dày nét, gạch đứt và khoảng cách hiệu ứng co giãn cùng hình minh họa, trừ khi phép co giãn chọn khác.
|
||||
The mouse wheel zooms the canvas instead of scrolling it. Con lăn chuột thu phóng khung vẽ thay vì cuộn nó.
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Khi Thu phóng bằng con lăn chuột đang tắt, con lăn chuột kèm giữ Cmd/Ctrl cuộn khung vẽ sang ngang.
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. Con lăn chuột kèm giữ Cmd/Ctrl cuộn khung vẽ sang ngang.
|
||||
Dragging sideways on a numeric field's label changes the field's value. Kéo sang ngang trên nhãn của một trường số sẽ thay đổi giá trị của trường.
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. Cử chỉ xoay bằng hai ngón trên bàn di chuột sẽ xoay khung nhìn của khung vẽ.
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. Giữ phím tắt của một công cụ sẽ chọn công cụ đó cho đến khi bạn thả ra, rồi công cụ trước đó được chọn lại.
|
||||
@@ -3753,6 +3755,7 @@ mark-style Japanese Kiểu Nhật
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. {shown} trên {n} kết quả. Tiếp tục gõ để thu hẹp.
|
||||
Recent Commands Lệnh gần đây
|
||||
No recent commands Không có lệnh gần đây
|
||||
Search commands Tìm kiếm lệnh
|
||||
Search Commands… Tìm kiếm lệnh…
|
||||
Search Fonts Folder Tìm kiếm thư mục phông chữ
|
||||
Searching… Đang tìm kiếm…
|
||||
@@ -7640,6 +7643,7 @@ breakText Glyphs Glyph
|
||||
@msg Too many Revolve faces for visibility evaluation Quá nhiều mặt Xoay tròn để tính toán phần nhìn thấy
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft đọc tối đa {ASE_MAX_ENTRIES} màu và nhóm từ một tệp trao đổi mẫu màu, còn thư viện này có {entries}
|
||||
@msg WebP encoding failed: {e} Mã hóa WebP thất bại: {e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless Mã hóa WebP thất bại: ảnh quá lớn cho WebP có mất dữ liệu: hãy giảm độ phân giải hoặc chọn Không mất dữ liệu
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`: {why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `index` must be a whole number `index` phải là số nguyên
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 205 and column 5.
|
@@ -552,6 +552,7 @@ antiAlias Sharp 锐利
|
||||
Consolidate All Windows 合并所有窗口
|
||||
Constrain Angle 约束角度
|
||||
Constrain Width and Height Proportions 约束宽高比例
|
||||
Copy Width to Height 将宽度复制到高度
|
||||
Construction Guides 构造参考线
|
||||
Contextual Alternates 上下文替代
|
||||
Contextual Task Bar 上下文任务栏
|
||||
@@ -1943,7 +1944,8 @@ file-filter Templates 模板
|
||||
Artboard Guides with Cmd/Ctrl + Ruler Drag 按住 Cmd/Ctrl 从标尺拖动创建画板参考线
|
||||
Lock Slices 锁定切片
|
||||
Lock Station Point 锁定基准点
|
||||
Lossless (lossy WebP isn't available yet) 无失真 (尚未提供有失真的 WebP)
|
||||
Lossless 无失真
|
||||
Lossy 有失真
|
||||
Lossy: 有损:
|
||||
Low 低
|
||||
lowercase 小写
|
||||
@@ -2975,7 +2977,7 @@ digits Malayalam 马拉雅拉姆数字
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. 实时转角半径随图稿一起缩放,除非缩放命令另有选择。
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. 描边粗细、虚线和效果距离随图稿一起缩放,除非缩放命令另有选择。
|
||||
The mouse wheel zooms the canvas instead of scrolling it. 鼠标滚轮缩放画布,而不是滚动画布。
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 使用鼠标滚轮缩放关闭时,按住 Cmd/Ctrl 滚动鼠标滚轮会横向滚动画布。
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 按住 Cmd/Ctrl 滚动鼠标滚轮会横向滚动画布。
|
||||
Dragging sideways on a numeric field's label changes the field's value. 在数值字段的标签上横向拖动可更改字段的值。
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. 在触控板上用双指旋转手势可旋转画布视图。
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 按住工具的快捷键时选择该工具,松开后重新选择之前的工具。
|
||||
@@ -3237,6 +3239,7 @@ digits Malayalam 马拉雅拉姆数字
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 共 {n} 个结果,显示 {shown} 个。继续输入以缩小范围。
|
||||
Recent Commands 最近使用的命令
|
||||
No recent commands 没有最近使用的命令
|
||||
Search commands 搜索命令
|
||||
Search Commands… 搜索命令…
|
||||
Secondary 次要
|
||||
Section Symbol 章节符号
|
||||
@@ -9608,6 +9611,7 @@ breakText Glyphs 字形
|
||||
@msg Too many Revolve faces for visibility evaluation 回转的面过多,无法进行可见性计算
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft 最多从色板交换文件中读取 {ASE_MAX_ENTRIES} 个颜色和组,而此库有 {entries} 个
|
||||
@msg WebP encoding failed: {e} WebP 编码失败:{e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP 编码失败:图像太大,无法生成有失真 WebP:请降低分辨率或选择无失真
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`:{why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` 必须是 smallThumb、mediumThumb、largeThumb、smallList 或 largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -569,6 +569,7 @@ font-technology Variable 可變
|
||||
Consolidate All Windows 合併所有視窗
|
||||
Constrain Angle 強制角度
|
||||
Constrain Width and Height Proportions 強制寬度與高度比例
|
||||
Copy Width to Height 將寬度複製到高度
|
||||
Construction Guides 建構參考線
|
||||
Contextual Alternates 前後關聯替代字
|
||||
Contextual Task Bar 快捷工作列
|
||||
@@ -3184,7 +3185,8 @@ liquify-list-end {0}, {1} {0}和{1}
|
||||
Lock Others 鎖定其他
|
||||
Lock Slices 鎖定切片
|
||||
Lock Station Point 鎖定基準點
|
||||
Lossless (lossy WebP isn't available yet) 無失真 (尚未提供有失真的 WebP)
|
||||
Lossless 無失真
|
||||
Lossy 有失真
|
||||
Lossy: 失真度:
|
||||
Low 低
|
||||
lowercase 全部小寫
|
||||
@@ -4254,7 +4256,7 @@ digits Malayalam 馬來亞拉姆數字
|
||||
Live corner radii scale with the art, unless the scale chooses otherwise. 即時轉角半徑隨圖稿一起縮放,除非縮放指令另有選擇。
|
||||
Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise. 筆畫寬度、虛線和效果距離隨圖稿一起縮放,除非縮放指令另有選擇。
|
||||
The mouse wheel zooms the canvas instead of scrolling it. 滑鼠滾輪縮放畫布,而不是捲動畫布。
|
||||
While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 使用滑鼠滾輪縮放關閉時,按住 Cmd/Ctrl 捲動滑鼠滾輪會橫向捲動畫布。
|
||||
The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways. 按住 Cmd/Ctrl 捲動滑鼠滾輪會橫向捲動畫布。
|
||||
Dragging sideways on a numeric field's label changes the field's value. 在數值欄位的標籤上橫向拖曳可變更欄位的值。
|
||||
A two-finger rotate gesture on a trackpad rotates the canvas view. 在觸控式軌跡板上以雙指旋轉手勢可旋轉畫布檢視。
|
||||
Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again. 按住工具的快速鍵時選擇該工具,放開後重新選擇之前的工具。
|
||||
@@ -4546,6 +4548,7 @@ digits Malayalam 馬來亞拉姆數字
|
||||
@plural {shown} of {n} result. Keep typing to narrow them.|{shown} of {n} results. Keep typing to narrow them. 共 {n} 個結果,顯示 {shown} 個。繼續輸入以縮小範圍。
|
||||
Recent Commands 最近使用的指令
|
||||
No recent commands 沒有最近使用的指令
|
||||
Search commands 搜尋指令
|
||||
Search Commands… 搜尋指令…
|
||||
Secondary 次要
|
||||
Section Symbol 章節符號
|
||||
@@ -7597,6 +7600,7 @@ breakText Glyphs 字符
|
||||
@msg Too many Revolve faces for visibility evaluation 迴轉的面過多,無法計算可見性
|
||||
@msg VectorCraft reads at most {ASE_MAX_ENTRIES} colors and groups from a swatch exchange file, and this library has {entries} VectorCraft 從色票交換檔案最多讀取 {ASE_MAX_ENTRIES} 個顏色和群組,而此資料庫有 {entries} 個
|
||||
@msg WebP encoding failed: {e} WebP 編碼失敗:{e}
|
||||
@msg WebP encoding failed: the image is too large for lossy WebP: lower the resolution or choose Lossless WebP 編碼失敗:影像太大,無法產生有失真 WebP:請降低解析度或選擇無失真
|
||||
@msg [{j}] `{_1}`: {why} [{j}] `{_1}`:{why}
|
||||
@msg `answers[{i}]` {e} `answers[{i}]` {e}
|
||||
@msg `view` is smallThumb, mediumThumb, largeThumb, smallList or largeList `view` 必須是 smallThumb、mediumThumb、largeThumb、smallList 或 largeList
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -190,20 +190,23 @@ mod tests {
|
||||
assert_eq!(app.ui.status_notes, Some((app.ui.status.clone(), notes)));
|
||||
}
|
||||
|
||||
/// An export whose encoder notes an option it didn't apply (lossy WebP) before what the file
|
||||
/// loses (type in a font that isn't installed): the status bar names what the file loses, and
|
||||
/// the hover lists it first.
|
||||
/// An export whose encoder notes what an option left out (the fill hatches that
|
||||
/// `includeHatches: false` leaves out of a DXF drawing) and what the file loses (a see-through
|
||||
/// rectangle that DXF 2000 writes opaque): the status bar names what the file loses, and the
|
||||
/// hover lists the option's note last.
|
||||
#[test]
|
||||
fn an_export_names_what_the_file_loses_before_a_note_on_the_options() {
|
||||
let (mut app, _) = app();
|
||||
app.run("file.new", json!({"width": 100, "height": 100})).unwrap();
|
||||
app.run("text.create", json!({"x": 5, "y": 20, "text": "Ab", "font": "Nonexistent Sans Probe"})).unwrap();
|
||||
let r = export(&mut app, Some("webp"), Some("/out/d.webp".into()), &json!({"lossless": false})).unwrap();
|
||||
app.run("shape.rectangle", json!({"x": 10, "y": 10, "width": 30, "height": 20})).unwrap();
|
||||
app.run("object.setProps", json!({"opacity": 50})).unwrap();
|
||||
let r = export(&mut app, Some("dxf"), Some("/out/d.dxf".into()), &json!({"version": "2000", "includeHatches": false})).unwrap();
|
||||
let notes = notes_of(&r);
|
||||
assert_eq!(notes.len(), 2, "{r}");
|
||||
assert!(notes[0].contains("Nonexistent Sans Probe"), "{r}");
|
||||
assert!(notes[1].starts_with("lossy WebP"), "{r}");
|
||||
assert_eq!(app.ui.status, exported_with_notes("/out/d.webp", 2, ¬es[0]));
|
||||
let Some((option, losses)) = notes.split_last() else { panic!("no notes: {r}") };
|
||||
assert!(option.starts_with("fill hatches are left out"), "{r}");
|
||||
assert!(losses.iter().any(|n| n.starts_with("transparency needs DXF 2004")), "{r}");
|
||||
assert!(!losses.iter().any(|n| n.starts_with("fill hatches")), "{r}");
|
||||
assert_eq!(app.ui.status, exported_with_notes("/out/d.dxf", notes.len(), ¬es[0]));
|
||||
assert_eq!(app.ui.status_notes, Some((app.ui.status.clone(), notes)));
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,32 @@ fn file_ends_with_exit() {
|
||||
assert!(matches!(last, Item::Cmd("Exit", "app.quit", _)), "{last:?}");
|
||||
}
|
||||
|
||||
/// Help starts with Search Commands…, the command search's own command, showing its shortcut,
|
||||
/// then a separator; the menus list it once.
|
||||
#[test]
|
||||
fn help_starts_with_search_commands() {
|
||||
let app = VectorcraftApp::new(vectorcraft_engine::Session::new(), crate::Services::default());
|
||||
let tree = menu_tree();
|
||||
let (_, help) = tree.iter().find(|(t, _)| *t == "Help").unwrap();
|
||||
assert!(matches!(help[0], Item::Cmd("Search Commands…", "help.commandPalette", _)), "{:?}", help[0]);
|
||||
assert!(matches!(help[1], Item::Sep), "{:?}", help[1]);
|
||||
let Some(Entry::Item(row)) = entry(&app, &help[0]) else { panic!("Search Commands… is not shown") };
|
||||
assert!(row.enabled);
|
||||
assert_eq!(row.shortcut, shortcut_of("help.commandPalette"));
|
||||
assert!(row.shortcut.is_some(), "the search's shortcut shows next to the item");
|
||||
fn count(items: &[Item]) -> usize {
|
||||
items
|
||||
.iter()
|
||||
.map(|it| match it {
|
||||
Item::Cmd(_, "help.commandPalette", _) => 1,
|
||||
Item::Sub(_, children) => count(children),
|
||||
_ => 0,
|
||||
})
|
||||
.sum()
|
||||
}
|
||||
assert_eq!(tree.iter().map(|(_, items)| count(items)).sum::<usize>(), 1);
|
||||
}
|
||||
|
||||
/// No application menu in the window (as in Illustrator): the bar starts at File.
|
||||
#[test]
|
||||
fn the_bar_starts_at_file() {
|
||||
|
||||
@@ -738,12 +738,13 @@ pub fn menu_tree_named(english_names: bool) -> Vec<(&'static str, Vec<Item>)> {
|
||||
(
|
||||
"Help",
|
||||
vec![
|
||||
c("Search Commands…", "help.commandPalette"),
|
||||
Sep,
|
||||
c("Join Our Discord", "help.discord"),
|
||||
c("ArtCraft Website", "help.website"),
|
||||
c("VectorCraft on getartcraft.com", "help.appPage"),
|
||||
c("VectorCraft on GitHub", "help.github"),
|
||||
Sep,
|
||||
c("Search Commands…", "help.commandPalette"),
|
||||
todos("VectorCraft Help…", "F1"),
|
||||
c("Safe Mode…", "help.safeMode"),
|
||||
c("Copy Troubleshooting Info", "help.copyTroubleshootingInfo"),
|
||||
|
||||
@@ -1337,7 +1337,7 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[
|
||||
"ui.dialogReset",
|
||||
"Reset",
|
||||
"",
|
||||
"{} the open dialog's Reset, which its Cancel button reads while Alt (Option on macOS) is held (Flare Tool Options, dialog `flareOptions`): its fields go back to their defaults and the dialog stays open, so OK applies them → the dialog; an error when no dialog is open or the open one has no Reset",
|
||||
"{} the open dialog's Reset, which its Cancel button reads while Alt (Option on macOS) is held (Flare Tool Options, dialog `flareOptions`; Save PDF, dialog `savePdf`): its fields go back to their defaults (Save PDF: the chosen preset's settings, with the path and artboards kept) and the dialog stays open, so OK applies them → the dialog; an error when no dialog is open, the open one has no Reset, or Save PDF's chosen preset was deleted (the fields stay as they are)",
|
||||
),
|
||||
(
|
||||
"ui.justification",
|
||||
|
||||
@@ -2543,13 +2543,13 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// The click on the app bar's search button that opens the palette leaves it open; the next
|
||||
/// click on the button closes it.
|
||||
/// The click on the app bar's search field that opens the palette leaves it open; the next
|
||||
/// click on the field closes it.
|
||||
#[test]
|
||||
fn the_click_that_opens_the_palette_does_not_close_it() {
|
||||
let mut window = Window::new();
|
||||
let nodes = window.frame(vec![]);
|
||||
let at = button_at(&nodes, "Search commands, tools, panels and effects");
|
||||
let at = button_at(&nodes, "Search commands");
|
||||
window.click(at);
|
||||
assert!(window.app.ui.palette_open, "the click opens the palette");
|
||||
window.frame(vec![]);
|
||||
|
||||
@@ -870,7 +870,7 @@ pub(crate) fn show_sized(app: &mut VectorcraftApp, ui: &mut Ui, height: f32) {
|
||||
}
|
||||
if let (Some((t, phase)), Some(tint)) = (tinted, tgt.tint()) {
|
||||
if phase == Live::Released {
|
||||
super::color_guide::choose_base(app, tint.base.tinted(t));
|
||||
super::color_guide::choose_linked_base(app, tint.base.tinted(t), Some((tint.swatch.clone(), t)));
|
||||
}
|
||||
apply_tint(app, &tgt, tint, t, phase);
|
||||
}
|
||||
|
||||
@@ -10,34 +10,141 @@
|
||||
//! Swatches saves as one group (without a selection, the group holds the harmony colors). The
|
||||
//! selection lasts until the guide changes. A harmony color or a cell dragged with the primary button
|
||||
//! carries its color alone, as shown, without applying it or changing the selection; the Swatches
|
||||
//! panel makes a swatch of it. Limit to Library (the library button,
|
||||
//! panel makes a swatch of it. When the base is a spot color, or a tint of one, chosen from the
|
||||
//! Swatches panel, the Color panel's tint slider or the base chip ([`SpotBase`]), the cells right of
|
||||
//! the center in the base row of Tints/Shades are tints of that spot color: a click applies the tint,
|
||||
//! a drag carries it, and saving makes tint swatches linked to the spot color. Every other cell is
|
||||
//! a process color. Limit to Library (the library button,
|
||||
//! `ui.colorGuideLimit`) snaps every colour to a swatch library or the document's swatches; Edit or
|
||||
//! Apply Colors opens Recolor Artwork with the harmony colours, limited the same way.
|
||||
|
||||
use egui::{Rect, Sense, Ui, vec2};
|
||||
use serde_json::{Value, json};
|
||||
use vectorcraft_color::harmony::{Guide, GuideOptions, Harmony, Variation};
|
||||
use vectorcraft_color::harmony::{self, Guide, GuideOptions, Harmony, Variation};
|
||||
use vectorcraft_color::{Color, Paint};
|
||||
use vectorcraft_engine::cmd::swatchlib;
|
||||
|
||||
use super::swatches::{self, colour_libraries, limit_key, limit_name};
|
||||
use super::{active_paint, apply_click, c32, color_json, library_panel, pstate, set_pstate};
|
||||
use super::{active_paint, apply_click, c32, color_json, library_panel, paint_params, pstate, set_pstate};
|
||||
use crate::VectorcraftApp;
|
||||
use crate::widgets::{self, PanelDrag, menu_item};
|
||||
|
||||
/// The base colour before one is set: an orange.
|
||||
const DEFAULT_BASE: Color = Color::Rgb { r: 230.0 / 255.0, g: 120.0 / 255.0, b: 40.0 / 255.0 };
|
||||
|
||||
/// The guide's base color: the one last chosen or set with the base chip; before that, the current
|
||||
/// color.
|
||||
/// The spot color swatch the guide's base is a tint of (`UiState::color_guide_spot`).
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct SpotBase {
|
||||
/// The document the swatch belongs to (its `uid`).
|
||||
pub doc: u64,
|
||||
/// The spot color swatch's name.
|
||||
pub swatch: String,
|
||||
/// The base's tint of it, 0..1.
|
||||
pub tint: f32,
|
||||
}
|
||||
|
||||
/// The spot color the base is a tint of, while its swatch is still a spot color of the active
|
||||
/// document.
|
||||
fn live_spot(app: &VectorcraftApp) -> Option<&SpotBase> {
|
||||
let s = app.ui.color_guide_spot.as_ref()?;
|
||||
let st = app.session.active()?;
|
||||
let spot = st.doc.swatch(&s.swatch).is_some_and(|w| w.spot) && st.doc.global_color(&s.swatch).is_some();
|
||||
(st.uid == s.doc && spot).then_some(s)
|
||||
}
|
||||
|
||||
/// The color of tint `tint` (0..1) of global swatch `name` in the active document.
|
||||
fn tint_color(app: &VectorcraftApp, name: &str, tint: f32) -> Option<Color> {
|
||||
app.session.active()?.doc.tint_paint(name, tint)?.color()
|
||||
}
|
||||
|
||||
/// The guide's base color: the one last chosen or set with the base chip (a spot color base
|
||||
/// follows edits to its swatch); before that, the current color.
|
||||
pub(crate) fn base_color(app: &VectorcraftApp) -> Color {
|
||||
if let Some(c) = live_spot(app).and_then(|s| tint_color(app, &s.swatch, s.tint)) {
|
||||
return c;
|
||||
}
|
||||
app.ui.color_guide_base.unwrap_or_else(|| active_paint(app).color().unwrap_or(DEFAULT_BASE))
|
||||
}
|
||||
|
||||
/// Make `c` the guide's base color: a color chosen in the Color panel, the Swatches panel or the
|
||||
/// Color Picker. A color applied from the guide itself leaves the base as it is.
|
||||
pub(crate) fn choose_base(app: &mut VectorcraftApp, c: Color) {
|
||||
choose_linked_base(app, c, None);
|
||||
}
|
||||
|
||||
/// [`choose_base`] for a color linked to a global swatch at a tint (0..1): when that swatch is a
|
||||
/// spot color of the active document, the base is that tint of it ([`SpotBase`]).
|
||||
pub(crate) fn choose_linked_base(app: &mut VectorcraftApp, c: Color, link: Option<(String, f32)>) {
|
||||
app.ui.color_guide_base = Some(c);
|
||||
app.ui.color_guide_spot = link.and_then(|(swatch, tint)| {
|
||||
let st = app.session.active()?;
|
||||
st.doc.swatch(&swatch).filter(|w| w.spot)?;
|
||||
Some(SpotBase { doc: st.uid, swatch, tint: tint.clamp(0.0, 1.0) })
|
||||
});
|
||||
}
|
||||
|
||||
/// `swatch.edit` renamed swatch `from` of the active document to `to`: a spot color base linked to
|
||||
/// it links to `to`.
|
||||
pub(crate) fn swatch_renamed(app: &mut VectorcraftApp, from: &str, to: &str) {
|
||||
let uid = app.session.active().map(|st| st.uid);
|
||||
if let Some(s) = app.ui.color_guide_spot.as_mut()
|
||||
&& Some(s.doc) == uid
|
||||
&& s.swatch == from
|
||||
{
|
||||
s.swatch = to.to_string();
|
||||
}
|
||||
}
|
||||
|
||||
/// The global swatch and tint (0..1) a solid paint links to.
|
||||
fn paint_link(p: &Paint) -> Option<(String, f32)> {
|
||||
match p {
|
||||
Paint::Solid { swatch: Some(n), tint, .. } => Some((n.clone(), *tint)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// The tint of the spot color base that cell (`row`, `col`) of the guide `g` is: a cell right of
|
||||
/// the center in the base row of Tints/Shades, without a library limit. Its tint is the base's
|
||||
/// tint less the share the cell goes towards white. → (swatch, tint 0..1)
|
||||
fn cell_tint(app: &VectorcraftApp, g: &Guide, row: usize, col: usize) -> Option<(String, f32)> {
|
||||
let opts = app.ui.color_guide.clamped();
|
||||
let centre = g.centre();
|
||||
if row != 0 || col <= centre || opts.variation != Variation::TintsShades || !app.ui.color_guide_limit.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let s = live_spot(app)?;
|
||||
let step = i32::try_from(col - centre).ok()?;
|
||||
Some((s.swatch.clone(), s.tint * (1.0 - harmony::step_fraction(&opts, step))))
|
||||
}
|
||||
|
||||
/// The paint cell (`row`, `col`) of `g` applies, carries and saves: a tint of the spot color base
|
||||
/// ([`cell_tint`]) or the color the cell shows.
|
||||
fn cell_paint(app: &VectorcraftApp, g: &Guide, row: usize, col: usize) -> Option<Paint> {
|
||||
let color = *g.grid.get(row)?.get(col)?;
|
||||
Some(match cell_tint(app, g, row, col) {
|
||||
Some((name, tint)) => Paint::Solid { color, swatch: Some(name), tint },
|
||||
None => Paint::solid(color),
|
||||
})
|
||||
}
|
||||
|
||||
/// The `swatch.new` / `swatch.newGroup` entry for cell (`row`, `col`) of `g`: `{swatch, tint}` for
|
||||
/// a tint of the spot color base, the color otherwise.
|
||||
fn cell_entry(app: &VectorcraftApp, g: &Guide, row: usize, col: usize) -> Option<Value> {
|
||||
Some(match cell_paint(app, g, row, col)? {
|
||||
p @ Paint::Solid { swatch: Some(_), .. } => paint_params(&p),
|
||||
p => color_json(&p.color()?),
|
||||
})
|
||||
}
|
||||
|
||||
/// `g` with the base row's spot color tints ([`cell_tint`]) shown in their own colors.
|
||||
fn with_spot_tints(app: &VectorcraftApp, mut g: Guide) -> Guide {
|
||||
let cols = g.grid.first().map_or(0, Vec::len);
|
||||
let tints: Vec<(usize, Color)> =
|
||||
(0..cols).filter_map(|col| cell_tint(app, &g, 0, col).and_then(|(n, t)| tint_color(app, &n, t)).map(|c| (col, c))).collect();
|
||||
for (col, c) in tints {
|
||||
g.grid[0][col] = c;
|
||||
}
|
||||
g
|
||||
}
|
||||
|
||||
fn rule(ctx: &egui::Context) -> Harmony {
|
||||
@@ -59,6 +166,7 @@ fn clear_selection(ctx: &egui::Context) {
|
||||
#[derive(Clone, PartialEq)]
|
||||
struct SelKey {
|
||||
base: Color,
|
||||
spot: Option<SpotBase>,
|
||||
opts: GuideOptions,
|
||||
rule: usize,
|
||||
limit: String,
|
||||
@@ -68,6 +176,7 @@ struct SelKey {
|
||||
fn sel_key(app: &VectorcraftApp, ctx: &egui::Context, g: &Guide) -> SelKey {
|
||||
SelKey {
|
||||
base: base_color(app),
|
||||
spot: live_spot(app).cloned(),
|
||||
opts: app.ui.color_guide,
|
||||
rule: pstate(ctx, "cg-harmony"),
|
||||
limit: app.ui.color_guide_limit.clone(),
|
||||
@@ -93,12 +202,13 @@ struct GuideKey {
|
||||
doc: Option<(u64, u64)>,
|
||||
}
|
||||
|
||||
/// The guide the panel shows, limited to the Limit to Library colours.
|
||||
/// The guide the panel shows, limited to the Limit to Library colours; without a limit, a spot
|
||||
/// color base's tints show in their own colors.
|
||||
fn guide(app: &VectorcraftApp, ctx: &egui::Context) -> Guide {
|
||||
let (base, rule, opts) = (base_color(app), rule(ctx), app.ui.color_guide);
|
||||
let limit = &app.ui.color_guide_limit;
|
||||
if limit.is_empty() {
|
||||
return Guide::new(base, rule, &opts);
|
||||
return with_spot_tints(app, Guide::new(base, rule, &opts));
|
||||
}
|
||||
let doc = app.session.active().filter(|_| limit == swatchlib::DOCUMENT_SWATCHES).map(|d| (d.uid, d.revision));
|
||||
let key = GuideKey { base, rule, opts, limit: limit.clone(), doc };
|
||||
@@ -156,10 +266,11 @@ fn edit_or_apply(app: &mut VectorcraftApp, g: &Guide) {
|
||||
app.run("ui.recolorDialog", p).ok();
|
||||
}
|
||||
|
||||
/// Save the selected cells' colors as swatches (one undo step), each in its own model.
|
||||
/// Save the selected cells' colors as swatches (one undo step), each in its own model; a tint of a
|
||||
/// spot color base becomes a tint swatch of it.
|
||||
fn save_selected(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
let g = guide(app, ctx);
|
||||
let colors: Vec<Value> = live_selection(app, ctx, &g).into_iter().filter_map(|(r, c)| g.grid.get(r)?.get(c)).map(color_json).collect();
|
||||
let colors: Vec<Value> = live_selection(app, ctx, &g).into_iter().filter_map(|(r, c)| cell_entry(app, &g, r, c)).collect();
|
||||
if !colors.is_empty() {
|
||||
app.run("swatch.new", json!({ "colors": colors, "keepModel": true })).ok();
|
||||
}
|
||||
@@ -168,13 +279,13 @@ fn save_selected(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
/// Save Color Group to Swatches: the selected cells as one swatch group, in grid order (row by
|
||||
/// row, left to right), each cell once; with no cell of the shown guide selected, the harmony
|
||||
/// colors. The group is named after the harmony rule, saved in one undo step, and each color
|
||||
/// keeps its own model.
|
||||
/// keeps its own model; a tint of a spot color base becomes a tint swatch of it.
|
||||
fn save_group(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
let g = guide(app, ctx);
|
||||
let mut cells = live_selection(app, ctx, &g);
|
||||
cells.sort_unstable();
|
||||
cells.dedup();
|
||||
let mut colors: Vec<Value> = cells.into_iter().filter_map(|(r, c)| g.grid.get(r)?.get(c)).map(color_json).collect();
|
||||
let mut colors: Vec<Value> = cells.into_iter().filter_map(|(r, c)| cell_entry(app, &g, r, c)).collect();
|
||||
if colors.is_empty() {
|
||||
colors = g.colors.iter().map(color_json).collect();
|
||||
}
|
||||
@@ -186,27 +297,30 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
let ctx = ui.ctx().clone();
|
||||
// The current color becomes the base when the panel first shows; selecting artwork later
|
||||
// leaves it as it is.
|
||||
let first = base_color(app);
|
||||
let set = *app.ui.color_guide_base.get_or_insert(first);
|
||||
if app.ui.color_guide_base.is_none() {
|
||||
let current = active_paint(app);
|
||||
choose_linked_base(app, current.color().unwrap_or(DEFAULT_BASE), paint_link(¤t));
|
||||
}
|
||||
let h = rule(&ctx);
|
||||
let g = guide(app, &ctx);
|
||||
// Selected cells belong to the guide they were picked from: a new base, new options, another
|
||||
// harmony rule, another library limit or new grid colors clear them.
|
||||
let key = SelKey { base: set, ..sel_key(app, &ctx, &g) };
|
||||
let key = sel_key(app, &ctx, &g);
|
||||
if pstate::<Option<SelKey>>(&ctx, "cg-sel-key").as_ref() != Some(&key) {
|
||||
set_pstate(&ctx, "cg-sel-key", Some(key));
|
||||
clear_selection(&ctx);
|
||||
}
|
||||
let base = g.colors[0];
|
||||
let mut chosen: Option<Color> = None;
|
||||
let mut chosen: Option<Paint> = None;
|
||||
ui.horizontal(|ui| {
|
||||
let (r, resp) = ui.allocate_exact_size(vec2(26.0, 26.0), Sense::click());
|
||||
widgets::swatch_tile(ui, r, &Paint::solid(base), false, resp.hovered());
|
||||
if resp.on_hover_text(tl!("Set base color to the current color")).clicked()
|
||||
&& let Some(c) = active_paint(app).color()
|
||||
{
|
||||
app.ui.color_guide_base = Some(c);
|
||||
clear_selection(&ctx);
|
||||
if resp.on_hover_text(tl!("Set base color to the current color")).clicked() {
|
||||
let current = active_paint(app);
|
||||
if let Some(c) = current.color() {
|
||||
choose_linked_base(app, c, paint_link(¤t));
|
||||
clear_selection(&ctx);
|
||||
}
|
||||
}
|
||||
let labels: Vec<&str> = Harmony::ALL.iter().map(|h| h.label()).collect();
|
||||
if let Some(i) = widgets::dropdown(ui, "cg-rule", h.label(), &labels, ui.available_width() - 4.0) {
|
||||
@@ -223,7 +337,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
widgets::drag_source(ui, &resp, || PanelDrag::paint(Paint::solid(*c)));
|
||||
ui.painter().rect_filled(r, 0.0, c32(c));
|
||||
if resp.on_hover_text(c.to_hex()).clicked() {
|
||||
chosen = Some(*c);
|
||||
chosen = Some(Paint::solid(*c));
|
||||
}
|
||||
}
|
||||
ui.add_space(6.0);
|
||||
@@ -241,7 +355,8 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
for (ci, v) in row.iter().enumerate() {
|
||||
let r = Rect::from_min_size(rr.min + vec2(x(ci), 0.0), vec2(x(ci + 1) - x(ci) - gap, 17.0));
|
||||
let resp = ui.interact(r, ui.scope_id().with(("cg-v", ri, ci)), Sense::click_and_drag());
|
||||
widgets::drag_source(ui, &resp, || PanelDrag::paint(Paint::solid(*v)));
|
||||
let paint = cell_paint(app, &g, ri, ci).unwrap_or_else(|| Paint::solid(*v));
|
||||
widgets::drag_source(ui, &resp, || PanelDrag::paint(paint.clone()));
|
||||
ui.painter().rect_filled(r, 0.0, c32(v));
|
||||
if sel.contains(&(ri, ci)) {
|
||||
ui.painter().rect_stroke(r.shrink(1.0), 0.0, egui::Stroke::new(1.0, egui::Color32::WHITE), egui::StrokeKind::Inside);
|
||||
@@ -252,7 +367,7 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
if resp.on_hover_text(v.to_hex()).clicked() {
|
||||
if !multi {
|
||||
sel.clear();
|
||||
chosen = Some(*v);
|
||||
chosen = Some(paint);
|
||||
}
|
||||
match sel.iter().position(|s| *s == (ri, ci)) {
|
||||
Some(i) => {
|
||||
@@ -299,8 +414,8 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
|
||||
save_group(app, &ctx);
|
||||
}
|
||||
});
|
||||
if let Some(c) = chosen {
|
||||
apply_click(app, ui, json!({"color": color_json(&c)}));
|
||||
if let Some(p) = chosen {
|
||||
apply_click(app, ui, paint_params(&p));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,6 +818,184 @@ mod tests {
|
||||
assert!(selected(&ctx).is_empty(), "the panel clears the selection");
|
||||
}
|
||||
|
||||
/// A document with a selected rectangle and the spot color swatch "Ink", made the guide's base
|
||||
/// as clicking it in the Swatches panel makes it, at `tint` (0..1) of the spot color.
|
||||
fn spot_app(tint: f32) -> VectorcraftApp {
|
||||
let mut app = app();
|
||||
app.run("swatch.new", json!({"name": "Ink", "color": "#0066cc", "spot": true})).unwrap();
|
||||
app.run("shape.rectangle", json!({"x": 0, "y": 0, "width": 10, "height": 10})).unwrap();
|
||||
app.run("paint.setFill", json!({"color": "#808080"})).unwrap();
|
||||
let ink = app.session.active().unwrap().doc.global_color("Ink").unwrap();
|
||||
choose_linked_base(&mut app, ink.tinted(tint), Some(("Ink".to_string(), tint)));
|
||||
app
|
||||
}
|
||||
|
||||
/// The selected art's fill: (the swatch it links to, its tint 0..1, its color).
|
||||
fn fill_link(app: &VectorcraftApp) -> (Option<String>, f32, String) {
|
||||
match crate::panels::current_paints(app).0 {
|
||||
Paint::Solid { color, swatch, tint } => (swatch, tint, color.to_hex()),
|
||||
other => panic!("a solid fill: {other:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// The tint the cell `steps` right of the centre has with a base at `base` tint.
|
||||
fn expected_tint(app: &VectorcraftApp, base: f32, steps: i32) -> f32 {
|
||||
base * (1.0 - harmony::step_fraction(&app.ui.color_guide.clamped(), steps))
|
||||
}
|
||||
|
||||
/// With a spot color base, a cell right of the centre in the base row of Tints/Shades paints the
|
||||
/// art with a tint of the spot color, which follows an edit of the spot color; the shades, the
|
||||
/// other rows, the other variation modes and a library limit give process colors.
|
||||
#[test]
|
||||
fn a_spot_color_base_gives_tints_of_that_spot_color() {
|
||||
let mut app = spot_app(1.0);
|
||||
let ctx = egui::Context::default();
|
||||
frame(&mut app, &ctx);
|
||||
let g = guide(&app, &ctx);
|
||||
let c = g.centre();
|
||||
let ink = app.session.active().unwrap().doc.global_color("Ink").unwrap();
|
||||
assert_eq!(g.grid[0][c].to_hex(), ink.to_hex(), "the spot color in the centre");
|
||||
let at = rect_of(&mut app, &ctx, ("cg-v", 0usize, c + 2)).center();
|
||||
click(&mut app, &ctx, at);
|
||||
let (swatch, tint, hex) = fill_link(&app);
|
||||
assert_eq!(swatch.as_deref(), Some("Ink"), "a tint of the spot color");
|
||||
let want = expected_tint(&app, 1.0, 2);
|
||||
assert!((tint - want).abs() < 1e-4, "{tint} vs {want}");
|
||||
assert_eq!(hex, g.grid[0][c + 2].to_hex(), "the color the cell shows");
|
||||
assert_eq!(hex, ink.tinted(tint).to_hex());
|
||||
// The painted tint follows an edit of the spot color, and so does the base.
|
||||
app.run("swatch.edit", json!({"name": "Ink", "color": "#cc0000"})).unwrap();
|
||||
let red = app.session.active().unwrap().doc.global_color("Ink").unwrap();
|
||||
assert_eq!(fill_link(&app).2, red.tinted(tint).to_hex(), "the art follows the spot color");
|
||||
assert_eq!(base_color(&app), red, "the base follows the spot color");
|
||||
frame(&mut app, &ctx);
|
||||
// Shades, another harmony row and the harmony strip are process colors.
|
||||
for id in [("cg-v", 0usize, c - 1), ("cg-v", 1, c + 1)] {
|
||||
let at = rect_of(&mut app, &ctx, id).center();
|
||||
click(&mut app, &ctx, at);
|
||||
assert_eq!(fill_link(&app).0, None, "{id:?}");
|
||||
}
|
||||
let at = rect_of(&mut app, &ctx, ("cg-h", 0usize)).center();
|
||||
click(&mut app, &ctx, at);
|
||||
assert_eq!(fill_link(&app).0, None, "the harmony strip");
|
||||
// Warm/Cool and a library limit: process colors.
|
||||
app.ui.color_guide.variation = Variation::WarmCool;
|
||||
frame(&mut app, &ctx);
|
||||
let at = rect_of(&mut app, &ctx, ("cg-v", 0usize, c + 1)).center();
|
||||
click(&mut app, &ctx, at);
|
||||
assert_eq!(fill_link(&app).0, None, "Warm/Cool");
|
||||
app.ui.color_guide.variation = Variation::TintsShades;
|
||||
app.run("ui.colorGuideLimit", json!({"library": "web-safe-216"})).unwrap();
|
||||
frame(&mut app, &ctx);
|
||||
let at = rect_of(&mut app, &ctx, ("cg-v", 0usize, c + 1)).center();
|
||||
click(&mut app, &ctx, at);
|
||||
assert_eq!(fill_link(&app).0, None, "limited to a library");
|
||||
}
|
||||
|
||||
/// A base that is already a tint of the spot color gives lighter tints of it; a plain color with
|
||||
/// the spot color's values, a deleted swatch and a swatch that is no longer a spot color give
|
||||
/// process colors.
|
||||
#[test]
|
||||
fn a_tinted_spot_base_gives_lighter_tints_and_a_lost_link_gives_process_colors() {
|
||||
let mut app = spot_app(0.5);
|
||||
let ctx = egui::Context::default();
|
||||
frame(&mut app, &ctx);
|
||||
let c = guide(&app, &ctx).centre();
|
||||
let cell = |app: &VectorcraftApp, ctx: &egui::Context, col| cell_paint(app, &guide(app, ctx), 0, col).unwrap();
|
||||
let Paint::Solid { swatch, tint, .. } = cell(&app, &ctx, c + 1) else { panic!("a solid") };
|
||||
assert_eq!(swatch.as_deref(), Some("Ink"));
|
||||
let want = expected_tint(&app, 0.5, 1);
|
||||
assert!((tint - want).abs() < 1e-4 && tint < 0.5, "{tint} vs {want}");
|
||||
// The same values without the link.
|
||||
choose_base(&mut app, Color::from_hex("#0066cc").unwrap());
|
||||
assert_eq!(cell(&app, &ctx, c + 1), Paint::solid(guide(&app, &ctx).grid[0][c + 1]));
|
||||
// The spot color made a process color, then deleted.
|
||||
let link = Some(("Ink".to_string(), 1.0));
|
||||
let ink = app.session.active().unwrap().doc.global_color("Ink").unwrap();
|
||||
choose_linked_base(&mut app, ink, link.clone());
|
||||
assert!(matches!(cell(&app, &ctx, c + 1), Paint::Solid { swatch: Some(_), .. }));
|
||||
app.run("swatch.edit", json!({"name": "Ink", "spot": false, "global": false})).unwrap();
|
||||
assert!(matches!(cell(&app, &ctx, c + 1), Paint::Solid { swatch: None, .. }), "no longer a spot color");
|
||||
choose_linked_base(&mut app, ink, link.clone());
|
||||
assert!(app.ui.color_guide_spot.is_none(), "a process swatch gives no spot base");
|
||||
app.run("swatch.edit", json!({"name": "Ink", "spot": true})).unwrap();
|
||||
choose_linked_base(&mut app, ink, link);
|
||||
app.run("swatch.delete", json!({"name": "Ink"})).unwrap();
|
||||
assert!(matches!(cell(&app, &ctx, c + 1), Paint::Solid { swatch: None, .. }), "a deleted swatch");
|
||||
}
|
||||
|
||||
/// A spot color base stays linked to its swatch when Swatch Options renames it: the tints link to
|
||||
/// the new name and follow an edit of it.
|
||||
#[test]
|
||||
fn a_renamed_spot_color_stays_the_base() {
|
||||
let mut app = spot_app(1.0);
|
||||
let ctx = egui::Context::default();
|
||||
frame(&mut app, &ctx);
|
||||
let c = guide(&app, &ctx).centre();
|
||||
app.run("swatch.edit", json!({"name": "Ink", "newName": "Deep Ink"})).unwrap();
|
||||
let Paint::Solid { swatch, .. } = cell_paint(&app, &guide(&app, &ctx), 0, c + 1).unwrap() else { panic!("a solid") };
|
||||
assert_eq!(swatch.as_deref(), Some("Deep Ink"));
|
||||
app.run("swatch.edit", json!({"name": "Deep Ink", "color": "#cc0000"})).unwrap();
|
||||
let red = app.session.active().unwrap().doc.global_color("Deep Ink").unwrap();
|
||||
assert_eq!(base_color(&app), red, "the base follows the renamed spot color");
|
||||
}
|
||||
|
||||
/// Save Colors as Swatches and Save Color Group save a spot color base's tints as tint swatches
|
||||
/// linked to it, beside process colors for the other cells, each in one undo step.
|
||||
#[test]
|
||||
fn saved_spot_tints_are_tint_swatches_of_the_spot_color() {
|
||||
let mut app = spot_app(1.0);
|
||||
let ctx = egui::Context::default();
|
||||
frame(&mut app, &ctx);
|
||||
let g = guide(&app, &ctx);
|
||||
let c = g.centre();
|
||||
let undo = app.session.doc().unwrap().history.undo.len();
|
||||
set_pstate(&ctx, "cg-sel", vec![(0usize, c + 1), (0, c - 1), (0, c + 3)]);
|
||||
save_selected(&mut app, &ctx);
|
||||
let st = app.session.doc().unwrap();
|
||||
assert_eq!(st.history.undo.len(), undo + 1, "one undo step");
|
||||
let made: Vec<_> = st.doc.swatches[st.doc.swatches.len() - 3..].to_vec();
|
||||
let tint = |w: &vectorcraft_color::Swatch| w.tint_of().map(|(b, t)| (b.to_string(), t));
|
||||
assert_eq!(tint(&made[0]).map(|(b, _)| b).as_deref(), Some("Ink"));
|
||||
assert!((tint(&made[0]).unwrap().1 - expected_tint(&app, 1.0, 1)).abs() < 1e-4);
|
||||
assert_eq!(made[1].paint, Paint::solid(g.grid[0][c - 1]), "a shade is a process color");
|
||||
assert_eq!(tint(&made[2]).map(|(b, _)| b).as_deref(), Some("Ink"));
|
||||
assert!(made[0].name.starts_with("Ink ") && made[0].name.ends_with('%'), "{}", made[0].name);
|
||||
// A group of the selected cells, in grid order.
|
||||
set_pstate(&ctx, "cg-sel", vec![(1usize, c + 1), (0, c + 2)]);
|
||||
save_group(&mut app, &ctx);
|
||||
let group = app.session.doc().unwrap().doc.swatch_groups.last().cloned().unwrap();
|
||||
assert_eq!(group.swatches.len(), 2);
|
||||
assert_eq!(tint(&group.swatches[0]).map(|(b, _)| b).as_deref(), Some("Ink"), "the base row's tint");
|
||||
assert_eq!(group.swatches[1].paint, Paint::solid(g.grid[1][c + 1]), "another row is a process color");
|
||||
// The saved tints follow an edit of the spot color.
|
||||
app.run("swatch.edit", json!({"name": "Ink", "color": "#cc0000"})).unwrap();
|
||||
let d = &app.session.active().unwrap().doc;
|
||||
let red = d.global_color("Ink").unwrap();
|
||||
let first = d.swatch(&made[0].name).unwrap();
|
||||
assert_eq!(first.paint.color(), Some(red.tinted(first.tint_of().unwrap().1)));
|
||||
}
|
||||
|
||||
/// A spot color base's tint dragged from the guide carries the tint, and the Swatches panel makes
|
||||
/// a tint swatch of it.
|
||||
#[test]
|
||||
fn a_dragged_spot_tint_becomes_a_tint_swatch() {
|
||||
let mut app = spot_app(1.0);
|
||||
let ctx = egui::Context::default();
|
||||
crate::theme::install_fonts(&ctx);
|
||||
guide_frame(&mut app, &ctx, vec![], 0.0, true, ("cg-h", 0usize));
|
||||
let g = guide(&app, &ctx);
|
||||
let c = g.centre();
|
||||
let tile = |ctx: &egui::Context| ctx.read_response(egui::Id::unique(("swatch-tile", "Red"))).expect("the Red swatch is drawn").rect.center();
|
||||
let held = drag_from(&mut app, &ctx, ("cg-v", 0, c + 1), Some(tile(&ctx)), 1.0, true);
|
||||
let Some(PanelDrag::Paint { paint: Paint::Solid { swatch, tint, .. }, .. }) = held else { panic!("a solid paint: {held:?}") };
|
||||
assert_eq!(swatch.as_deref(), Some("Ink"));
|
||||
let newest = app.session.doc().unwrap().doc.swatches.last().cloned().expect("a swatch");
|
||||
let (base, made) = newest.tint_of().unwrap_or_else(|| panic!("a tint swatch: {newest:?} {}", app.ui.status));
|
||||
assert_eq!(base, "Ink");
|
||||
assert!((made - tint).abs() < 1e-4, "{made} vs {tint}");
|
||||
}
|
||||
|
||||
/// Every colour of the panel's guide.
|
||||
fn shown(app: &VectorcraftApp, ctx: &egui::Context) -> Vec<String> {
|
||||
let g = guide(app, ctx);
|
||||
|
||||
@@ -104,10 +104,10 @@ fn explore_tutorials_on_the_app_bar_shows_and_hides_the_learn_panel() {
|
||||
let ctx = context();
|
||||
assert!(!shown(&app));
|
||||
let nodes = frame(&mut app, &ctx, vec![], app_bar);
|
||||
let search = center_where(&nodes, |label| label.starts_with("Search commands, tools, panels and effects"));
|
||||
let search = center_where(&nodes, |label| label.starts_with("Search commands"));
|
||||
let learn = center(&nodes, "Explore tutorials");
|
||||
let (search, learn) = (search.expect("the search icon shows"), learn.expect("the app bar has Explore tutorials"));
|
||||
assert!(learn.x < search.x && (learn.y - search.y).abs() < 1.0, "beside the search icon: {learn:?}, {search:?}");
|
||||
let (search, learn) = (search.expect("the search field shows"), learn.expect("the app bar has Explore tutorials"));
|
||||
assert!(learn.x < search.x && (learn.y - search.y).abs() < 1.0, "beside the search field: {learn:?}, {search:?}");
|
||||
click(&mut app, &ctx, "Explore tutorials", app_bar);
|
||||
assert!(shown(&app), "{}", app.ui.status);
|
||||
click(&mut app, &ctx, "Explore tutorials", app_bar);
|
||||
|
||||
@@ -190,13 +190,14 @@ fn swatch_params(e: &Entry) -> Option<Value> {
|
||||
/// Apply a clicked swatch to the active proxy (Alt: the inactive one). An Alt-click on a color
|
||||
/// swatch with a gradient stop selected recolors the stop as dropping the swatch on it does,
|
||||
/// and with a freeform gradient point selected it recolors the point. A color swatch also becomes
|
||||
/// the Color Guide's base color.
|
||||
/// the Color Guide's base color, linked to the spot color it is or is a tint of.
|
||||
fn apply(app: &mut VectorcraftApp, ui: &Ui, e: &Entry) {
|
||||
let Some(params) = swatch_params(e) else { return };
|
||||
if let Entry::Swatch { paint, .. } = e
|
||||
if let Entry::Swatch { name, paint, .. } = e
|
||||
&& let Some(c) = paint.color()
|
||||
{
|
||||
super::color_guide::choose_base(app, c);
|
||||
let link = app.session.active().and_then(|st| st.doc.swatch_link(name));
|
||||
super::color_guide::choose_linked_base(app, c, link);
|
||||
}
|
||||
if super::alt_held(ui)
|
||||
&& let Some(c) = drag_of(e, vec![]).color()
|
||||
|
||||
@@ -178,6 +178,23 @@ fn a_clicked_color_swatch_becomes_the_color_guides_base() {
|
||||
assert_eq!(base(&app), "#2050a0");
|
||||
}
|
||||
|
||||
/// A clicked spot color swatch, or a tint swatch of one, becomes the Color Guide's base linked to
|
||||
/// that spot color at the swatch's tint; a process color swatch clears the link.
|
||||
#[test]
|
||||
fn a_clicked_spot_color_swatch_becomes_a_linked_color_guide_base() {
|
||||
let mut app = app();
|
||||
let ctx = context();
|
||||
app.run("swatch.new", json!({"name": "Ink", "color": "#0066cc", "spot": true})).unwrap();
|
||||
app.run("swatch.new", json!({"swatch": "Ink", "tint": 40})).unwrap();
|
||||
let spot = |app: &VectorcraftApp| app.ui.color_guide_spot.as_ref().map(|s| (s.swatch.clone(), (s.tint * 100.0).round()));
|
||||
click_tile(&mut app, &ctx, "Ink", Modifiers::NONE, 0.0);
|
||||
assert_eq!(spot(&app), Some(("Ink".to_string(), 100.0)));
|
||||
click_tile(&mut app, &ctx, "Ink 40%", Modifiers::NONE, 2.0);
|
||||
assert_eq!(spot(&app), Some(("Ink".to_string(), 40.0)), "a tint swatch: its tint of the spot color");
|
||||
click_tile(&mut app, &ctx, "Red", Modifiers::NONE, 4.0);
|
||||
assert_eq!(spot(&app), None, "a process color");
|
||||
}
|
||||
|
||||
/// The hex colors of the stops of the selection's gradient fill, and its stroke's color.
|
||||
fn stops_and_stroke(app: &VectorcraftApp) -> (Vec<String>, String) {
|
||||
let (fill, stroke) = crate::panels::current_paints(app);
|
||||
|
||||
@@ -36,7 +36,7 @@ pub(crate) const DESCRIPTIONS: &[(&str, &str)] = &[
|
||||
("scaleCorners", "Live corner radii scale with the art, unless the scale chooses otherwise."),
|
||||
("scaleStrokes", "Stroke weights, dashes and effect distances scale with the art, unless the scale chooses otherwise."),
|
||||
("zoomWithMouseWheel", "The mouse wheel zooms the canvas instead of scrolling it."),
|
||||
("ctrlWheelScrollsSideways", "While Zoom with Mouse Wheel is off, the mouse wheel with Cmd/Ctrl held scrolls the canvas sideways."),
|
||||
("ctrlWheelScrollsSideways", "The mouse wheel with Cmd/Ctrl held scrolls the canvas sideways."),
|
||||
("scrubNumericFields", "Dragging sideways on a numeric field's label changes the field's value."),
|
||||
("trackpadRotateView", "A two-finger rotate gesture on a trackpad rotates the canvas view."),
|
||||
("holdToolKeys", "Holding a tool's shortcut key chooses the tool until you let go, and then the previous tool is chosen again."),
|
||||
|
||||
@@ -1820,6 +1820,17 @@ fn every_general_selection_guides_and_smart_guides_setting_has_one_description()
|
||||
assert!(bad.is_empty(), "{}", bad.join("\n"));
|
||||
}
|
||||
|
||||
/// Cmd/Ctrl-wheel scrolls sideways with Zoom with Mouse Wheel on as well as off
|
||||
/// (`canvas::tests::zoom_with_mouse_wheel_preference`), so the sentence for Scroll Sideways with
|
||||
/// Cmd/Ctrl + Wheel does not make the sideways scroll depend on that setting.
|
||||
#[test]
|
||||
fn the_sideways_scroll_sentence_does_not_depend_on_zoom_with_mouse_wheel() {
|
||||
let zoom = settings().find(|s| s.key == "zoomWithMouseWheel").expect("General has Zoom with Mouse Wheel").label;
|
||||
let sideways = descriptions::description("ctrlWheelScrollsSideways").expect("Scroll Sideways with Cmd/Ctrl + Wheel has a sentence");
|
||||
assert!(!sideways.contains(zoom.trim_end_matches(':')), "`{sideways}` names `{zoom}`");
|
||||
assert!(sideways.contains("Cmd/Ctrl") && sideways.contains("sideways"), "`{sideways}` describes the sideways scroll");
|
||||
}
|
||||
|
||||
/// The pointer over General's Contextual Task Bar row and over its Keyboard Increment row shows
|
||||
/// each row's sentence.
|
||||
#[test]
|
||||
|
||||
@@ -721,6 +721,10 @@ pub struct UiState {
|
||||
/// saved.
|
||||
#[serde(skip)]
|
||||
pub color_guide_base: Option<vectorcraft_color::Color>,
|
||||
/// Color Guide panel: the spot color swatch the base is a tint of, when it was chosen from one
|
||||
/// ([`crate::panels::color_guide::SpotBase`]). Not saved.
|
||||
#[serde(skip)]
|
||||
pub color_guide_spot: Option<crate::panels::color_guide::SpotBase>,
|
||||
/// Align panel: the Align To choice, Selection or Artboard, which Object → Align and the align
|
||||
/// buttons follow ([`crate::panels::align::with_align_to`]).
|
||||
#[serde(default, deserialize_with = "crate::panels::align::deserialize_align_to")]
|
||||
@@ -1239,6 +1243,7 @@ impl Default for UiState {
|
||||
flattener_preview: Default::default(),
|
||||
color_guide_limit: String::new(),
|
||||
color_guide_base: None,
|
||||
color_guide_spot: None,
|
||||
align_to: Default::default(),
|
||||
align_spacing: 0.0,
|
||||
color_mode: None,
|
||||
|
||||
@@ -210,6 +210,19 @@ fn the_window_menu_has_the_system_items() {
|
||||
assert_eq!(Standard::Zoom.label(), "Zoom");
|
||||
}
|
||||
|
||||
/// The Mac Help menu keeps Search Commands… first among VectorCraft's items, with its shortcut,
|
||||
/// then a separator.
|
||||
#[test]
|
||||
fn the_mac_help_menu_starts_with_search_commands() {
|
||||
let bar = bar(&app(true));
|
||||
let help = &bar.menu(MenuRole::Help).unwrap().children;
|
||||
assert_eq!(ids(help)[..2], ["help.commandPalette".to_string(), "---".into()]);
|
||||
let search = find(&bar, "help.commandPalette");
|
||||
assert_eq!(search.label, "Search Commands…");
|
||||
assert_eq!(search.shortcut, menus::shortcut_of("help.commandPalette"));
|
||||
assert!(search.shortcut.is_some());
|
||||
}
|
||||
|
||||
/// A system key a command already has stays the command's: the system item goes without. The
|
||||
/// user's shortcuts show in the menus.
|
||||
#[test]
|
||||
|
||||
@@ -322,11 +322,15 @@ mod tests {
|
||||
assert!(!a.shrink(0.5).intersects(b.shrink(0.5)), "{a:?} overlaps {b:?} at {width}");
|
||||
}
|
||||
}
|
||||
// Wide windows show the whole group; narrow ones drop Discord, then the search icon.
|
||||
// Wide windows show the whole group, the search field included; narrow ones drop the
|
||||
// community button first, and the search field goes before the search icon.
|
||||
let texts: Vec<String> = texts(&out).into_iter().map(|(t, _)| t).collect();
|
||||
let has = |s: &str| texts.iter().any(|t| t == s);
|
||||
assert_eq!(has("Discord"), width > 1000.0, "{width}: {texts:?}");
|
||||
// Search is an icon only (as in PhotoCraft): its label lives in the tooltip.
|
||||
if width > 1000.0 {
|
||||
assert!(has("Search commands"), "the search field shows at {width}: {texts:?}");
|
||||
}
|
||||
// The search's tooltip text is not painted in the bar.
|
||||
assert!(!has("Search commands, tools, panels and effects"), "{width}: {texts:?}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,9 @@ pub use buttons::{
|
||||
SPLIT_ARROW, flat_button, flat_button_fit, icon_button, icon_button_enabled, menu_item, menu_item_name, paint_icon_button, primary_button,
|
||||
primary_button_enabled, secondary_button, split_button, split_button_named, toggle_icon,
|
||||
};
|
||||
pub(crate) use buttons::{button_width, flat_button_fit_width, icon_button_info, primary_button_width, secondary_button_width};
|
||||
pub(crate) use buttons::{
|
||||
button_width, flat_button_fit_width, icon_button_info, paint_icon_button_named, primary_button_width, secondary_button_width,
|
||||
};
|
||||
#[cfg(test)]
|
||||
use chips::gradient_chip_colors;
|
||||
pub use chips::{ProxyClicks, chip_button, chip_button_named, fill_stroke_proxy, gradient_chip, paint_chip, proxy_chip, swatch_tile};
|
||||
|
||||
@@ -8,6 +8,12 @@ pub fn icon_button(ui: &mut Ui, icon: &str, tip: &str, selected: bool, size: f32
|
||||
|
||||
/// [`icon_button`] drawn for a response the caller made (its own id or sense).
|
||||
pub fn paint_icon_button(ui: &mut Ui, resp: Response, icon: &str, tip: &str, selected: bool) -> Response {
|
||||
paint_icon_button_named(ui, resp, icon, tl!(tip), tl!(tip), selected)
|
||||
}
|
||||
|
||||
/// [`paint_icon_button`] that screen readers call `name` and that shows the tool tip `tip` (none
|
||||
/// when empty), both as given.
|
||||
pub(crate) fn paint_icon_button_named(ui: &mut Ui, resp: Response, icon: &str, name: &str, tip: &str, selected: bool) -> Response {
|
||||
let t = Tokens::get(ui.ctx());
|
||||
let rect = resp.rect;
|
||||
let size = rect.width();
|
||||
@@ -21,8 +27,8 @@ pub fn paint_icon_button(ui: &mut Ui, resp: Response, icon: &str, tip: &str, sel
|
||||
ui.painter().rect_filled(rect, CornerRadius::same(5), bg);
|
||||
let pad = (size * 0.2).round();
|
||||
icons::paint(ui, icon, rect.shrink(pad), if selected { t.text_strong } else { t.icon });
|
||||
resp.widget_info(|| icon_button_info(ui.is_enabled(), selected, tl!(tip)));
|
||||
if !tip.is_empty() { resp.on_hover_text(tl!(tip)) } else { resp }
|
||||
resp.widget_info(|| icon_button_info(ui.is_enabled(), selected, name));
|
||||
if !tip.is_empty() { resp.on_hover_text(tip) } else { resp }
|
||||
}
|
||||
|
||||
/// Small flat text button (Quick Actions style).
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ When the interface thread stays in one part of a frame for 3 s (VectorCraft's ow
|
||||
|
||||
## macOS: the menu bar
|
||||
|
||||
On macOS the menus live in the system menu bar, not in the window's app bar (which keeps the brand mark, Home, the search icon and the workspace switcher next to the traffic lights, centred on the bar by `apps/vectorcraft/src/mac_window.rs`). `--in-window-menus` or `VECTORCRAFT_IN_WINDOW_MENUS=1` keeps them in the window, as on Windows, Linux and the web; so does a menu bar AppKit refuses to build (logged). `ui.inspect` says which with `nativeMenuBar`.
|
||||
On macOS the menus live in the system menu bar, not in the window's app bar (which keeps the brand mark, Home, the search field and the workspace switcher next to the traffic lights, centred on the bar by `apps/vectorcraft/src/mac_window.rs`). `--in-window-menus` or `VECTORCRAFT_IN_WINDOW_MENUS=1` keeps them in the window, as on Windows, Linux and the web; so does a menu bar AppKit refuses to build (logged). `ui.inspect` says which with `nativeMenuBar`.
|
||||
|
||||
- **One menu model.** `crates/ui-egui/src/native_menu.rs` (platform-free, tested on every platform) builds the menu bar from the in-window menus (`menus::menu_tree`, each item through `menus::entry`, which the in-window menus draw too) and lays it out the Mac way: the VectorCraft menu holds About, Settings ▸ (one item per Preferences page, General… ⌘K), Language ▸, Appearance ▸ (UI brightness), Services, Hide VectorCraft ⌃⌘H (⌘H stays View › Hide Edges), Hide Others ⌥⌘H, Show All and Quit ⌘Q (the app's own `app.quit`, so unsaved documents are asked about); those leave Edit and Help. The in-window bar itself never shows the VectorCraft menu (it starts at File, as in Illustrator, on every platform): Language and Appearance have no in-window menu and are synthesized in `mac_layout`, and Quit is File › Exit in the window, relabelled to Quit in the App menu. Window starts with Minimize ⌃⌘M and Zoom and ends with Bring All to Front, and Help is the system's Help menu (its search field). A system key a command (or a user's shortcut) already has stays the command's, and the log says so.
|
||||
- **The native side** is `apps/vectorcraft/src/mac_menu.rs`: muda (`=0.21.1`, default features off, macOS only, no `unsafe`) builds the `NSMenu`s. Labels, enabled and checked are updated in place when anything they show may have changed (a command ran, the document, its history or selection changed, a click or a key press); a change of structure (a recent file, the language, a shortcut) rebuilds the menus. While an interaction is open (for example a move, scale or shape drag, a dialog's preview or the font menu's preview), the app updates them for the document's changes only when the interaction begins and when it ends.
|
||||
|
||||
@@ -300,7 +300,7 @@ Names in the editing data that aren't UTF-8 (layers, objects, artboards, colors,
|
||||
| PSD | open, place, export | yes (open: layers as layers, or the merged image with `layers: false`; place: merged image, or the layers embedded as a group of objects with `layers: true`; the merged image comes in clipped by the file's clipping path; every mode and depth; `.psd` and `.pdd`) | yes (layered, max editability, point type as editable type layers with `preserveText`; `tests_psd.rs`) | PSD Import Options on File › Open and on File › Place without Link (Convert Layers to Objects, Flatten Layers to a Single Image, Import Hidden Layers, Import Slices; `tests_psdlayers.rs`, `dialogs/psd_import.rs`); slices (image resource 1050, version 6 and the version 7 and 8 descriptor) open and embed as user slices with `importSlices` (`tests_psdslices.rs`); layer comps aren't read; the embedded ICC profile's tags are 4-byte aligned (#1584) |
|
||||
| PSB | open | yes (layers as layers, or the merged image; the merged image comes in clipped by the file's clipping path) | no | |
|
||||
| PNG / JPEG / GIF / BMP / TIFF / Targa | open, place, export | yes (PNG: `.png` and `.pns`; BMP: `.bmp`, `.dib` and `.rle`; Targa: `.tga`, `.vda`, `.icb` and `.vst`, raw or run-length encoded, with a 16-bit file's one-bit alpha) | yes; TIFF is also selectable in Export for Screens and Asset Export with its existing options | Targa: `tests_tiffbmp.rs`, `tests/links.rs`; TIFF: grayscale with an alpha channel or other extra channels reads (#1466 in part), and so do files that store each channel as its own plane (PlanarConfiguration 2), CMYK ones with their ink amounts, and 1-bit files compressed with CCITT Group 3 (Compression 2 and 3, one- and two-dimensional rows); the ICC profiles embedded in JPEG and TIFF have 4-byte aligned tags (#1584); PNG export marks its colours as sRGB (`embedIcc`, an `sRGB` chunk; no ICC profile is embedded, #2221) |
|
||||
| WebP | export (Export for Screens) | yes | yes (lossless only; lossy written lossless with a warning) | |
|
||||
| WebP | export (Export for Screens) | yes | yes (lossless by default; `lossless: false` writes lossy WebP at `quality` 0–100, default 90) | lossy files are `VP8 `, with an `ALPH` chunk when some pixels are not opaque; `tests_text.rs` |
|
||||
| JPEG XL `.jxl` | — | yes (first frame; 16-bit and floating-point samples as 8 bits, alpha kept; CMYK refused) | no | decoded with jxl-oxide; the size is checked from the header before decoding; container Exif resolution sizes opened and placed images; tests in `crates/engine/src/cmd/fileio/tests_jxlread.rs` and `crates/engine/tests/import_fuzz.rs` |
|
||||
| HEIC / HEIF | open, place | yes (HEVC-coded still images: single pictures and grids of tiles, 8 to 10 bits, with an alpha image; image sequences, other codings and grids of cropped tiles are refused) | no | `.heic`, `.heif`; decoded by heic-rs in the engine's default `heif` feature (a build without it refuses the files with a message); the container's rotation, mirror and crop are applied; without an `nclx` box the HEVC stream's video signal type gives the matrix and range; an RGB ICC profile, or Display P3 with the sRGB curve named by an `nclx` box or, without a color box, by the stream, is converted to sRGB; EXIF resolution tags size the image, or 72 ppi; bounded decoding; `tests_heifread.rs` |
|
||||
| PCX | open, place | yes (1 bit in the header palette's first two colors, black and white without them; 1 bit in two to four planes and 4 bits with up to 16 colors; 2 bits in the CGA colors the header's CGA palette settings pick; 8 bits with the 256-color palette, gray without one; 24-bit color in three planes) | no | the header's HDpi and VDpi size the image; a file of another depth or plane count, cut short or past the pixel allowance is refused with a message; tests in `crates/engine/src/cmd/fileio/tests_pcxread.rs` and `crates/engine/tests/import_fuzz.rs` |
|
||||
|
||||
+19
-5
@@ -1072,7 +1072,9 @@ given and the swatch already has keeps its model, as does a stop color that `pai
|
||||
gradient already has; a stop that names a swatch takes the swatch's color as it is, and `swatch.new` or `swatch.edit`
|
||||
with `mode` converts a color into that mode only. RGB documents keep colors as given. Harmonies, Edit
|
||||
Colors blends, inversions and Recolor Artwork keep each colour's model (a blend between models takes the document's).
|
||||
`swatch.new {colors: [...]}` saves several colours as swatches in one undo step. `color.harmony {color, rule, steps?, variation?, amount?}` answers what the Color
|
||||
`swatch.new {colors: [...]}` saves several colours as swatches in one undo step. An entry of `swatch.new {colors}` or
|
||||
`swatch.newGroup {colors}` may be `{swatch, tint}`: a tint of a global or spot color below 100% becomes a tint swatch
|
||||
("Name 40%") linked to it, as the Color Guide panel saves the tints of a spot color base. `color.harmony {color, rule, steps?, variation?, amount?}` answers what the Color
|
||||
Guide panel shows: the harmony rule's colours, base first, and per colour its row of `2·steps+1` variations
|
||||
(shades, cool or muted on the left, tints, warm or vivid on the right). With `limitTo` (a swatch library id or name,
|
||||
or `"document"` for the document's swatches) every colour snaps to the library's nearest colour (ΔE 2000), as the
|
||||
@@ -1260,6 +1262,10 @@ exporter plug-in's parameters. Other formats are written at once. OK writes the
|
||||
OK returns what `file.exportAs` returns, which has no `format` or `bounds` (Text Export Options: `{path}`). Any
|
||||
option skips the options dialog, but without `path` the save panel still picks the file. To write without a
|
||||
dialog, pass `path`. `file.exportAs {path, exportSelection: true, …options}` writes the selection the same way.
|
||||
In the Save PDF dialog, `ui.dialogReset {}` (Cancel while Alt, or Option on macOS, is held) puts every option back to
|
||||
the chosen preset's settings, clears the passwords, and leaves the dialog open with its preset, path, artboard range and
|
||||
section; `answer_dialog {action: "cancel"}` still closes it without saving. If the chosen saved preset was deleted
|
||||
while the dialog is open, `ui.dialogReset` returns an error naming it and leaves every field, passwords included, as it is.
|
||||
|
||||
Raster exports default to the document's raster effects resolution. An explicit `scale` sets pixels per
|
||||
point (72 times that value in ppi); `options.ppi` wins over either scale option. CLI `run --export` and
|
||||
@@ -1274,6 +1280,12 @@ pixels per point, and the file stores the resolution that results, as with `ppi`
|
||||
either one wins over `ppi` and `scale`. A value that is not a positive number is refused. Export for Screens rows keep
|
||||
their own size (`scale: "512w"`).
|
||||
|
||||
WebP is lossless by default (`lossless: true`). `{"format": "webp", "lossless": false, "quality": 60}` writes a lossy
|
||||
WebP file: `quality` runs from 0 to 100 (default 90, VectorCraft's own value), and a higher value keeps more detail in
|
||||
a larger file. A lossy file keeps the alpha exactly when some pixels are not opaque. A WebP `quality` above 100, or one
|
||||
that is not a whole number, is refused; a lossless file ignores `quality`. Export for Screens takes both in a WebP row
|
||||
or in `settings.webp`.
|
||||
|
||||
`shape.ellipse` (and `draw_shape` with `shape: "ellipse"`) takes `anchors`, the number of smooth anchors (default 4).
|
||||
Without it, or at 4, it draws a live ellipse. Any other count from 2 to 1000 draws a closed plain path with that many
|
||||
anchors spaced evenly by angle, clockwise from the left one and fitted to `width` × `height`. The Ellipse dialog (a
|
||||
@@ -3246,7 +3258,7 @@ own layout rules.
|
||||
|
||||
## Learn panel
|
||||
|
||||
Window › Learn and the Explore tutorials button beside the search icon at the right end of the app bar show and hide
|
||||
Window › Learn and the Explore tutorials button beside the search field at the right end of the app bar show and hide
|
||||
the Learn panel. Its For you tab holds a Get started section with a Quick skill guide card; choosing the card opens
|
||||
the Skills tab. The Skills tab lists VectorCraft's own skills, each with a progress ring and the count of its tutorials
|
||||
finished of all its tutorials. Choosing a skill lists its tutorials, choosing a tutorial shows its numbered steps, and
|
||||
@@ -8672,9 +8684,11 @@ documents every field:
|
||||
black art leaves the inks under it on the other plates. Which paints count as black is VectorCraft's own rule: a
|
||||
fill, stroke or character paint of solid 100% process K or 100% gray, or a gradient whose every stop is (every
|
||||
color point of a freeform gradient), each to within half a percent (99.5% K counts, and so does 0.4% cyan beside
|
||||
it). Rich black, RGB and Lab black, tints below 99.5% and colors linked to a spot swatch or to Registration still
|
||||
knock out. A symbol instance's art is judged with the paints the instance prints it in, its own fill and stroke
|
||||
changes and its fill's stain included. Only the printed copy is marked: the document and its own overprint settings do not change. Composite
|
||||
it). Rich black, RGB and Lab black, tints below 99.5% and colors linked to a spot swatch or to Registration are not
|
||||
marked, and paints already set to overprint keep that setting. A symbol instance's art is judged with the paints the
|
||||
instance prints it in, its own fill and stroke changes and its fill's stain included. An instance that print leaves
|
||||
unplaced, because placing its art would take the printed art past 16,000,000 objects or draw it deeper than 128
|
||||
levels, is judged by its symbol's own art instead. Only the printed copy is marked: the document and its own overprint settings do not change. Composite
|
||||
output ignores the option, and the Print dialog's Overprint Black checkbox is disabled unless Mode is Separations.
|
||||
- `graphics: {autoFlatness, flatness, fonts}` and `color: {intent, preserveNumbers}` (the intent colours separate
|
||||
with; without preserveNumbers CMYK colours are separated again).
|
||||
|
||||
@@ -633,7 +633,7 @@ since 2026-10-01.
|
||||
- **Clipped bottom-bar text (#6622):** A Help Bar hint wider than the window, such as the Dimension tool's hint in an 800-point window, ends in an ellipsis, as the status message does. In a narrow status bar the tool name ends in an ellipsis and leaves the status message its room. Resting the pointer on a clipped hint, tool name or message shows the full text in a tooltip that wraps within the window. Text that fits shows no tooltip, and screen readers receive the full text. Scores and estimates are unchanged.
|
||||
- **Notes of an open in the status bar:** After File › Open the status message names the first note that says reading the file left something out (the notes that make Save ask before writing over the file), else the first note, and counts them all. With several notes, resting the pointer on the message lists them in that order, as many as fit in the window and at most 30, then how many more. Screen readers receive the list after the message. Scores and estimates are unchanged.
|
||||
- **Notes of a save or an export in the status bar:** After Save, Save As, Save a Copy, Save as Template, Save a Timestamped Copy, Save as PDF, Export As, Export Selection, Export for Screens, Asset Export, Save for Web, Preview in Browser, Save for Office Documents, Text Export Options, a print to a file or the CSS Properties panel's export, the status message names the first note and counts them all. With several notes, resting the pointer on the message lists them in the order the reply gives them (a save's notes start with what the format loses), as it lists an open's notes. Scores and estimates are unchanged.
|
||||
- **What a save or an export loses, named first:** Each writer marks its notes as a loss (something of the document the file leaves out or writes differently) or a note on the options (an option it didn't apply or applied another way while the art reaches the file as it looks, or something an option turns off). The replies of the save and export commands list the losses first, each kind in the order given, across every file an export writes. The status message after a save or an export then names a loss when there is one: an export to lossy WebP of type in a font that isn't installed names the fallback-font note instead of the lossy WebP note. A print to a file and the print preview list theirs the same way: art outside the imageable area, type in a fallback font and transparency flattened for PostScript come before notes such as a fixed flatness that isn't written or copies per sheet that don't fit. Scores and estimates are unchanged.
|
||||
- **What a save or an export loses, named first:** Each writer marks its notes as a loss (something of the document the file leaves out or writes differently) or a note on the options (an option it didn't apply or applied another way while the art reaches the file as it looks, or something an option turns off). The replies of the save and export commands list the losses first, each kind in the order given, across every file an export writes. The status message after a save or an export then names a loss when there is one: a WebP export of type in a font that isn't installed, given an option WebP doesn't read (`interlaced`), names the fallback-font note instead of the note on that option. A print to a file and the print preview list theirs the same way: art outside the imageable area, type in a fallback font and transparency flattened for PostScript come before notes such as a fixed flatness that isn't written or copies per sheet that don't fit. Scores and estimates are unchanged.
|
||||
|
||||
- **Canvas review follow-up:** Cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission. Controlled-worker regression checks oversized width and height, high DPI and the render transform without allocating oversized images. Scores and estimates are unchanged.
|
||||
- **Cached canvas frames during viewport changes:** Cached screen textures use their own raster dimensions and pixels-per-point when reprojected. `canvas::tests::cached_frames_keep_their_scale_during_resize_rotation_and_dpi_changes` holds the worker and checks every UV corner against the cached render transform, including isolated viewport-only resize at zero/30-degree rotation, fractional raster dimensions, zoom/pan, changed rotation, monitor-DPI changes in both directions, Pixel Preview and replacement-frame delivery. The contributor rebuilt and confirmed the original resize issue is fixed with their own artwork on 2026-10-19; the subsequent upstream rebase is checked by regressions and full CI. The artwork stays local. Scores and estimates are unchanged.
|
||||
@@ -706,6 +706,7 @@ since 2026-10-01.
|
||||
- **Escape in more tool drags:** Escape during an Anchor Point drag, a Mesh tool drag, a Direct Selection drag of a mesh point, a corner widget or the brackets of type on a path, or a Shape Builder drag cancels it: the art goes back to how the press found it, no undo step is added, the release does nothing, and the tool stays chosen. Escape during a Measure tool drag brings back the measurement before it. Regression tests: `escape_cancels_*` in `draw2/anchor/tests.rs`, `meshedit.rs`, `direct/tests.rs`, `builder/tests.rs` and `xform/measure.rs`, and `escape_cancels_an_anchor_point_mesh_shape_builder_or_measure_drag` in `tests/toolescape.rs`.
|
||||
- **Shift-click on corner widgets (#5188):** with Direct Selection, when every corner of a path is selected (the path selected whole), a Shift-click on a corner widget picks that corner alone, so the next drag rounds just it. The other corners' widgets then hide; a Shift-click on another corner's anchor adds that corner and shows its widget, and a Shift-click on a showing widget deselects its corner. Adding a corner by Shift-clicking its widget while it is hidden stays open (#1232). Corner widgets are chosen by clicking one and Shift-clicking the others ([Logos By Nick, rounded corners in Illustrator](https://logosbynick.com/?p=15787)). Test: `corners::tests::a_shift_click_on_a_widget_of_a_whole_path_picks_its_corner`.
|
||||
- **TIFF in screen and asset export:** both format menus expose the existing TIFF encoder and Format Settings. Headless UI regressions choose TIFF and check scaled dimensions, artboard selection, filenames, encoding options, saved settings and collected-asset output. Public reference: [Export for Screens](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/export-for-screens.html), updated 2026-09-28, lists TIFF for both artboards and assets. Adobe staff [confirmed support in 30.2.1](https://illustrator.uservoice.com/forums/333657-illustrator-desktop-feature-requests/suggestions/49081034-add-tiff-format-into-export-for-screens-assets-d) on 2026-02-19; the older 2025 Collect assets guide omits TIFF.
|
||||
- **Lossy WebP with a Quality setting:** WebP Options has a Compression menu (Lossless, Lossy) and a Quality slider from 0 to 100 that is enabled for Lossy. Lossy writes a `VP8 ` WebP file, with an `ALPH` chunk that keeps the alpha exactly when some pixels are not opaque. `document.export`, `document.serialize` and Export for Screens take `lossless: false` with `quality` (default 90, VectorCraft's own value), in a format row or in `settings.webp`; Format Settings for WebP keeps both. Lossless stays the default, and a quality above 100 or one that is not a whole number is refused. Public reference: [export file format options](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/export-file-format-options-in-illustrator.html) describes Lossless and Lossy WebP and a Quality setting for Lossy (`webp_is_lossless_by_default_and_lossy_when_asked`, `lossy_webp_keeps_translucent_pixels`, `webp_quality_out_of_its_range_is_refused` in `crates/engine/src/cmd/fileio/tests_text.rs`, `webp_options_choose_lossless_or_lossy_at_a_quality`).
|
||||
- **Export for Screens of the selected artboards:** while the Artboard tool is in use, File › Export › Export for Screens… (`file.exportForScreens`) opens with the artboards the tool has selected checked on its Artboards tab, and Export Artboard writes only those. Shift-clicks on the canvas, or Shift- or Ctrl/Cmd-clicks on the Artboards panel's rows, select several. The other fields show the settings the document last exported with. With another tool in use, the dialog takes its artboard choice from those settings too. Public reference: [Export selected artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/organize-manage-artboards/export-artboards.html).
|
||||
|
||||
- **Effects in Export Selection and asset crops:** File › Export Selection, Asset Export, Export for Screens' Assets tab and CSS Properties' rasterized art crop each object to the bounds the renderer measures for what it draws: drop shadows, glows, geometry effects such as Offset Path, a group's own effects and the effects in a symbol's art. A brushed path is cropped to its visual bounds, and a Shaper group is cropped to the art it shows. `assets.list` reports the same crop. Engine tests export a square with each effect, a group with a shadow and an asset with a shadow, and check that the effect is inside the image. Public reference: a [Community Expert answer](https://community.adobe.com/t5/illustrator-discussions/exporting-assets-adds-transparent-borders/m-p/10708713/highlight/true) traces the extra area of exported assets to the raster effects' area (Document Raster Effects Settings › Add Around Object).
|
||||
@@ -1042,8 +1043,10 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- Perspective Distort and Free Distort (`object.distort`) turn each warped object's bounding box as the warp turns the object at its own center, the objects inside groups, compound paths and clip groups and the art of linked opacity masks included, so the next Selection or Free Transform drag uses the tilted box; Object › Transform › Reset Bounding Box squares it again, and corners left where they are add no undo step (VectorCraft's own rule; `bboxrotate::distort_turns_an_upright_box_with_the_warp_at_its_center`, `distort_turns_each_member_and_linked_mask_by_its_own_warp`, `mirrored_and_collapsing_distorts_keep_valid_angles`, `distort_angles_undo_redo_and_reopen_together`, `xform::unchanged_distort_records_no_history`).
|
||||
- The Free Transform widget's Constrain works in Free Distort as well as in Free Transform ([the help page](https://helpx.adobe.com/illustrator/using/tool-techniques/free-transform-tool.html)). With Constrain on, or Shift held, a corner dragged in Free Distort moves only along the line through the opposite corner, in the box's own proportions, and the other three corners stay in place; on a turned box the line runs through the box's own corners. The line is VectorCraft's own rule. Cmd/Ctrl+Alt+Shift on a corner still drags in Perspective Distort, where Constrain stays unavailable (tools `xform::free::tests::free_distort_corner_keeps_to_its_diagonal_with_shift_or_constrain`, `shift_pressed_during_a_free_distort_drag_constrains_it`, `a_turned_box_is_constrained_along_its_own_diagonal`, `along_diagonal_of_a_degenerate_box`; engine `xform::free_transform_constrained_distort_keeps_the_corner_on_its_diagonal`; ui-egui `free_transform::tests::the_widget_sets_the_mode_and_a_corner_drag_then_distorts`).
|
||||
- Native macOS menu bar, vector tool cursors, a command palette (Help › Search Commands…), middle-button panning with any tool. Native menus explicitly end tracking on command selection, outside window presses and Escape; menu updates wait until tracking ends, and a dismissing press never starts a canvas gesture (M14.8).
|
||||
- Help › Search Commands… is the first item of the Help menu in the window, with its shortcut and a separator after it; in the native macOS menu bar it is the first item below the system's search field. This is VectorCraft's own order and does not raise a score (`menus::tests::help_starts_with_search_commands`, `tests::nativemenu::the_mac_help_menu_starts_with_search_commands`).
|
||||
- A Recent Commands button beside the Help › Search Commands field lists the last five commands, tools, panels and effects picked from the palette, most recent first, with a command picked again moved to the top. Choosing a row closes the palette and runs it as a pick of the same result does; with no picks yet the list shows a dimmed No recent commands row, and a command that is not available now, such as a filter of a plug-in that is not loaded, is left out until it comes back. The ids are saved with the UI state. While the list is open, Up and Down move through its rows, wrapping at the ends, and Escape closes the list before the palette. This is VectorCraft's own addition and does not raise a score (#6376; `palette` tests `recent_commands_*`, `a_recent_command_runs_what_its_pick_runs`, `the_keys_wrap_within_recent_commands`, `escape_closes_recent_commands_before_the_palette`).
|
||||
- The Learn panel (Window › Learn, or Explore tutorials beside the search icon on the app bar) has a For you tab with a Get started section and a Quick skill guide card, and a Skills tab that lists VectorCraft's own skills with their progress rings and counts of tutorials finished; a skill lists its tutorials, a tutorial shows its numbered steps, and Back goes up a level; `learn.list`, `learn.tab {tab}`, `learn.skill {skill}`, `learn.show {tutorial}` and `learn.back` script it, and the tab buttons, the rows and Back run them ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`).
|
||||
- The app bar's search control is a field showing a magnifier, "Search commands" and the Help › Search Commands… shortcut. The field shows no shortcut when the shortcut is cleared or too long to fit beside the text; the tooltip and the screen-reader name still give it. A click on the field, or Enter or Space while it has the keyboard focus, toggles the command palette as the shortcut does, and the palette's popup holds the text field. While the field has the focus, the app's existing rule for a focused control keeps the app's own keys off, so Enter does not open Move and Tab moves the focus on. While a dialog is open the field and the icon are drawn disabled and do nothing, as the shortcut does. Screen readers name the field and the icon Search commands, with the shortcut. As the bar narrows, the community button goes first, then Explore tutorials, then the field becomes the magnifier icon, then the workspace switcher narrows to 64 points, then the icon goes; Safe Mode's label keeps its room first. The field is wider than the icon, so the community button and Explore tutorials go at wider bars than they did beside the icon. This is VectorCraft's own addition and does not raise a score (`chrome::tests`: `the_app_bar_gives_up_its_right_hand_controls_in_order`, `a_wide_app_bar_shows_a_search_field_with_the_palette_shortcut`, `the_search_field_follows_the_palettes_shortcut`, `a_long_shortcut_leaves_the_search_hint_readable`, `a_click_on_the_search_field_opens_the_palette`, `the_search_icon_has_the_fields_name_and_both_are_disabled_under_a_dialog`, `the_keyboard_opens_the_palette_from_the_search_field`, `a_narrowing_app_bar_turns_the_search_field_into_the_icon`).
|
||||
- The Learn panel (Window › Learn, or Explore tutorials beside the search field on the app bar) has a For you tab with a Get started section and a Quick skill guide card, and a Skills tab that lists VectorCraft's own skills with their progress rings and counts of tutorials finished; a skill lists its tutorials, a tutorial shows its numbered steps, and Back goes up a level; `learn.list`, `learn.tab {tab}`, `learn.skill {skill}`, `learn.show {tutorial}` and `learn.back` script it, and the tab buttons, the rows and Back run them ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`).
|
||||
- A tool's name in a Learn tutorial step is a blue link that shows where the tool is without choosing it (`learn.locateTool {tool}`): its toolbar button is marked, a collapsed group's flyout opens with the tool's row marked, a torn-off strip comes to the front, and a tool no shown toolbar holds is marked in the All Tools drawer. The mark, its 3 seconds and the hidden-toolbar cases are VectorCraft's own rules ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html); `panels::learn::tests`, the `a_learn_link_*` tests in `toolbar::tests`).
|
||||
- Under a tutorial's steps, View more opens the tutorial's own practice sample as a new untitled document, and once the tutorial is finished, Next Up moves to the next tutorial in the same skill, as the help page describes ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html)). The samples are VectorCraft's own drawings. A Finish tutorial button that shows once the sample is open, the untitled copy, Back to skills in place of Next Up after a skill's last tutorial, and Next Up showing the next tutorial without opening its sample are VectorCraft's own rules. `learn.openSample`, `learn.finish`, `learn.next` and `learn.skills` (Back to skills) script them. Not done: the help page's short video. Regression tests: `view_more_opens_the_tutorial_s_sample_as_a_new_untitled_document`, `finishing_a_tutorial_offers_next_up_in_its_skill`, `the_practice_controls_work_from_the_keyboard`, `the_last_tutorial_of_a_skill_offers_back_to_skills`, `learn_finish_and_learn_next_follow_the_practice`, `learn_skills_shows_the_list_of_skills`, `the_practice_commands_reject_a_missing_or_unknown_tutorial`, `every_tutorial_has_its_own_readable_sample` and `the_next_tutorial_is_the_next_one_in_the_same_skill` in `crates/ui-egui/src/panels/learn/tests.rs`.
|
||||
- A Learn tutorial's steps are marked complete as the learner works, and a skill's progress ring fills as its tutorials are finished, as the help page describes ([the help page](https://helpx.adobe.com/illustrator/desktop/get-started/learn-the-basics/learn-skills-quick-skill-guide.html)). Each step has a check box that marks it done once the tutorial's sample is open (`learn.markStep`); Finish tutorial marks every step done; a skill's count shows its tutorials finished of all, and a finished tutorial has a check mark in its skill's list. Marking steps by hand, the count, keeping the progress in the preferences (the web build keeps it while the page is open) and Reset progress (`learn.resetProgress`) are VectorCraft's own rules; `learn.list` reports the progress. Regression tests: `a_step_s_check_box_marks_only_that_step`, `a_step_s_check_box_works_from_the_keyboard`, `finishing_tutorials_fills_their_skill_s_ring_and_count`, `a_skill_with_no_tutorials_shows_0_of_0`, `learn_mark_step_checks_its_params`, `reset_progress_clears_only_the_progress`, `the_preferences_keep_the_progress` and `saved_progress_is_read_leniently` in `crates/ui-egui/src/panels/learn/tests.rs`.
|
||||
@@ -1245,6 +1248,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
While a spiral is dragged out, Alt adds or removes whole winds of four segments and Ctrl/Cmd changes the decay. The spiral's inner end keeps the distance from the center it had on the first modified drag event, while the outer end follows the pointer. The [default keyboard shortcuts](https://web.archive.org/web/20260726060015/https://helpx.adobe.com/illustrator/using/default-keyboard-shortcuts.html) (archived copy) list Alt-drag to add or subtract winds and Ctrl-drag to change the decay rate; [Draw spirals](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/draw-shapes/draw-spirals.html) defines four segments per full wind and Decay as the amount each wind decreases. An 80% spiral has 80% of its outer radius after four segments; newly drawn spirals with the same settings wind more broadly than in earlier VectorCraft builds. Rounding the fitted count to whole winds from the count on the first Alt-only drag event, the held inner radius, the ranges (2…1000 segments, 5…99.99 % decay), Ctrl/Cmd taking precedence when both are held, and the new values staying as Spiral tool options are our own rules. Switching back to Alt uses the current count as its new base while keeping the held inner end.
|
||||
Escape while an arc, spiral or grid is dragged out cancels it and puts back the options its keys, Alt and Ctrl/Cmd changed (slope, open or closed, base axis, segments, decay, dividers and skews), so the next drag and the tool's options start from the values before the canceled drag; a drag that is let go keeps them, and an option set with `tool.setOption` during the drag stays. This is VectorCraft's own rule.
|
||||
VectorCraft's own Anchors field in the Ellipse dialog (a click with the Ellipse tool; `shape.ellipse {anchors}`, part of #7840) sets how many smooth anchors the ellipse has, 4 by default; 4 draws a live ellipse, and any other count from 2 to 1000 draws a plain path with the anchors spaced evenly by angle, fitted to the typed width and height. The count last confirmed stays as the Ellipse tool's `anchors` option, and the next Ellipse dialog opens on it (`ellipse_with_four_anchors_is_the_live_ellipse`, `ellipse_anchors_draw_that_many_anchors_on_the_ellipse`, `ellipse_refuses_a_bad_anchor_count`, `the_ellipse_dialog_draws_and_keeps_its_anchor_count`).
|
||||
In the Ellipse dialog, a click on the word Height copies the Width value into the Height field, so OK draws a circle of that width, as [the help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=140) describes for drawing ellipses. The Rectangle and Rounded Rectangle dialogs keep plain labels. VectorCraft's own rules: the word Height is a button that Space or Enter also presses, and that Enter does not press OK (nor does Enter on the Constrain Width and Height Proportions button); with the link on, the link stays on and keeps the circle when a side is typed next; a Width that is empty or not a distance, including one the field refuses as the click leaves it, leaves Height as it is; Cancel discards the copy. Evidence: `dialogs::shapes::tests::{clicking_height_in_the_ellipse_dialog_copies_width_into_height, the_ellipse_height_button_copies_width_from_the_keyboard_and_keeps_the_link_round, enter_on_the_link_button_turns_the_link_on_without_pressing_ok, only_the_ellipse_dialog_has_the_height_button, copying_width_takes_only_a_width_that_reads}`.
|
||||
- **Cutting:** Eraser, Scissors, Knife, Mirror & Cut, Line Cut and Rectangle Cut (real geometry, compound paths keep their holes).
|
||||
A Scissors cut (`path.split`) leaves one of the two new end points selected and the rest of the path unselected, as [Cut paths](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/split-paths.html) and the "Split a path" section of the [CS3 user guide](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf) describe: the two end points lie on top of each other, and a Direct Selection drag from them moves the selected one with its handles and no other anchor. A closed path cut once stays one open path.
|
||||
The paths a Scissors cut (`path.split`) or Cut Path at Selected Anchor Points (`path.cutAtAnchors`) makes keep the source path's fill and stroke settings, and every stroke's alignment becomes Center in the same undo step, as [the help page](https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-paths/split-paths.html) describes. Resetting hidden stroke rows too, centering the strokes of a path's other subpaths and of the compound path a cut member belongs to are VectorCraft's own rules (`scissors_cut_paths_have_their_strokes_centered`, `cut_at_anchors_paths_have_their_strokes_centered`).
|
||||
@@ -1667,6 +1671,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
The four polynomial distributions are original approximations of the public description, not measured
|
||||
numeric parity. See [Blend panel overview](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blend-panel-overview.html).
|
||||
A blend in a `.ai` or EPS opened from its editing data keeps a Specified Distance spacing with its distance ([Blend Options](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blend-options-overview.html)) where VectorCraft lays out as many steps between each pair of keys as the file draws, in the same places and colors. A Smooth Color blend opens live only where VectorCraft's own Smooth Color step count equals the drawn steps, and VectorCraft often counts a different number. A blend that VectorCraft doesn't lay out as drawn keeps its drawn steps with a note (`import::ai::tests::a_blend_keeps_its_spacing`, `a_blend_of_three_keys_keeps_its_distance_between_each_pair`, `a_blend_whose_spacing_doesnt_lay_out_its_steps_keeps_them`).
|
||||
Such a blend also keeps the orientation its record names (Align to Page or Align to Path) where that orientation lays the drawn steps out in place, at their sizes and with their outlines, and a blend written with no spine part, its keys named in their order, opens with no spine of its own (`import::ai::blend::tests::the_records_orientation_is_kept_where_both_lay_out_alike`, `the_records_orientation_must_lay_the_steps_out_turned_as_drawn`, `import::ai::tests::a_blend_with_no_spine_written_runs_straight_between_its_keys`).
|
||||
|
||||
- Create Strokes uses exact squared Euclidean distances and Guo–Hall thinning in bounded per-blob crops. Maximal-disc pruning, split-crossing merges and degree-two joins simplify its skeleton graph. The whole-blob width rule and ink fitting remain; 46 code-drawn inputs measure ends and junctions in [`image-trace-quality.md`](image-trace-quality.md#centre-lines). Junction degrees measure 44/45 correct in each input variant; remaining spurs are recorded. This is a measured skeleton improvement; the Image Trace score, missing per-feature selection and width controls, and estimates remain unchanged.
|
||||
- Create Strokes decides stroke or fill per feature, as the [help page](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/image-trace-panel-options.html) describes the Strokes width: the widest feature of the image that can become a stroke. A shape wider than Stroke somewhere keeps as its area every disc wider than Stroke that fits in it, and each piece outside those discs that reaches out of them at least one and a half times its own width (and 3 px) is traced as a stroked center line, its end at the area carried to the cut so the line's cap closes the join. Corners and edge slivers stay in the area. Which pieces count as features is VectorCraft's own rule. Each line still has one width; without Fills, the area is a 1 px outline as before. Tests: `thin_features_of_a_wide_shape_are_strokes_and_its_body_a_fill`, `wide_shapes_without_thin_features_stay_one_fill` and `distances_to_seeds_equal_brute_force` in `vectorcraft-trace`. The Image Trace score and estimates are unchanged.
|
||||
@@ -1751,6 +1756,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Sample Color from Screen:** an eyedropper button in the Color Picker and `ui.sampleScreenColor` (which can be given a key in Keyboard Shortcuts) pick a color anywhere on the screen with the system's sampler: `NSColorSampler` on macOS, the XDG desktop portal's [PickColor](https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Screenshot.html) on Linux, a still copy of every monitor under a crosshair on Windows, and the EyeDropper API in browsers that have it. The color becomes the fill or the stroke as one undo step, or the Color Picker's color, converted from display sRGB into the working RGB space. On Linux, a session without a portal that has PickColor, a portal that does not return from the call within 25 seconds (VectorCraft's own limit) or leaves the bus before it answers, and a portal that ends the request another way each show a status message and end the wait. On Windows, the copy is read as sRGB, so the colors of HDR and wide-gamut displays are not converted; Escape, a click of another mouse button or switching to another window cancels (VectorCraft's own rules). The BSDs and other browsers have no sampler yet; the button is gray there.
|
||||
- **Color Guide color groups:** with variation cells selected, the Color Guide's Save Color Group to Swatches button saves those cells as one swatch group, and with none selected it saves the harmony colors, as the [help page](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf) describes saving several selected variations together (printed page 135). The group takes the cells in grid order (row by row, left to right, each cell once), is named after the harmony rule and is one undo step; these are VectorCraft's own rules. A selection lasts until the base, the Color Guide Options, the variation mode, the harmony rule, the library limit or the colors the grid shows (for example after a new swatch while the guide is limited to the document's swatches) change.
|
||||
- **Color Guide colors dragged to Swatches:** a variation cell dragged from the Color Guide onto the Swatches panel's list becomes a swatch of that color, as the [help page](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf) describes for saving variations as individual swatches (printed page 135). In VectorCraft a harmony strip color drags the same way, a drag carries only the grabbed color (the selected cells stay selected and the selection is not saved), it carries the color the cell shows (snapped to the Limit to Library colors), keeps the color's model and does not paint the selected art; the swatch follows the panel's rules for a dropped color (`swatch.new`, one undo step, a color that is already a swatch is added again under another name, a drop on a color group joins it). These are VectorCraft's own rules. Tests: `a_dragged_guide_color_carries_its_color_and_applies_nothing` and `a_guide_color_dragged_onto_the_swatches_panel_becomes_a_swatch` in `crates/ui-egui/src/panels/color_guide.rs`.
|
||||
- **Color Guide tints of a spot color:** when the Color Guide's base is a spot color, or a tint of one, chosen in the Swatches panel, with the Color panel's tint slider or with the base chip, the cells right of the center in the base row of Tints/Shades are tints of that spot color: a click paints the art with the tint, a drag carries it, and Save Colors as Swatches and Save Color Group to Swatches make tint swatches ("Ink 60%") linked to the spot color, so they follow an edit of it. The [help page](https://helpx.adobe.com/illustrator/desktop/manage-colors/learn-color-basics/color-guide-panel-overview.html) says spot colors are kept only on the right side of Tints/Shades and every other variation gives process colors. The tint percentages (the base's tint reduced by the share each cell goes toward white), the shades on the left staying process colors, a Limit to Library giving process colors, and a global process base keeping plain colors are VectorCraft's own rules. `swatch.new {colors}` and `swatch.newGroup {colors}` take `{swatch, tint}` entries. Tests: `a_spot_color_base_gives_tints_of_that_spot_color`, `a_tinted_spot_base_gives_lighter_tints_and_a_lost_link_gives_process_colors`, `a_renamed_spot_color_stays_the_base`, `saved_spot_tints_are_tint_swatches_of_the_spot_color`, `a_dragged_spot_tint_becomes_a_tint_swatch`, `a_clicked_spot_color_swatch_becomes_a_linked_color_guide_base`, `colors_entries_naming_a_spot_color_save_tint_swatches`.
|
||||
- **Stroke visibility (#1253):** adding paint to a previously unpainted zero-width stroke restores the existing 1 pt default (`PaintDefaults::default`, `Appearance::set_stroke`), for the selected appearance item, the new-art defaults and Swap Fill/Stroke. Positive widths are kept; recoloring a painted zero-width stroke keeps its explicit zero. A real Eyedropper-to-new-shape sequence reproduces the zero-width inheritance. Five engine regressions cover creation, defaults, targeted items, preserved widths and one-step Undo/Redo (`crates/engine/tests/it/stroke_visibility.rs`).
|
||||
- **Gradients:** lossless, validated gradient params; gradients follow rotate, reflect, shear, non-uniform scale and distortions; the Gradient tool edits the fill or stroke of the active proxy, type included; an interactive on-canvas annotator (move, length/angle, rotate, add/move/delete/duplicate stops, midpoints, a stop popover, Delete and arrow keys). The Gradient panel has the Fill/Stroke proxy, a gradient-swatch dropdown with Save to Swatches, midpoint locations, Alt-drag to copy or swap stops, swatch drops on the ramp and a stop eyedropper; copied appearances and graphic styles place gradients on each target's own bounds; gradient handles, both ends of a vector drawn on the art and the start of a clicked one snap as other drawn points do (path segments, construction guides and View › Snap to Glyph's guides included) and honour Constrain Angle. Gradient stops stay linked to global and spot swatches. Freeform gradients (points and lines) are edited on the canvas; radial gradients have an extent ellipse, an aspect handle and an off-centre focal point (SVG `fx`/`fy`, PDF two-point radials). A stroke's gradient runs within, along or across it. Object ▸ Expand turns gradients into N objects or a gradient mesh.
|
||||
A gradient stop that loses its link to a spot swatch (the swatch deleted, a recolor or adjustment that unlinks it, a library gradient, or a library character style linked to a swatch the document lacks) keeps the color it shows at full tint and drops the process plates it printed with that ink, as a stop given a plain color does; this is VectorCraft's own rule. Evidence: `tests::mapping_links_drops_the_process_plates_of_unlinked_stops` in `crates/color`, `tests::linked_stops::deleting_a_spot_swatch_takes_the_process_plates_of_the_stops_it_unlinks` and `tests::library::library_stops_unlinked_from_their_swatch_keep_no_process_plates` in `crates/engine`.
|
||||
@@ -1937,6 +1943,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
A `.ai` or EPS symbol library, whose editing data holds symbol definitions and their list but no layers, opens with those symbols in list order, each with its registration point. Other Library… in the Symbols panel's Symbol Libraries Menu imports the symbols of the file you pick ([Create or import symbol libraries](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/create-or-import-symbol-libraries.html)) and lists such a library's symbols in a library panel. A `.ai` or EPS read as its PDF part or page because its layers can't be used also gets the symbols defined before its layers (`crates/eps/src/import/tests_native.rs`, `crates/eps/src/import/ai/tests.rs`, `cmd::fileio::tests_aiimport::a_symbol_library_in_a_ai_file_without_layers_loads_its_symbols`).
|
||||
In a large canvas `.ai` or EPS ([Large canvas FAQ](https://helpx.adobe.com/illustrator/desktop/add-and-import-files/start-a-new-file/large-canvas-faq.html)), or a `.ai` whose page is in larger units, opened from its editing data, VectorCraft reads the symbol definitions in the same units as the layers. When the file opens at its full size, each symbol's art, strokes and effects are scaled with the layers, and each instance keeps its own scale and rotation and draws where and as large as before. A new instance comes in at the symbol's full size, the size of an instance at 100% in the file. A symbol library from such a file comes in at the same size, and opacity masks on the layers that don't move with their object are scaled with the layers too. Editing data that VectorCraft wrote keeps its symbols and those masks at their own size, as its `.ai` save writes them (`tests_native::a_large_canvas_eps_keeps_its_symbols_at_the_pages_size`, `a_large_canvas_ai_keeps_its_symbols_at_the_pages_size`, `a_large_canvas_ai_vectorcraft_wrote_keeps_its_symbols_at_their_own_size`, `a_symbol_library_in_larger_units_comes_in_at_the_pages_size`, `build::candidate_tests::scaling_the_symbols_keeps_their_instances_in_place`, `scaling_a_read_document_scales_unlinked_opacity_masks`).
|
||||
A `.ai` or EPS opened from its editing data whose text document makes the type of every text object that shows takes all its type from the text document: each text object stays in its own group, frame and layer, the page's type isn't matched with them, a file of more than 5,000 text objects still opens with its layers, and type the page draws differently (in another font) keeps the layers, with a warning. A line break inside a paragraph stays a line break in it (`crates/eps/src/import/tests_native.rs`, `crates/eps/src/import/ate.rs`).
|
||||
A `.ai` opened without its PDF part decodes and parses its text document and scans its text objects' frames once, for both the check that the text document makes all of its type and the build. When the file waits on its PDF part instead (an envelope of type, or a text document that can't be read), the builds with and without the PDF part use that same read. The document and notes are the same as before. Checking and building a file of 2,000 point type objects takes a median of 164 ms instead of 270 ms over seven runs each, with the two routes alternating, on Linux (`crates/eps/src/import/native/build.rs`).
|
||||
`.ai` and EPS editing-data import reads a text document whose keys are written by name, as files saved for version 11 write them, and the keys that later files write by name among the numbered ones (a font record's version, a paragraph's direction). The type of such a file comes from its text document, so type outside the artboards opens and each text object keeps its own story A run that names its paragraph or character style by the style's number takes that style (`a_text_document_with_named_keys_gives_type_off_the_page_too`, `a_text_document_with_named_keys_takes_a_runs_style_by_its_number`, `crates/eps/src/import/ate/names.rs`).
|
||||
In SVG export without Fewer `<tspan>` Elements, each character of live type that justification or Mojikumi moves (the letter gaps of a Justify All line without word spaces, the gaps between the characters of a justified Japanese line, closed-up punctuation, the space between Japanese and Latin letters) starts its own positioned `<tspan>`, and type scaled horizontally on a justified line is stretched to its own width (`crates/svg/tests/it/text_layout.rs`).
|
||||
To find those characters, SVG export lays a type object out a second time only when the second layout can differ from the first: point type with Line-end Punctuation Half Width and no Japanese punctuation or letters, the setting new type gets, is laid out once. Exporting 5,000 such objects takes a median of 109.4 ms instead of 171.5 ms on Windows 11, with the same SVG (`crates/svg/src/export/text/tests.rs`).
|
||||
@@ -1974,6 +1981,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
In a `.ai` opened from its editing data, Bas Relief in an art style takes its Detail, Smoothness and Light direction from the style's settings block, and an object other than type with it opens as itself with the live effect. A settings block that VectorCraft can't read (malformed, another effect's, a value out of range or a key it doesn't know) keeps the object's drawn look (part of #637; [raster effects reference](https://helpx.adobe.com/illustrator/desktop/special-effects-styles/apply-filter-effects/raster-effects-reference.html), [Photoshop File Formats Specification](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/), [scripting the filter gallery](https://community.adobe.com/questions-712/scripting-support-for-the-filter-gallery-1064646); `crates/eps/src/import/ai/style/tests.rs`, `crates/eps/src/import/ai/tests.rs`).
|
||||
PDF export and `.ai` saves write a page with a side longer than 14,400 pt with a `UserUnit` (PDF 1.6), its longer side divided by 14,400 and rounded up to the next thousandth, so that no side is longer than 14,400 units (ISO 32000-1, Annex C.2); a PDF 1.5 file with such a page is written as PDF 1.6 with PDF 1.5's encryption, PDF/X files and PDF 1.3 and 1.4 files write it in points (in PDF 1.3 and 1.4, a page past 32,767 pt that needs a real number past 32,767 is refused with an error naming it), a page whose short side is 3 pt or longer but would be under 3 units at that `UserUnit` gets a smaller one that keeps the short side at 3 units, and the export's warnings give each such page's size and how it is written (#6382). The Save PDF dialog's "Write pages longer than 200 in at full size in points" (`longPagesInPoints`, on by default; `.ai` saves leave it off) writes such pages in points without a `UserUnit` at every PDF version, in files without a PDF/X or PDF/A standard, so readers that ignore `UserUnit` show them at full size.
|
||||
Export As PDF with Use Artboards off also opens the Save PDF dialog, without its Artboards section, and writes one page of the visible art's bounds with the dialog's options (`document.exportPdf {useArtboards: false}`; `crates/ui-egui/src/dialogs/tests_export.rs`, `crates/engine/src/cmd/fileio/tests_pdf.rs`).
|
||||
While Alt (Option on macOS) is held, the Save PDF dialog's Cancel button reads Reset, which puts every option back to the chosen preset's settings, passwords included, and leaves the dialog open; letting the key go shows Cancel again (`ui.dialogReset`). [The help page](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=283) says that holding Alt or Option and clicking Reset returns the options to their defaults. Resetting to the chosen preset's settings, and keeping the preset, path, artboard range and section, are VectorCraft's own rules (`crates/ui-egui/src/dialogs/save_pdf/tests.rs`, `crates/ui-egui/src/dialogs/tests.rs`).
|
||||
`document.exportSelection` run without params (a shortcut) takes the same route after its save panel: a picked PDF opens the Save PDF dialog without its Artboards section, and SVG, the raster formats, EPS, DXF, text and exporter plug-ins with parameters open their options, whose OK writes the selection alone, cropped to it, with the chosen options (`crates/ui-egui/src/dialogs/tests_export_selection.rs`).
|
||||
A `.ai` export with Use Artboards off writes one page of the visible art's bounds without the native document or the editing copy for other apps, with a warning, so the file does not reopen with one artboard in place of the document's; without PDF content it is refused (`crates/engine/src/cmd/fileio/tests_pdfedit.rs`).
|
||||
That page, and an HP-GL plot of the art's bounds, are measured on the art the file draws: non-printing layers the PDF or `.ai` file leaves out do not make it larger, and nor do the non-printing layers, objects at 0% opacity, placed images, clear gradient meshes and unpainted paths a plot leaves out; Export As refuses an HP-GL plot of nothing it draws before the save dialog (`crates/engine/src/cmd/fileio/tests_pdf.rs`, `crates/engine/src/cmd/fileio/tests_hpgl.rs`, `crates/ui-egui/src/dialogs/tests_export.rs`).
|
||||
@@ -2042,7 +2050,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- A Shift-click with the loaded place cursor opens the current file's import options (text, DXF, PDF page or embedded PSD) and OK places it at the click, with Show Import Options on or off and for a cursor loaded by `file.place.queue` ([Place multiple files](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf)). VectorCraft's own rules: a file without such a dialog places as a click does, Cancel leaves the file unplaced, a Shift-drag places at the dragged size, and headless the Shift-click places as a click (`crates/tools/src/place.rs`, `crates/engine/src/tests/place.rs`, `crates/ui-egui/src/tests/place.rs`).
|
||||
- Separations Preview shows placed and embedded raster images on the visible plates, as it shows vector art (#4153): an RGB image's pixels are separated into process inks with the proof setup's intent, a CMYK image shows its own inks, a hidden plate's ink leaves the image, and with one plate visible the image shows that plate's ink as a grey. Raster images carry no spot ink, so a spot plate shown alone shows them as paper; a colorized image shows its color's plates. Emoji and other bitmap glyphs follow the same rule. The plate-filtered pixels and their reduced-size copies are kept apart from the image's own pixels, for each set of visible plates, proof setup and color settings, and with the preview off nothing changes. Evidence: `tests::colorize::separations_preview_shows_an_rgb_images_process_inks`, `separations_preview_shows_a_cmyk_images_own_inks`, `separations_preview_keeps_an_images_pixels_per_plate_set`. Print preview fidelity remains the open gap, so scores and hours are unchanged.
|
||||
- Desktop print transport uses `craft-print` for CUPS and modern Windows. Sheet composition, copies, separations and colour management remain in VectorCraft. The Print dialog's Media list also carries the Japanese papers — JIS B4 257 × 364 mm, JIS B5 182 × 257 mm and JIS B6 128 × 182 mm beside the ISO B4/B5 (250 × 353 and 176 × 250 mm, kept so settings and presets saved before them keep their paper), and はがき 100 × 148 mm, 往復はがき 148 × 200 mm, 封筒 長形3号 120 × 235 mm, 長形4号 90 × 225 mm, 角形2号 240 × 332 mm, 角形3号 216 × 277 mm and 四六判 127 × 188 mm; the JSON id or the dialog label names a paper, any case and spacing (`B5 (JIS)` or `b5jis`) (`crates/pdf/src/print/settings.rs`, `crates/pdf/src/tests/print.rs`). The print-preview and physical-device fidelity gaps remain, so print scores and hours are unchanged.
|
||||
- The Print dialog's Output section has Overprint Black under Convert All Spot Colors to Process, off by default and available with Separations ([Print color separations](https://helpx.adobe.com/illustrator/using/printing-color-separations.html) lists it among the separation options): black art then leaves the inks under it on the other plates (`print.setup {settings: {output: {overprintBlack: true}}}`, kept with the document and in print presets). Solid 100% K or 100% gray fills, strokes and characters (to within half a percent, as Edit › Edit Colors › Overprint Black counts them), and gradients whose every stop (every color point of a freeform gradient) is, overprint; rich, RGB, Lab, spot-linked and lighter blacks knock out, and only the printed copy is marked. These limits are VectorCraft's own rules. Characters set to overprint now also leave the inks below them on printed PDF plates, a type object's own fill in a PDF is drawn with its blending mode, and Edit › Edit Colors › Overprint Black counts a gradient with a stop linked to a spot swatch as a spot black, as it counts a solid one, and a freeform gradient by the color points it draws from. Evidence: `print::overprint_black_keeps_the_inks_under_solid_black_on_separations`, `print::overprint_black_keeps_the_cyan_under_near_and_freeform_blacks_on_postscript_plates`, `print::overprinting_type_leaves_the_inks_below_on_separations`, `print::a_type_objects_own_black_fill_overprints_on_separations`, `tests::print::overprint_black_is_saved_with_the_setup_and_in_presets`, `overprint::tests::a_gradient_with_a_spot_linked_stop_is_black_only_with_spot`, `overprint::tests::a_freeform_gradient_is_black_when_every_point_is`. Print scores and hours are unchanged.
|
||||
- The Print dialog's Output section has Overprint Black under Convert All Spot Colors to Process, off by default and available with Separations ([Print color separations](https://helpx.adobe.com/illustrator/using/printing-color-separations.html) lists it among the separation options): black art then leaves the inks under it on the other plates (`print.setup {settings: {output: {overprintBlack: true}}}`, kept with the document and in print presets). Solid 100% K or 100% gray fills, strokes and characters (to within half a percent, as Edit › Edit Colors › Overprint Black counts them), and gradients whose every stop (every color point of a freeform gradient) is, overprint; rich, RGB, Lab, spot-linked and lighter blacks are not marked, paints already set to overprint keep that setting, and only the printed copy is marked. These limits are VectorCraft's own rules. Characters set to overprint now also leave the inks below them on printed PDF plates, a type object's own fill in a PDF is drawn with its blending mode, and Edit › Edit Colors › Overprint Black counts a gradient with a stop linked to a spot swatch as a spot black, as it counts a solid one, and a freeform gradient by the color points it draws from. On a plate, an overprinting paint that puts none of that plate's ink down is drawn as nothing; on PostScript plates so is up to half a percent of another ink in a color that counts as black, and any other faint ink stays on the plate. Evidence: `print::overprint_black_keeps_the_inks_under_solid_black_on_separations`, `print::overprint_black_keeps_the_cyan_under_near_and_freeform_blacks_on_postscript_plates`, `print::overprinting_paints_keep_their_faint_ink_on_postscript_plates`, `print::overprinting_type_leaves_the_inks_below_on_separations`, `print::a_type_objects_own_black_fill_overprints_on_separations`, `tests::print::overprint_black_is_saved_with_the_setup_and_in_presets`, `overprint::tests::a_gradient_with_a_spot_linked_stop_is_black_only_with_spot`, `overprint::tests::a_freeform_gradient_is_black_when_every_point_is`. Print scores and hours are unchanged.
|
||||
- The Print dialog's General section (and the print preset editor) has a link button after Scale W and H, as the Custom scale has one on [the help page](https://helpx.adobe.com/illustrator/desktop/save-and-export/export-files-to-different-formats/print-documents-in-illustrator.html), where turning it off scales the width and height apart. While it is on, typing either percentage sets the other, and turning it on sets H to W. It is on for new settings, dimmed with the fields unless Scaling is Custom or a tiling choice, toggled with a click, Space or Enter, and named with its on or off state for screen readers. W and H take 1–1000% in the fields. The link is kept with the document's print settings and in print presets (`print.setup {settings: {scale: {linked}}}`); settings saved without it read it as off, so they print as before. Its default, the tiling choices and the agent rules are VectorCraft's own. Evidence: `print::the_scale_link_is_on_for_new_settings_and_off_for_a_saved_scale_without_it`, `tests::print::the_scale_link_keeps_width_and_height_equal`, `tests::print::a_scale_saved_without_the_link_keeps_its_width_and_height`, `dialogs::tests_print::the_scale_link_keeps_scale_width_and_height_equal`, `dialogs::tests_print::a_print_preset_keeps_the_scale_link`. Print scores and hours are unchanged.
|
||||
- A PDF, PDF-compatible `.ai` or `.ait` opened from its pages or its editing copy opens with the File Info that its XMP packet and its document information dictionary give: the title (`dc:title`, its `x-default` item first, else Info `Title`), the author, description, keywords, copyright status, notice and URL, and the created and modified dates, the XMP packet's value where both give one (`crates/pdf/src/tests/file_info.rs`, `crates/engine/src/tests/fileinfo.rs`). An SVG opens with the title of its root `<title>`. The title is File Info's alone (`DocMetadata::title`): the document's name stays the file's name with its extension, a file that gives no title leaves File Info with that name, and exports (PDF, SVG, PNG, EPS, `.ai`) and native saves carry it; changing the title in File Info sets the document's name as before (#3626).
|
||||
- PDF export and PDF-compatible `.ai` and `.ait` saves write the document's File Info created date as the file's creation date, or the time of writing when the document has none, and the time of writing as its modification date; the page information mark still prints the time of writing (`crates/engine/src/tests/fileinfo.rs`, `crates/pdf/src/tests.rs`, `crates/pdf/src/tests/marks.rs`).
|
||||
|
||||
Reference in New Issue
Block a user