mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 08:26:28 +00:00
Type: type on a path takes Justification's Desired spacing and glyph scaling
Each paragraph of type on a path now sets its glyphs at its Desired word spacing, letter spacing and glyph scaling, as point and area type do. The spaced glyphs feed the steps along the path, alignment, the hangs and the overflow, so text after a wider gap starts further along and a right or centered line is aligned by its spaced length. Minimum and Maximum are not used, vertical type is not glyph scaled, and a list marker keeps its width. This changes existing documents: type on a path whose paragraphs carry non-default Desired values now spaces differently and can overflow where it did not. SVG export writes such type as outlines with a warning, since a <textPath> places its characters at their own advances. Docs: docs/mcp.md, docs/type-parity.md, docs/gaps.md, docs/target-app-parity.md.
This commit is contained in:
@@ -292,6 +292,11 @@ impl Writer<'_> {
|
||||
self.warn("type on a path with Tsume is outlined to keep its look");
|
||||
return self.text_outlines(n, t);
|
||||
}
|
||||
// Justification…'s Desired word and letter spacing and glyph scaling do too.
|
||||
if (0..t.paragraph_count()).any(|i| !t.layout_justification(t.para_at(i)).desired_is_default()) {
|
||||
self.warn("type on a path with Justification spacing or glyph scaling is outlined to keep its look");
|
||||
return self.text_outlines(n, t);
|
||||
}
|
||||
// A `<textPath>` holds the characters of the text, not the bullets or numbers drawn
|
||||
// before them.
|
||||
if !lay.markers.is_empty() {
|
||||
|
||||
@@ -670,6 +670,37 @@ fn justification_spacing_and_glyph_scaling_are_drawn_in_place() {
|
||||
}
|
||||
}
|
||||
|
||||
/// Type on a path with Justification…'s Desired word or letter spacing or glyph scaling is outlined
|
||||
/// with a warning, since a `<textPath>` places its characters one after the other at their own
|
||||
/// advances. With the default Desired values it stays a `<textPath>`.
|
||||
#[test]
|
||||
fn justification_spacing_on_a_path_is_outlined() {
|
||||
use vectorcraft_doc::JustificationOptions;
|
||||
let doc = |j: JustificationOptions| {
|
||||
let mut t = TextObject::point(Point::ZERO, "HO HO", style(12.0));
|
||||
t.para.justification = j;
|
||||
let mut line = BezPath::new();
|
||||
line.move_to((20.0, 100.0));
|
||||
line.line_to((280.0, 100.0));
|
||||
t.kind = TextKind::OnPath { path: PathData::from_bezpath(&line), start: 0.0, end: None };
|
||||
let mut d = Document::new(300.0, 200.0);
|
||||
let n = Node::new(d.alloc_id(), NodeKind::Text(Box::new(t)));
|
||||
let l = d.layers[0].id;
|
||||
d.insert(Some(l), 0, n).unwrap();
|
||||
vectorcraft_svg::export_full(&d, &ExportOptions::default(), None)
|
||||
};
|
||||
let out = doc(JustificationOptions::default());
|
||||
assert!(out.svg.contains("<textPath") && out.warnings.is_empty(), "{:?}", out.warnings);
|
||||
for j in [
|
||||
JustificationOptions { word_spacing: [0.0, 200.0, 300.0], ..JustificationOptions::default() },
|
||||
JustificationOptions { letter_spacing: [0.0, 50.0, 50.0], ..JustificationOptions::default() },
|
||||
JustificationOptions { glyph_scaling: [50.0, 150.0, 200.0], ..JustificationOptions::default() },
|
||||
] {
|
||||
let out = doc(j);
|
||||
assert!(!out.svg.contains("<textPath") && out.warnings.iter().any(|w| w.contains("Justification")), "{:?}", out.warnings);
|
||||
}
|
||||
}
|
||||
|
||||
/// Justified and Mojikumi lines whose characters a reader draws where the layout does are written
|
||||
/// as before: a segment per style run, and per word on a justified line.
|
||||
#[test]
|
||||
|
||||
@@ -4,9 +4,10 @@ use super::flow::{list_markers, repeat_mark_glyph};
|
||||
use super::region::in_range;
|
||||
use super::{
|
||||
Affine, ArcPath, BezPath, Ctx, GlyphBend, Justify, LineInfo, ListMarker, ParamCurve, PathAlign, PathData, PathEffect, PathEl, Point, Range,
|
||||
SGlyph, Shape, TextObject, Vec2, style_metrics,
|
||||
SGlyph, Shape, TextObject, Vec2, apply_desired, style_metrics,
|
||||
};
|
||||
use crate::fontdb::PathAlignHeights;
|
||||
use std::collections::HashMap;
|
||||
use unicode_bidi::{BidiClass, BidiInfo};
|
||||
|
||||
/// The distance along type on a path each glyph takes: its advance measured `spacing` points above
|
||||
@@ -425,6 +426,25 @@ fn line_start_repeat(cx: &Ctx<'_>, t: &TextObject, pr: &Range<usize>, glyphs: &m
|
||||
Some((g.byte, c))
|
||||
}
|
||||
|
||||
/// Justification…: paragraph `pi`'s glyphs at its Desired word and letter spacing and glyph scaling
|
||||
/// (vertical type is not glyph scaled), with the Desired Glyph Scaling of each glyph it scales put
|
||||
/// in `scales` by byte offset. Type on a path is one line that is never justified to a width, so
|
||||
/// Minimum and Maximum are not used.
|
||||
fn set_desired(cx: &Ctx<'_>, t: &TextObject, pi: usize, glyphs: &mut [SGlyph], scales: &mut HashMap<usize, f64>) {
|
||||
let flex = apply_desired(glyphs, &t.layout_justification(t.para_at(pi)), !cx.vertical);
|
||||
scales.extend(glyphs.iter().zip(&flex).filter(|(_, f)| f.scale != 1.0).map(|(g, f)| (g.byte, f.scale)));
|
||||
}
|
||||
|
||||
/// Records on the glyph just drawn for `g` the Desired Glyph Scaling it is drawn at (`scales`, by
|
||||
/// byte offset). A list marker's glyphs (no length) share their paragraph's first byte and are not
|
||||
/// scaled.
|
||||
fn record_scale(cx: &mut Ctx<'_>, g: &SGlyph, scales: &HashMap<usize, f64>) {
|
||||
let scale = if g.len > 0 { scales.get(&g.byte).copied() } else { None };
|
||||
if let (Some(scale), Some(out)) = (scale, cx.out.glyphs.last_mut()) {
|
||||
out.scale = scale;
|
||||
}
|
||||
}
|
||||
|
||||
/// Lay type on a path out along `path` (text space), between its brackets.
|
||||
pub(super) fn on_path(cx: &mut Ctx<'_>, paras: &[Range<usize>], t: &TextObject, path: &PathData) {
|
||||
cx.out.on_path = true;
|
||||
@@ -434,11 +454,15 @@ pub(super) fn on_path(cx: &mut Ctx<'_>, paras: &[Range<usize>], t: &TextObject,
|
||||
let mut rtl = None;
|
||||
let mut shaped = Vec::new();
|
||||
let markers = list_markers(t, paras);
|
||||
// The Desired Glyph Scaling each scaled glyph is drawn at, by its byte offset.
|
||||
let mut scales = HashMap::new();
|
||||
for (pi, pr) in paras.iter().enumerate() {
|
||||
let text = cx.text;
|
||||
let bidi = para_bidi_with(text.get(pr.clone()).unwrap_or_default(), para.direction, &cx.char_directions(pr));
|
||||
rtl.get_or_insert(is_rtl(bidi.as_ref()) && !cx.vertical);
|
||||
let mut glyphs = cx.shape_para(pr.clone(), bidi.as_ref(), t.para_at(pi));
|
||||
// Justification…, before anything measures the glyphs along the path.
|
||||
set_desired(cx, t, pi, &mut glyphs, &mut scales);
|
||||
// Bullets and numbers: a list paragraph's text starts after its marker here too, unless
|
||||
// the paragraph continues from the frame before in its thread.
|
||||
if pi > 0 || !t.first_para_continues {
|
||||
@@ -727,6 +751,7 @@ pub(super) fn on_path(cx: &mut Ctx<'_>, paras: &[Range<usize>], t: &TextObject,
|
||||
}
|
||||
let at = cx.out.glyphs.len();
|
||||
cx.emit(g, pre, origin, angle, g.adv, 0);
|
||||
record_scale(cx, g, &scales);
|
||||
let hidden = hide_before_open_path(cx, &ap, lead, at, s + step * 0.5, rise);
|
||||
if !hidden && let Some(mark) = repeat.take_if(|&mut (byte, _)| g.len > 0 && g.byte == byte) {
|
||||
cx.out.repeat_marks.push(mark);
|
||||
|
||||
@@ -64,6 +64,105 @@ fn desired_spacing_and_scaling_apply_to_every_line() {
|
||||
assert!((at(&scaled, 2).advance - space).abs() < 1e-6, "word spaces aren't scaled");
|
||||
}
|
||||
|
||||
/// Type on a straight open path `len` long, from the origin along x.
|
||||
fn on_path(text: &str, len: f64, j: JustificationOptions) -> TextObject {
|
||||
let mut t = point(text, j);
|
||||
let mut line = kurbo::BezPath::new();
|
||||
line.move_to((0.0, 0.0));
|
||||
line.line_to((len, 0.0));
|
||||
t.kind = TextKind::OnPath { path: PathData::from_bezpath(&line), start: 0.0, end: None };
|
||||
t
|
||||
}
|
||||
|
||||
/// Desired values apply to type on a path as to point and area type: word spaces are that share of
|
||||
/// the font's space, letters are followed by that share of a space, and glyphs are drawn that wide,
|
||||
/// and the glyphs after a wider gap start further along the path.
|
||||
#[test]
|
||||
fn type_on_a_path_takes_desired_spacing_and_scaling() {
|
||||
let plain = layout(db(), &on_path("ab cd", 1000.0, JustificationOptions::default()));
|
||||
assert!(plain.on_path && !plain.overflow);
|
||||
let space = at(&plain, 2).advance;
|
||||
let a = at(&plain, 0).advance;
|
||||
assert!(space > 0.0 && a > 0.0);
|
||||
|
||||
let words =
|
||||
layout(db(), &on_path("ab cd", 1000.0, JustificationOptions { word_spacing: [0.0, 200.0, 300.0], ..JustificationOptions::default() }));
|
||||
assert!((at(&words, 2).advance - 2.0 * space).abs() < 1e-6, "a word space at 200%");
|
||||
assert!((at(&words, 1).origin.x - at(&plain, 1).origin.x).abs() < 1e-6, "the glyphs before it stay");
|
||||
assert!((at(&words, 3).origin.x - at(&plain, 3).origin.x - space).abs() < 1e-6, "the glyphs after it start a space later");
|
||||
|
||||
let letters =
|
||||
layout(db(), &on_path("ab cd", 1000.0, JustificationOptions { letter_spacing: [0.0, 50.0, 50.0], ..JustificationOptions::default() }));
|
||||
assert!((at(&letters, 0).advance - (a + 0.5 * space)).abs() < 1e-6, "half a space after a");
|
||||
assert!((at(&letters, 1).advance - at(&plain, 1).advance).abs() < 1e-6, "no letter spacing before a word space");
|
||||
assert!((at(&letters, 4).advance - at(&plain, 4).advance).abs() < 1e-6, "nor after the last letter");
|
||||
|
||||
let scaled =
|
||||
layout(db(), &on_path("ab cd", 1000.0, JustificationOptions { glyph_scaling: [50.0, 150.0, 200.0], ..JustificationOptions::default() }));
|
||||
assert!((at(&scaled, 0).advance - 1.5 * a).abs() < 1e-6, "advance at 150%");
|
||||
assert!((width(at(&scaled, 0)) - 1.5 * width(at(&plain, 0))).abs() < 1e-6, "outline at 150%");
|
||||
assert!((at(&scaled, 0).scale - 1.5).abs() < 1e-9 && at(&scaled, 2).scale == 1.0, "the glyph records its scaling");
|
||||
assert!((at(&scaled, 2).advance - space).abs() < 1e-6, "word spaces aren't scaled");
|
||||
}
|
||||
|
||||
/// A right-aligned line on a path is aligned by its length at the Desired values, and a line that
|
||||
/// fits at 100% word spacing runs past the end of a path it no longer fits.
|
||||
#[test]
|
||||
fn type_on_a_path_is_aligned_and_fitted_at_desired_spacing() {
|
||||
let plain = layout(db(), &on_path("ab cd", 1000.0, JustificationOptions::default()));
|
||||
let space = at(&plain, 2).advance;
|
||||
let end = |l: &TextLayout| at(l, 4).origin.x + at(l, 4).advance;
|
||||
let wide = JustificationOptions { word_spacing: [0.0, 300.0, 300.0], ..JustificationOptions::default() };
|
||||
let mut t = on_path("ab cd", 1000.0, wide.clone());
|
||||
t.para.justify = Justify::Right;
|
||||
let right = layout(db(), &t);
|
||||
assert!((end(&right) - 1000.0).abs() < 1e-6, "the line ends at the path's end: {}", end(&right));
|
||||
let mut t = on_path("ab cd", 1000.0, JustificationOptions::default());
|
||||
t.para.justify = Justify::Right;
|
||||
let right_plain = layout(db(), &t);
|
||||
assert!((at(&right_plain, 0).origin.x - at(&right, 0).origin.x - 2.0 * space).abs() < 1e-6, "it starts two spaces earlier");
|
||||
|
||||
let len = end(&plain) + 0.5 * space;
|
||||
assert!(!layout(db(), &on_path("ab cd", len, JustificationOptions::default())).overflow);
|
||||
let over = layout(db(), &on_path("ab cd", len, wide));
|
||||
assert!(over.overflow, "the wider word space no longer fits");
|
||||
}
|
||||
|
||||
/// Vertical type on a path takes Desired word spacing but is not glyph scaled, as in area type;
|
||||
/// a list marker before the text keeps its width.
|
||||
#[test]
|
||||
fn vertical_type_and_list_markers_on_a_path_are_not_glyph_scaled() {
|
||||
let scaling = JustificationOptions { glyph_scaling: [50.0, 150.0, 200.0], ..JustificationOptions::default() };
|
||||
let vertical = |j: JustificationOptions| {
|
||||
let mut t = on_path("ab cd", 1000.0, j);
|
||||
t.vertical = true;
|
||||
layout(db(), &t)
|
||||
};
|
||||
let plain = vertical(JustificationOptions::default());
|
||||
let scaled = vertical(scaling.clone());
|
||||
assert!((at(&scaled, 0).advance - at(&plain, 0).advance).abs() < 1e-6, "vertical glyphs keep their advance");
|
||||
assert!((width(at(&scaled, 0)) - width(at(&plain, 0))).abs() < 1e-6, "and their outline");
|
||||
let words = vertical(JustificationOptions { word_spacing: [0.0, 200.0, 300.0], ..JustificationOptions::default() });
|
||||
assert!((at(&words, 2).advance - 2.0 * at(&plain, 2).advance).abs() < 1e-6, "a vertical word space at 200%");
|
||||
|
||||
use vectorcraft_doc::text::{Bullet, ParaList};
|
||||
let listed = |j: JustificationOptions| {
|
||||
let mut t = on_path("ab cd", 1000.0, j);
|
||||
t.para.list = Some(ParaList::bulleted(Bullet::Dot));
|
||||
layout(db(), &t)
|
||||
};
|
||||
let (plain, scaled) = (listed(JustificationOptions::default()), listed(scaling));
|
||||
let marker = |l: &TextLayout| -> Vec<f64> {
|
||||
let m = l.markers.first().expect("a list marker");
|
||||
l.glyphs.get(m.glyphs.clone()).unwrap_or_default().iter().map(|g| g.advance * g.scale).collect()
|
||||
};
|
||||
assert!(!marker(&plain).is_empty());
|
||||
assert_eq!(marker(&scaled), marker(&plain), "the marker keeps its width");
|
||||
// The marker's glyphs have the paragraph's first byte too, with no length.
|
||||
let first = |l: &TextLayout| l.glyphs.iter().find(|g| g.byte == 0 && g.len > 0).map_or(0.0, |g| g.advance);
|
||||
assert!(first(&plain) > 0.0 && (first(&scaled) - 1.5 * first(&plain)).abs() < 1e-6, "the text after it is scaled");
|
||||
}
|
||||
|
||||
/// The line's text from a layout, one string per line.
|
||||
fn lines(l: &TextLayout, text: &str) -> Vec<String> {
|
||||
l.lines.iter().map(|li| text.get(li.start..li.end).unwrap_or_default().trim_end().to_string()).collect()
|
||||
|
||||
@@ -420,6 +420,8 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi
|
||||
- **Improved:** hanging punctuation (Roman Hanging Punctuation and Optical Margin Alignment) keeps its published amounts when justification scales glyphs, and Standard burasagari counts a hung line start as room; paragraph-level tests with both composers; estimate unchanged.
|
||||
- **Done:** Paragraph panel menu › Justification… (#2755): word and letter spacing, glyph scaling (Minimum, Desired,
|
||||
Maximum), Auto Leading and Single Word Justification per paragraph, used by both composers; estimate unchanged.
|
||||
- **Done:** type on a path takes each paragraph's Justification… Desired word spacing, letter spacing and glyph
|
||||
scaling, as point and area type do; estimate unchanged.
|
||||
- **Done:** a paragraph's Auto Leading also sets the Leading the Character panel shows for Auto type, the leading the
|
||||
Alt+↑/↓ nudge steps from and the lines Fill with Placeholder Text counts; estimate unchanged.
|
||||
- **Missing:** CJK vertical
|
||||
|
||||
+1
-1
@@ -9703,7 +9703,7 @@ paragraphs a `start` / `end` range touches), in percent:
|
||||
|
||||
The options are saved with the paragraph (`justification` in `para`) only when they differ from the defaults, and
|
||||
paragraph styles carry them (`paraStyle.new {attrs: {justification: {auto_leading: 150}}}`). Vertical type isn't glyph
|
||||
scaled, and type on a path doesn't use them. One undo step. `ui.justification` opens the Justification dialog on the
|
||||
scaled. Type on a path takes the Desired values and does not use Minimum or Maximum. One undo step. `ui.justification` opens the Justification dialog on the
|
||||
values the Paragraph panel shows, with Preview; OK sends the values that changed.
|
||||
|
||||
```json
|
||||
|
||||
@@ -738,6 +738,7 @@ since 2026-10-01.
|
||||
- **Text styles redefined to the defaults:** New and Redefine Character Style and Paragraph Style capture every attribute of the selected text, including those at their defaults (Auto kerning, Roman baseline alignment, the default Hyphenation options, the Every-line Composer, no tab stops), and `charStyle.setAttrs` and `paraStyle.setAttrs` keep an attribute set to its default value. After a redefinition, text whose value still equals the old definition's takes the new value, a default included; local overrides stay, and text that still has the old value of an attribute the new definition leaves out goes back to the Normal style's value. The style panels show "+" only where the text differs from its style, including type with Auto alignment. Public reference: [Character and paragraph styles](https://web.archive.org/web/20260825113735/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
- **Text styles dragged onto the panel's buttons:** a style dragged from the Character Styles or Paragraph Styles panel onto Create New Style is copied (`charStyle.duplicate`, `paraStyle.duplicate`, which name the copy `<name> copy`) and the copy is highlighted; dragged onto Delete it is deleted (`charStyle.delete`, `paraStyle.delete`); the Normal style is not deleted. Each drop is one undo step. Public reference: [Character and paragraph styles](https://web.archive.org/web/20261015081534/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
- **Auto Leading outside the layout:** a paragraph's Justification… › Auto Leading (<https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>) also sets the Leading the Character panel shows for Auto type (blank where the selected paragraphs differ), the leading the Alt+↑/↓ nudge (`type.step`) steps from, each paragraph's own, and the lines Fill with Placeholder Text counts in area type. Evidence: `ParaStyle::effective_leading` (`crates/doc/src/text.rs` test `paragraph_effective_leading_follows_auto_leading`), `tests_prefs::auto_leading_steps_and_fills_from_the_paragraph_auto_leading`, `panels::character` test `leading_field_shows_the_paragraph_auto_leading`.
|
||||
- **Justification… on type on a path:** each paragraph's Desired Word Spacing, Letter Spacing and Glyph Scaling set its glyphs on type on a path as on point and area type, so the text after a wider gap starts further along the path, alignment and overflow use the spaced length, and a list marker keeps its width. Minimum and Maximum are not used on a path, and vertical type is not glyph scaled. SVG export writes such type as outlines with a warning. Tests `tests::justify::type_on_a_path_takes_desired_spacing_and_scaling`, `type_on_a_path_is_aligned_and_fitted_at_desired_spacing`, `vertical_type_and_list_markers_on_a_path_are_not_glyph_scaled` and the SVG test `text_layout::justification_spacing_on_a_path_is_outlined`. Public reference: the help page (<https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
|
||||
- **Letter spacing and Full Justify between shaped clusters:** Desired Letter Spacing on any line, the letter spacing range of a justified line, and Single Word Justification's Full Justify add space only between shaped clusters, in horizontal, right-to-left and vertical type, so a combining mark stays on its letter and a Devanagari syllable's glyphs stay together. They add no space next to a zero-width format control (a soft hyphen, a bidi mark, embedding, override or isolate, a zero-width space, a joiner or non-joiner, a word joiner, a variation selector, a tag, the byte order mark), so a word wrapped in an override still reaches both edges of a justified line, and a Kinsoku push-in counts no gap at one either. A zero-width space is a line break opportunity but not a word separator ([CSS Text Level 3](https://www.w3.org/TR/css-text-3/#word-separator) does not list it), so a justified line gives it no share of its room. Desired Letter Spacing between the letters on either side of a zero-width space goes after the zero-width space, so a line that breaks there ends at its last letter, and the line breaker does not measure a gap after it. A line that Full Justify spreads and that ends in a drawn hyphen puts the same gap between its last letter and the hyphen. The cluster boundary is VectorCraft's own rule, based on the typographic character unit of [CSS Text Level 3](https://www.w3.org/TR/css-text-3/#typographic-character-unit). Tests `tests::justify::single_word_full_justify_keeps_combining_mark_with_base`, `desired_and_fitted_letter_spacing_skip_shaped_cluster`, `rtl_single_word_cluster_gap_follows_drawn_order`, `vertical_single_word_cluster_gap_follows_drawn_order`, `single_word_full_justify_keeps_conjunct_cluster`, `desired_letter_spacing_skips_bidi_format_controls`, `letter_spacing_and_full_justify_skip_joiners_and_soft_hyphens`, `format_controls_are_the_zero_width_default_ignorables`, `zero_width_space_takes_no_word_space_room`, `desired_letter_spacing_ends_a_line_broken_at_a_zero_width_space_without_a_gap`, `single_word_full_justify_spreads_up_to_the_drawn_hyphen` and `layout::wrapping_tests::kinsoku_shori_type_counts_no_gap_at_a_format_control`. Public reference: the help page (<https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
|
||||
- **Justified lines with tabs:** a tab is not a word space, so a justified area type line no longer gives it a share of its room that no glyph draws. On a justified line with a tab, the text up to the last tab keeps its spacing, each tab keeps its stop and its leader stays in its gap, and the text after the last tab takes the room (word spaces first, then letter spacing, glyph scaling and the gaps between its letters), so the line ends on the far edge. A tab separates two words, so Single Word Justification does not align a word-tab-word line. Right-to-left lines take the text drawn after the last tab drawn, and vertical lines work down the column. Spreading the room after the last tab is VectorCraft's own rule. Tests `tests::justify::a_justified_line_with_a_tab_spreads_the_text_after_it_to_the_edge`, `a_justified_tab_keeps_its_leader_inside_its_gap`, `a_justified_word_tab_word_line_reaches_the_edge`, `the_last_line_with_a_tab_fills_the_measure_only_with_justify_all`, `a_justified_line_takes_its_room_after_its_last_tab`, `a_justified_vertical_line_with_a_tab_reaches_the_end_of_its_column`, `a_justified_right_to_left_line_with_a_tab_spans_its_measure` and `justified_point_type_with_a_tab_keeps_its_width`. Public reference: the help pages (<https://helpx.adobe.com/illustrator/using/formatting-paragraphs.html>, <https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/adjust-word-and-letterspacing-in-justified-text.html>).
|
||||
- **The text style panel menus' Duplicate and Delete:** in the Character Styles and Paragraph Styles panel menus, Duplicate highlights the copy, as Create New Style highlights the new style, and Delete leaves no style highlighted, as the Delete button does, so Duplicate, Clear Overrides, Redefine and Style Options are disabled until another style is clicked. A highlighted style that is renamed in Style Options or deleted by a command is no longer highlighted either. The tests `panels::text_styles::tests::panel_menu_duplicate_and_delete_update_the_highlighted_style` and `a_highlighted_style_that_is_no_longer_listed_is_not_highlighted` cover this. Public reference: [Character and paragraph styles](https://web.archive.org/web/20261015081534/https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html).
|
||||
|
||||
+2
-2
@@ -46,9 +46,9 @@ against Illustrator's public documentation; **estimated** unless noted.
|
||||
| System Layout | done | Character panel menu › System Layout, `type.systemLayout`: the whole document, off by default and for documents from before it, saved only when on. On, every text object advances by whole points (at least one when a character takes space). New point, area and path type, threaded frames, placed text, graph and dimension labels and pasted plain text inherit it. Evidence: `tests::system_layout_rounds_positive_advances_to_whole_points`, `typecmd::area_tests::system_layout_sets_the_document_and_every_text_object`, `panels::character::tests::system_layout_menu_item_toggles_the_document` |
|
||||
| Fractional Widths | done | Character panel menu › Fractional Widths, `type.fractionalWidths`: per type object, and every frame of its threads. On by default and for documents from before it; saved only when off. Off, each character that takes space advances by a whole number of points, at least one, so small type does not run together. Evidence: `tests::fractional_widths_off_rounds_positive_advances_to_whole_points`, `typecmd::area_tests::fractional_widths_is_set_per_object_and_saved_only_when_off`, `panels::character::tests::fractional_widths_menu_item_toggles_the_type_object` |
|
||||
| Roman Hanging Punctuation | done | Paragraph panel menu › Roman Hanging Punctuation, `text.setFormat {romanHangingPunctuation}` (#2756): per paragraph, Optical Margin Alignment's punctuation and amounts without the letters; paragraph styles carry it. Evidence: `tests::roman_hanging_punctuation_hangs_punctuation_but_not_letters`, `typecmd::area_tests::roman_hanging_punctuation_is_set_per_paragraph_and_saved_only_when_on`. Whole paragraphs hang as published with both composers, ragged, centred and justified, with Line-end Punctuation Half Width and bidirectional lines; Justification's Glyph Scaling leaves the hung marks at their width, and Standard burasagari counts what hangs at a line's start as room before hanging a comma (`tests_hang`) |
|
||||
| Hyphenation… and Justification… options | done | Eleven Indian languages use attributed patterns and preserve syllables in both composers (#4947). Hyphenation… (`ui.hyphenation`, `text.setFormat`) sets each paragraph's Words Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone (Single-line Composer only) and Hyphenate Capitalized Words, and paragraph styles carry them (#2310). Justification… (`ui.justification`, `text.setFormat`, #2755) sets Word Spacing, Letter Spacing and Glyph Scaling (Minimum, Desired, Maximum), Auto Leading and Single Word Justification; Desired applies to every line, justified lines and the Every-line Composer use the ranges. Vertical type isn't glyph scaled; type on a path doesn't use them. Evidence: `crates/text/src/tests/justify.rs`, `dialogs::justification::tests` |
|
||||
| Hyphenation… and Justification… options | done | Eleven Indian languages use attributed patterns and preserve syllables in both composers (#4947). Hyphenation… (`ui.hyphenation`, `text.setFormat`) sets each paragraph's Words Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone (Single-line Composer only) and Hyphenate Capitalized Words, and paragraph styles carry them (#2310). Justification… (`ui.justification`, `text.setFormat`, #2755) sets Word Spacing, Letter Spacing and Glyph Scaling (Minimum, Desired, Maximum), Auto Leading and Single Word Justification; Desired applies to every line, justified lines and the Every-line Composer use the ranges. Vertical type isn't glyph scaled. Evidence: `crates/text/src/tests/justify.rs`, `dialogs::justification::tests` |
|
||||
| Roman Hanging Punctuation | done | Paragraph panel menu › Roman Hanging Punctuation, `text.setFormat {romanHangingPunctuation}` (#2756): per paragraph, Optical Margin Alignment's punctuation and amounts without the letters; paragraph styles carry it. Evidence: `tests::roman_hanging_punctuation_hangs_punctuation_but_not_letters`, `typecmd::area_tests::roman_hanging_punctuation_is_set_per_paragraph_and_saved_only_when_on` |
|
||||
| Hyphenation… and Justification… options | done | Eleven Indian languages use attributed patterns and preserve syllables in both composers (#4947). Hyphenation… (`ui.hyphenation`, `text.setFormat`) sets each paragraph's Words Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone (Single-line Composer only) and Hyphenate Capitalized Words, and paragraph styles carry them (#2310). Justification… (`ui.justification`, `text.setFormat`, #2755) sets Word Spacing, Letter Spacing and Glyph Scaling (Minimum, Desired, Maximum), Auto Leading and Single Word Justification; Desired applies to every line, justified lines and the Every-line Composer use the ranges. Vertical type isn't glyph scaled; type on a path doesn't use them. Auto Leading also sets the Leading the Character panel shows for Auto type, the leading Alt+↑/↓ (`type.step`) steps from, per paragraph, and the lines Fill with Placeholder Text counts. Evidence: `crates/text/src/tests/justify.rs`, `dialogs::justification::tests`, `tests_prefs::auto_leading_steps_and_fills_from_the_paragraph_auto_leading`, `panels::character` test `leading_field_shows_the_paragraph_auto_leading` |
|
||||
| Hyphenation… and Justification… options | done | Eleven Indian languages use attributed patterns and preserve syllables in both composers (#4947). Hyphenation… (`ui.hyphenation`, `text.setFormat`) sets each paragraph's Words Longer Than, After First, Before Last, Hyphen Limit, Hyphenation Zone (Single-line Composer only) and Hyphenate Capitalized Words, and paragraph styles carry them (#2310). Justification… (`ui.justification`, `text.setFormat`, #2755) sets Word Spacing, Letter Spacing and Glyph Scaling (Minimum, Desired, Maximum), Auto Leading and Single Word Justification; Desired applies to every line, justified lines and the Every-line Composer use the ranges. Vertical type isn't glyph scaled. Auto Leading also sets the Leading the Character panel shows for Auto type, the leading Alt+↑/↓ (`type.step`) steps from, per paragraph, and the lines Fill with Placeholder Text counts. Evidence: `crates/text/src/tests/justify.rs`, `dialogs::justification::tests`, `tests_prefs::auto_leading_steps_and_fills_from_the_paragraph_auto_leading`, `panels::character` test `leading_field_shows_the_paragraph_auto_leading` |
|
||||
| Tab stops and leaders; Tabs panel | partial | Tabs panel and stops with leaders in the model (`text.tabs.set`); a stop drags from where the press landed (#1458); leaders fill the tab's gap, repeated on a grid so they line up from line to line (#1877); Ctrl-dragging a stop (Command on macOS) moves all the stops together; in right-aligned area type the text before a line's last tab sits at its stops, from the left edge, and the text after it against the right edge, as Illustrator's own layout in a user's `.ai` sets a price list (evidence: `tests::right_aligned_area_type_sets_the_text_after_its_last_tab_against_the_edge`; centred lines are still aligned as a whole); in justified area type the text up to a line's last tab keeps its spacing and its tabs their stops, and the text after the last tab takes the line's room to the far edge, VectorCraft's own rule (evidence: `tests::justify::a_justified_line_with_a_tab_spreads_the_text_after_it_to_the_edge` and the other tab tests in `crates/text/src/tests/justify.rs`) |
|
||||
| Hidden characters (Show Hidden Characters) | done | `type.hiddenCharacters` |
|
||||
| Spell check (Check Spelling, Auto Spell Check, custom dictionary) | done | the engine (#4936): `text.spelling.check` lists the unknown words of the document's type, each run in its Language, at the bytes `text.editRange` changes, and `text.spelling.suggest` gives suggestions, both from craft-proof, each paragraph on its own (English from the first dictionary it finds: a Hunspell dictionary in the user's dictionaries folder, the SCOWL dictionary built in from craft-i18n, a system Hunspell dictionary, and last the public-domain Moby word list built into it; other languages from the dictionaries craft-proof finds for them). The custom dictionary commands are done: `text.spelling.addWord`, `removeWord` and `changeWord` (Add, and Edit Custom Dictionary's Add, Delete and Change), and `text.spelling.dictionary` lists the words, saved to `Custom Dictionary.txt` beside the preferences; Ignore All: `text.spelling.ignoreAll` skips a word in the active document while it is open. Auto Spell Check is done: Edit › Spelling › Auto Spell Check (`edit.autoSpellCheck`, off at first, saved with the view settings) draws a red wavy line under the unknown words of the visible type, leaves out type with effects, and follows edits, the custom dictionary and Ignore All. A right-click on an underlined word lists the words its dictionary suggests (each replaces it in one undo step, `text.editRange`), or No Suggestions, then Ignore All and Add to Dictionary, and a right-click on type has Spelling › Auto Spell Check, checked while it is on. Edit › Edit Custom Dictionary… lists the custom dictionary's words, with an Entry field and Add, Delete and Change, applied on Done (Cancel leaves the dictionary as it was). The modal Check Spelling dialog is done: Edit › Spelling › Check Spelling… (`Cmd+I`, `ui.checkSpelling`) opens a modal dialog displaying the unrecognized word in sentence context ("Not in Dictionary"), a list of suggestions with double-click or selection to replace ("Change to" field), and action buttons: Ignore, Ignore All, Change (one-step Undo/Redo via `text.editRange`), Change All (batched across occurrences in a single undo step), Add to Dictionary (`text.spelling.addWord`), Done and Cancel, with keyboard navigation (Tab between controls, Enter to Change or Done, Escape to close). Evidence: `crates/engine/src/tests/spelling.rs`, `crates/ui-egui/src/canvas/tests.rs` (`auto_spell_check_*`), `crates/ui-egui/src/tests/contextmenu.rs` (the right-click), `crates/ui-egui/src/dialogs/custom_dictionary.rs` (the dialog), `crates/ui-egui/src/dialogs/check_spelling.rs` (the Check Spelling dialog). |
|
||||
|
||||
Reference in New Issue
Block a user