Merge pull request #8869 from dotCooCoo/feat/opentype-proportional-metrics

OpenType: Proportional Metrics in the panel menu with the East Asian options
This commit is contained in:
BFlat authored and GitHub committed 2026-11-25 19:31:15 +07:00
commit e68ef201c9
4 files changed
+249 -12

No files matched your search

+243 -11
View File
@@ -1,7 +1,8 @@
//! OpenType panel: per-character OpenType features (ligatures, alternates, swashes, small caps,
//! ordinals, fractions, figure style, position, stylistic sets from the panel or its menu, and with
//! the East Asian options the menu's H or V Style and Roman Italics) for the selected text (every
//! frame of each selected threaded story) or the Type tool's selected characters.
//! the East Asian options the menu's Proportional Metrics, H or V Style and Roman Italics) for the
//! selected text (every frame of each selected threaded story) or the Type tool's selected
//! characters.
use craft::behavior::Mixed;
use craft::keymap::CommandRef;
@@ -25,6 +26,8 @@ use crate::VectorcraftApp;
const RESET: &str = "ui.openType.reset";
/// The panel menu's feature toggles, run with `{tag}`.
const TOGGLE: &str = "ui.openType.toggle";
/// The panel menu's Proportional Metrics item, with Show East Asian Options.
const METRICS: &str = "ui.openType.proportionalMetrics";
/// The feature a checkbox row toggles: a named flag, or a tag of [`EXTRA_FEATURES`].
#[derive(Clone, Copy)]
@@ -138,21 +141,33 @@ fn shown_figure(app: &VectorcraftApp) -> Option<usize> {
/// Whether `flag` is on for every character a toggle changes (`Some(true)`), for none of them
/// (`Some(false)`), or only for some (`None`). At a Type tool caret, and after Select All in a
/// threaded story, the command styles all the text ([`run_features`]), so every character of it
/// counts, as in [`edit`].
/// counts, as in [`edit`]. There, and with the Selection tool, a run with no text (an empty
/// frame's) counts only when no run has text.
fn shown_flag(app: &VectorcraftApp, flag: Flag) -> Option<bool> {
let on = |s: &CharStyle| flag.get(&OtFeatures::from_tags(s.features.iter().map(String::as_str)));
if let Some(mut runs) = whole_text_runs(app) {
shown(app, |s| flag.get(&OtFeatures::from_tags(s.features.iter().map(String::as_str))))
}
/// Whether `on` holds for every character a menu item changes (`Some(true)`), for none of them
/// (`Some(false)`), or only for some (`None`), read as [`shown_flag`] reads a feature.
fn shown(app: &VectorcraftApp, on: impl Fn(&CharStyle) -> bool) -> Option<bool> {
let runs = match whole_text_runs(app) {
Some(runs) => Some(runs),
// With the Selection tool: every run of every frame of the selected stories.
None if text_editing(app).is_none() => Some(super::character::selected_story_texts(app).into_iter().flat_map(|t| t.runs.iter()).collect()),
None => None,
};
if let Some(mut runs) = runs {
// A run with no text, such as an empty frame's, counts only when no run has text.
if runs.iter().any(|r| !r.text.is_empty()) {
runs.retain(|r| !r.text.is_empty());
}
let Some(first) = runs.first() else {
return shared(app, on);
return shared(app, &on);
};
let v = on(&first.style);
return runs.iter().all(|r| on(&r.style) == v).then_some(v);
}
shared(app, on)
shared(app, &on)
}
/// The runs the panel's commands style as a whole while the Type tool edits text: those of every
@@ -376,8 +391,8 @@ fn toggle_ref(tag: &str) -> CommandRef {
}
/// The panel menu's rows: Reset, the Stylistic Sets submenu while the font offers sets, and with
/// Show East Asian Options the two East Asian items. `PanelRow::Submenu` has no disabled state, so
/// the submenu is absent while the font offers no sets.
/// Show East Asian Options Proportional Metrics and the two East Asian items. `PanelRow::Submenu`
/// has no disabled state, so the submenu is absent while the font offers no sets.
pub(crate) fn menu_rows(app: &VectorcraftApp) -> Vec<PanelRow> {
let mut rows = vec![PanelRow::Command(CommandRef::new(RESET))];
let sets: Vec<PanelRow> = text_style(app)
@@ -392,6 +407,7 @@ pub(crate) fn menu_rows(app: &VectorcraftApp) -> Vec<PanelRow> {
}
if app.session.prefs.show_east_asian_options {
rows.push(PanelRow::Separator);
rows.push(PanelRow::Command(CommandRef::new(METRICS)));
rows.extend(east_asian_items().into_iter().filter_map(|(_, flag)| flag.tag()).map(|tag| PanelRow::Command(toggle_ref(tag))));
}
rows
@@ -410,6 +426,10 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) {
}
}
if app.session.prefs.show_east_asian_options {
// Proportional Metrics: full-width glyphs on the font's proportional widths (`palt`, `vpal`),
// the character attribute the Character panel menu's item sets.
let on = shown(app, |s| s.proportional_metrics) == Some(true);
states.set(CommandRef::new(METRICS), CommandState::new().title(tl!("Proportional Metrics")).checked(on).enabled(has));
for (label, flag) in east_asian_items() {
if let Some(tag) = flag.tag() {
let on = shown_flag(app, flag) == Some(true);
@@ -419,8 +439,9 @@ pub(crate) fn menu_states(app: &VectorcraftApp, states: &mut CommandStates) {
}
}
/// The panel menu's commands: `ui.openType.reset` and `ui.openType.toggle {tag}`. A set chosen
/// while only some characters have it turns it on for all of them.
/// The panel menu's commands: `ui.openType.reset`, `ui.openType.toggle {tag}` and
/// `ui.openType.proportionalMetrics`. A set or item chosen while only some characters have it
/// turns it on for all of them.
pub(crate) fn run(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result<Value, String>> {
Some(match id {
RESET => {
@@ -428,15 +449,32 @@ pub(crate) fn run(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Resul
Ok(json!({}))
}
TOGGLE => toggle(app, p),
METRICS => proportional_metrics(app),
_ => return None,
})
}
/// `ui.openType.proportionalMetrics`: turn the `proportionalMetrics` character attribute off when
/// every character the item changes has it, else on, through the Character panel's format route
/// ([`super::character::run_format`]). With no type it changes nothing.
fn proportional_metrics(app: &mut VectorcraftApp) -> Result<Value, String> {
// The typing Real-time Drawing off left unapplied is applied before the text is read.
super::character::text_editing_kept(app)?;
if text_style(app).is_none() {
return Err(format!("{METRICS} is not available now"));
}
let on = shown(app, |s| s.proportional_metrics) == Some(true);
super::character::run_format(app, json!({ "proportionalMetrics": !on }))?;
Ok(json!({ "on": !on }))
}
/// `ui.openType.toggle {tag}`: turn the feature off when every character has it, else on.
fn toggle(app: &mut VectorcraftApp, p: &Value) -> Result<Value, String> {
let tag = p.get("tag").and_then(Value::as_str).ok_or("`tag` must be an OpenType feature tag")?;
let tag = EXTRA_FEATURES.iter().copied().find(|t| *t == tag).ok_or_else(|| format!("`{tag}` is not an OpenType feature the panel sets"))?;
let flag = Flag::Extra(tag);
// The typing Real-time Drawing off left unapplied is applied before the text is read.
super::character::text_editing_kept(app)?;
let on = shown_flag(app, flag) == Some(true);
edit(app, Change::Toggle(flag, !on));
Ok(json!({ "tag": tag, "on": !on }))
@@ -914,4 +952,198 @@ mod tests {
assert!(runs.iter().all(|(_, f)| !f.as_array().is_some_and(|f| f.iter().any(|x| x == tag))), "{label}: {runs:?}");
}
}
/// The text, Proportional Metrics and features of each run of `id`.
fn metrics_runs(app: &VectorcraftApp, id: &Value) -> Vec<(String, bool, Vec<String>)> {
let Some(id) = id.as_u64() else { panic!("no id: {id}") };
match &app.session.active().unwrap().doc.node(NodeId(id)).unwrap().kind {
NodeKind::Text(t) => t.runs.iter().map(|r| (r.text.clone(), r.style.proportional_metrics, r.style.features.clone())).collect(),
_ => panic!("not text"),
}
}
/// Where the panel menu's top-level rows list the command `r`.
fn row_index(rows: &[PanelRow], r: &CommandRef) -> Option<usize> {
rows.iter().position(|row| matches!(row, PanelRow::Command(c) if c == r))
}
/// Proportional Metrics is in the panel menu with the East Asian options only, before H or V
/// Style, and with no type selected it is disabled: run, it changes nothing.
#[test]
fn proportional_metrics_shows_with_the_east_asian_options() {
let mut app = selected_text();
let metrics = CommandRef::new(METRICS);
assert_eq!(row_index(&menu_rows(&app), &metrics), None);
app.session.prefs.show_east_asian_options = true;
let rows = menu_rows(&app);
let (Some(at), Some(kana)) = (row_index(&rows, &metrics), row_index(&rows, &toggle_ref("hkna"))) else { panic!("rows missing") };
assert!(at < kana, "Proportional Metrics comes before H or V Style");
assert_eq!(state_of(&app, &metrics), Some(toggled("Proportional Metrics", false)));
app.session.execute("select.set", &json!({"ids": []})).unwrap();
assert_eq!(state_of(&app, &metrics), Some(CommandState::new().title("Proportional Metrics").checked(false).enabled(false)));
let undo = undo_steps(&app);
assert!(matches!(run(&mut app, METRICS, &json!({})), Some(Err(_))));
assert_eq!(undo_steps(&app), undo, "no text: nothing changes");
}
/// With the Type tool's characters only partly set, Proportional Metrics shows unchecked; run,
/// it turns on for every selected character in one undo step, each run keeping its features,
/// and shows checked; run again, it turns off in one undo step.
#[test]
fn proportional_metrics_turns_on_and_off_for_a_mixed_range() {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.session.prefs.show_east_asian_options = true;
app.session.execute("file.new", &json!({"width": 300, "height": 200})).unwrap();
app.session.select_tool("type", Default::default()).unwrap();
let id = app.session.execute("text.create", &json!({"x": 10, "y": 40, "text": "かなAB"})).unwrap()["id"].clone();
let first = json!({"id": id, "start": 0, "end": 3, "features": ["smcp"], "proportionalMetrics": true});
app.session.execute("text.setRangeStyle", &first).unwrap();
app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap();
// "かなAB" is 8 bytes.
app.session.set_tool_option("select", &json!({"start": 0, "end": 8}));
let metrics = CommandRef::new(METRICS);
assert_eq!(state_of(&app, &metrics), Some(toggled("Proportional Metrics", false)));
let undo = undo_steps(&app);
assert_eq!(run(&mut app, METRICS, &json!({})), Some(Ok(json!({"on": true}))));
assert_eq!(undo_steps(&app), undo + 1);
let runs = metrics_runs(&app, &id);
assert!(runs.iter().all(|(_, on, _)| *on), "{runs:?}");
assert_eq!(runs.iter().map(|(t, _, f)| (t.as_str(), f.clone())).collect::<Vec<_>>(), [("か", vec!["smcp".to_string()]), ("なAB", vec![])]);
assert_eq!(state_of(&app, &metrics), Some(toggled("Proportional Metrics", true)));
assert_eq!(run(&mut app, METRICS, &json!({})), Some(Ok(json!({"on": false}))));
assert_eq!(undo_steps(&app), undo + 2);
let runs = metrics_runs(&app, &id);
assert!(runs.iter().all(|(_, on, f)| !*on && (f.is_empty() || *f == ["smcp"])), "{runs:?}");
}
/// With the Selection tool, Proportional Metrics turns on for the whole selected object. At a
/// Type tool caret after a character that has it while the rest of the text does not, the item
/// reads every character the command styles at a caret (all of them): it shows unchecked, and
/// running it turns it on for the whole text.
#[test]
fn proportional_metrics_reaches_a_selected_object_and_the_text_at_a_caret() {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.session.prefs.show_east_asian_options = true;
app.session.execute("file.new", &json!({"width": 100, "height": 100})).unwrap();
let id = app.session.execute("text.create", &json!({"x": 10, "y": 40, "text": "かなAB"})).unwrap()["id"].clone();
app.session.execute("select.set", &json!({"ids": [id]})).unwrap();
run(&mut app, METRICS, &json!({})).unwrap().unwrap();
assert!(metrics_runs(&app, &id).iter().all(|(_, on, _)| *on), "{:?}", metrics_runs(&app, &id));
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.session.prefs.show_east_asian_options = true;
app.session.execute("file.new", &json!({"width": 300, "height": 200})).unwrap();
app.session.select_tool("type", Default::default()).unwrap();
let id = app.session.execute("text.create", &json!({"x": 10, "y": 40, "text": "かなAB"})).unwrap()["id"].clone();
app.session.execute("text.setRangeStyle", &json!({"id": id, "start": 0, "end": 3, "proportionalMetrics": true})).unwrap();
app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap();
// The caret after "か", whose style the next typed character takes.
app.session.set_tool_option("select", &json!({"start": 3, "end": 3}));
assert_eq!(text_editing(&app).map(|(_, a, b)| (a, b)), Some((3, 3)));
assert_eq!(state_of(&app, &CommandRef::new(METRICS)), Some(toggled("Proportional Metrics", false)));
run(&mut app, METRICS, &json!({})).unwrap().unwrap();
let runs = metrics_runs(&app, &id);
assert!(runs.iter().all(|(_, on, _)| *on), "{runs:?}");
}
/// With Real-time Drawing off, Proportional Metrics and H or V Style decide from the text with
/// the typing applied: after a Backspace not yet applied takes out the one character without
/// the setting, the rest has it, so running the item turns it off.
#[test]
fn east_asian_items_decide_from_the_text_with_the_typing_applied() {
type Get = fn(&CharStyle) -> bool;
let items: [(&str, &str, Value, Value, Get); 2] = [
("Proportional Metrics", METRICS, json!({}), json!({"proportionalMetrics": true}), |s| s.proportional_metrics),
("H or V Style", TOGGLE, json!({"tag": "hkna"}), json!({"features": ["hkna"]}), |s| s.features.iter().any(|f| f == "hkna")),
];
for (label, cmd, params, set, get) in items {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.session.prefs.show_east_asian_options = true;
app.run("file.new", json!({"width": 300, "height": 200})).unwrap();
app.session.execute("prefs.set", &json!({"key": "realTimeDrawing", "value": false})).unwrap();
let id = app.run("text.create", json!({"x": 20, "y": 50, "text": "aか", "size": 12})).unwrap()["id"].clone();
let mut range = set.clone();
range["id"] = id.clone();
range["start"] = json!(1);
range["end"] = json!(4);
app.run("text.setRangeStyle", range).unwrap();
app.run("select.set", json!({"ids": [id.clone()]})).unwrap();
app.select_tool("type");
app.session.apply_actions(vec![vectorcraft_tools::Action::Notify("text.editNew".into())]).unwrap();
app.session.set_tool_option("select", &json!({"start": 1, "end": 1}));
let mut app = crate::testing::windowed(app);
let ctx = app.ui_ctx.clone().unwrap();
let backspace =
|pressed| egui::Event::Key { key: egui::Key::Backspace, physical_key: None, pressed, repeat: false, modifiers: Default::default() };
// The keymap builds in the first pass.
crate::tests::synthetic::key_frame(&mut app, &ctx, vec![]);
crate::tests::synthetic::key_frame(&mut app, &ctx, vec![backspace(true), backspace(false)]);
assert_eq!(app.session.tool_options()["typing"], json!(true), "{label}");
let node = |app: &VectorcraftApp| match &app.session.active().unwrap().doc.node(NodeId(id.as_u64().unwrap())).unwrap().kind {
NodeKind::Text(t) => (t.plain_text(), t.runs.iter().map(|r| get(&r.style)).collect::<Vec<_>>()),
_ => panic!("text"),
};
assert_eq!(node(&app).0, "aか", "{label}: the Backspace is not applied yet");
run(&mut app, cmd, &params).unwrap().unwrap();
assert_eq!(node(&app), ("か".to_string(), vec![false]), "{label}");
}
}
/// With the Selection tool on a threaded story whose second frame is empty, the East Asian
/// items read only the characters: with the text set and the empty frame's run not, each item
/// shows checked, and running it turns the setting off for the text.
#[test]
fn east_asian_items_skip_an_empty_frame_of_a_selected_story() {
type Set = fn(&mut CharStyle, bool);
type Get = fn(&CharStyle) -> bool;
let items: [(&str, CommandRef, &str, Value, Set, Get); 3] = [
("Proportional Metrics", CommandRef::new(METRICS), METRICS, json!({}), |s, on| s.proportional_metrics = on, |s| s.proportional_metrics),
(
"H or V Style",
toggle_ref("hkna"),
TOGGLE,
json!({"tag": "hkna"}),
|s, on| s.features = if on { vec!["hkna".into()] } else { vec![] },
|s| s.features.iter().any(|f| f == "hkna"),
),
(
"Roman Italics",
toggle_ref("ital"),
TOGGLE,
json!({"tag": "ital"}),
|s, on| s.features = if on { vec!["ital".into()] } else { vec![] },
|s| s.features.iter().any(|f| f == "ital"),
),
];
for (label, item, cmd, params, set, get) in items {
let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default());
app.session.prefs.show_east_asian_options = true;
app.run("file.new", json!({"width": 600, "height": 300})).unwrap();
let area = json!({"x": 10, "y": 10, "text": "かなAB", "size": 12, "area": {"width": 150, "height": 60}});
let a = app.run("text.create", area).unwrap()["id"].as_u64().unwrap();
let b = app.run("shape.rectangle", json!({"x": 200, "y": 10, "width": 150, "height": 200})).unwrap()["id"].as_u64().unwrap();
app.run("select.set", json!({"ids": [a, b]})).unwrap();
app.run("text.thread.create", json!({})).unwrap();
app.run("select.set", json!({"ids": [a]})).unwrap();
assert_eq!(super::super::character::selected_story_texts(&app).len(), 2, "{label}");
for (id, on) in [(a, true), (b, false)] {
let doc = std::sync::Arc::make_mut(&mut app.session.doc_mut().unwrap().doc);
let Some(NodeKind::Text(t)) = doc.node_mut(NodeId(id)).map(|n| &mut n.kind) else { panic!("no frame {id}") };
for r in &mut t.runs {
set(&mut r.style, on);
}
}
let empty = match &app.session.active().unwrap().doc.node(NodeId(b)).unwrap().kind {
NodeKind::Text(t) => t.runs.iter().filter(|r| r.text.is_empty()).count(),
_ => panic!("{label}: not text"),
};
assert!(empty > 0, "{label}: the empty frame has no run");
assert_eq!(state_of(&app, &item), Some(toggled(label, true)), "{label}");
run(&mut app, cmd, &params).unwrap().unwrap();
match &app.session.active().unwrap().doc.node(NodeId(a)).unwrap().kind {
NodeKind::Text(t) => assert!(t.runs.iter().all(|r| !get(&r.style)), "{label}"),
_ => panic!("{label}: not text"),
}
}
}
}
+4 -1
View File
@@ -12858,7 +12858,10 @@ a font without vertical metrics keeps its cells. Line-end Punctuation Half Width
punctuation `palt` or `vpal` re-spaced (the opening bracket at a line's start, consecutive punctuation, the closing
mark at a line's end); punctuation left full width is trimmed as before. With automatic kerning the font's kerning
for the re-spaced glyphs comes too: `apkn` with `palt`, and `vkrn` and `vapk` with `vpal` (vertical type is otherwise
not kerned). Off by default and saved only when on. One undo step.
not kerned). Off by default and saved only when on. One undo step. With Show East Asian Options on, the Character
panel menu and the OpenType panel menu ([the help page](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html))
each have a Proportional Metrics item that sends this attribute; the OpenType panel's item is checked when every
character it changes has it.
```json
{"name":"run_command","arguments":{"command":"text.setFormat","params":{"proportionalMetrics":true}}}
+1
View File
@@ -1804,6 +1804,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
The OpenType panel's Stylistic Sets menu offers `ss01`–`ss20` sets present in the selected text's font, using the font's custom labels when available and numbered labels otherwise. Sets can be combined and deselected individually. With mixed fonts, the menu shows the first selected character's font's sets and applies the feature tag to all selected text; a font without that set draws unchanged. The mixed-font rule is a VectorCraft design choice. Behavior reference: [Add stylistic sets to selected text](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/add-stylistic-sets-to-selected-text.html) and the [OpenType specification](https://learn.microsoft.com/en-us/typography/opentype/spec/features_pt).
The OpenType panel menu has a Stylistic Sets submenu after Reset OpenType Features, with the same sets, labels and checks as the panel's Stylistic Sets button; a set chosen there turns on or off for the characters the panel acts on in one undo step, keeping their other features, and the submenu is disabled with no text selected or when the font offers no sets. The 2019 user guide ([the help page](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf)) has stylistic sets chosen from the OpenType panel menu. The submenu's place in the menu is VectorCraft's own. Tests: `panels::opentype::tests::the_panel_menu_stylistic_sets_submenu_turns_sets_on_and_off`.
With Show East Asian Options on, the OpenType panel menu has H or V Style and Roman Italics, as [Format East Asian characters](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html) describes. H or V Style sets the feature tag `hkna`, which draws kana with the forms the font makes for horizontal type, and with `vkna` for vertical type in vertical type; Roman Italics sets `ital`, the font's italic forms of half-width alphanumerics ([OpenType feature list](https://learn.microsoft.com/en-us/typography/opentype/spec/featurelist)). Each is checked when every selected character has it and turns it on or off for all of them in one undo step; character styles carry both in OpenType Features. Tests: `panels::opentype::tests::kana_style_and_roman_italics_turn_on_and_off`, `features::tests::kana_style_and_roman_italics_are_kept_and_shaped`.
With Show East Asian Options on, the OpenType panel menu also has Proportional Metrics, before H or V Style; [the help page](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html) lists it among the OpenType panel options that this setting shows. It sets the `proportionalMetrics` character attribute that the Character panel menu's item sets (`palt` in horizontal type, `vpal` in vertical type), through `text.setFormat` for selected type and `text.setRangeStyle` while the Type tool edits text. It is checked when every character it changes has the attribute (at a Type tool caret, every character of the text), and choosing it turns the attribute on for all of them, or off when it is checked, in one undo step, keeping their other attributes; with no type selected it is disabled. Its place in the menu and the check rule are VectorCraft's own. Tests: `panels::opentype::tests::proportional_metrics_turns_on_and_off_for_a_mixed_range`, `panels::opentype::tests::proportional_metrics_reaches_a_selected_object_and_the_text_at_a_caret`.
`text.setStyle {stroke, strokeWidth}` sets the character stroke's color and weight of the selected type or of a range of its characters (the weight in document points, as `stroke.set` sets it), in the same undo step as the command's other changes. Tests: `tests::textedit::set_style_sets_the_character_stroke`.
- **Paragraph alignment:** the shared Paragraph/Properties alignment row leaves every button unselected when the paragraphs it acts on differ. Auto resolves per paragraph; choosing an alignment uses the existing command. Headless paragraph_mixed_alignment_* regressions exercise mixed → Center → Undo, caret/uniform states, Unicode range boundaries, Auto/direction, split runs and grouped text. These regressions and full integration CI pass. Original captures confirm mixed → Center → Undo in the existing alignment-button layout. The [public Paragraph panel guide](https://helpx.adobe.com/illustrator/desktop/design-with-text/edit-format-text/paragraph-panel-overview.html) lists the seven controls, but does not specify mixed-state rendering. Other paragraph fields remain outside this change; scores and hours unchanged.
For Auto Size area type in columns, the bisection for the frame's height runs on the lines of the one-column layout, and its result is checked with at most two layouts of the columns. When the text wraps around objects or does not fit the one-column layout, or when the check fails, the columns are laid out at every step of the bisection, as before. Typing at the start of a story of 50,000 characters in 2 columns took 1,670 ms a keystroke and now takes 292 ms (release build, `auto_height_in_columns_typing_timing`).
+1
View File
@@ -38,6 +38,7 @@ against Illustrator's public documentation; **estimated** unless noted.
| OpenType panel, Glyphs panel, alternates | done | Highlight Alternate Glyphs preference (#394, off by default) paints pink behind OpenType substitutions on screen when on (required shaping such as Arabic joining forms and the lam-alef ligature, including a lam-alef older fonts file under `liga`, is not highlighted; an optional feature that changes the ligature is); stylistic sets ss01–ss20, stylistic and titling alternates, proportional and lining figures, superscript and subscript are character-style features (`text.setStyle {features}`, #1607); the OpenType panel's Position menu sets superscript, subscript, numerator or denominator glyphs (`sups`, `subs`, `numr`, `dnom`). The OpenType panel's Stylistic Sets menu lists the selected font's `ss01`–`ss20` features, using a font-supplied name where available and `Set N` otherwise; several sets can be active, and selecting an active one removes it. For a mixed-font selection it uses the first selected character's font, a VectorCraft design choice ([public help](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/add-stylistic-sets-to-selected-text.html), [OpenType feature specification](https://learn.microsoft.com/en-us/typography/opentype/spec/features_pt)). The Glyphs panel highlights the character selected with the Type tool (a range's first character, else the one before the caret) and scrolls it into view as the selection moves (#4908; `panels::glyphs` tests); its Show menu lists Unicode ranges and Alternates for Current Selection, the selected character's alternate glyphs from the font's `GSUB` table. A double-click applies the OpenType feature that draws a variant to that character alone, or uses a glyph choice when no supported feature draws it; see the Glyphs panel row below for Entire Font and the joining limits. A grid cell whose glyph has alternates shows a triangle in its lower right corner; a click on it opens a pop-up of that glyph and its alternates in the font's order, and a pick inserts the character at the caret drawn with that glyph, or draws the selected character with it, in one undo step; in Entire Font a glyph no character maps has the triangle too, and a pick goes on the selected character as a double-click on that glyph's cell does ([CS6 reference, Glyphs panel overview](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=373)); the triangle's size and the pop-up's eight columns and six rows are VectorCraft's own (`panels::glyphs` tests `a_cells_corner_triangle_opens_its_alternates_and_a_pick_inserts_one`, `a_pick_replaces_the_selected_character_and_says_why_when_it_cannot`, `a_pick_that_cannot_be_drawn_leaves_the_text_as_it_was`, `an_unencoded_glyphs_corner_triangle_applies_its_alternates_to_the_selection`; `has_alternates_follows_the_listed_substitutions` in the text crate) |
| Glyphs panel: alternates as OpenType feature values, unencoded glyphs | done | #5514, as [Replace characters with alternate glyphs](https://helpx.adobe.com/illustrator/desktop/design-with-text/special-characters-glyphs/replace-characters-with-alternate-glyphs.html) describes (Show › Alternates For Current Selection; replace the selected character by double-clicking the glyph). A character-style feature takes a value (`"salt=2"`, the font's alternate number; `ss01`–`ss20`, `swsh`, `titl` and `aalt` too) in `features` and `featureChanges`, in SVG `font-feature-settings` (`"salt" 2`) and in native files as the plain string. Show › Entire Font applies an unencoded glyph the same way when it is an alternate of the selected character in its word, applies one no feature reaches (`A.salt` in a font with no `salt`) to the selected character as a glyph choice (it may not join), and dims the others with the reason in the tooltip (e.g. `yehfarsi.fina.alt2 belongs to ی (U+06CC) at the end of a word; your selection is ي (U+064A)`); an Arabic presentation form picked there inserts its letter so the word joins. Runs that differ only in their features shape as one piece of text, each run's features over its own characters, so a variant on one letter of an Arabic word keeps its neighbours' initial, medial and final forms and the letters still touch. The panel lists the alternates of the glyph the shaper makes for the selected character in its word (a medial letter shows medial variants), and a double-click applies the OpenType feature that draws the variant (`salt=N` or `ssNN`) to that character alone, in one undo step (`text.setRangeStyle`); a variant no feature reaches falls back to a replacement glyph (`text.setGlyphAlternate`), which its tooltip says may not join. Show › Entire Font also lists the glyphs no character maps, with their name or `gid N` and the feature that gives them. The text crate reads each face's `GSUB` once (alternate sets, single substitutions, the feature that reaches a glyph). Not done: alternates reached through contextual or ligature lookups, and features of the font that the style has no tag for (`cv01`–`cv99`, `hist`). Evidence: `tests::glyph_alternates` in the text crate (a fixture font with a medial teh at `salt=1` to `3`, the neighbours' forms, no gap; Kufi Murabba PIIIX when it is installed), `features::tests::feature_values_are_parsed_validated_and_shaped`, `tests::textedit::feature_values_are_set_replaced_and_saved`, the `panels::glyphs` tests. |
| OpenType panel menu: H or V Style, Roman Italics | done | With Show East Asian Options, as [Format East Asian characters](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html) describes: H or V Style is the character feature `hkna` (kana in the font's horizontal forms, shaped as `vkna` in vertical type) and Roman Italics is `ital` (the font's italic half-width alphanumerics), set with `text.setStyle` / `text.setRangeStyle {features, featureChanges}`, on or off only, and in Character Style Options › OpenType Features ([OpenType feature list](https://learn.microsoft.com/en-us/typography/opentype/spec/featurelist)). |
| OpenType panel menu: Proportional Metrics | done | With Show East Asian Options, before H or V Style ([the help page](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html) lists it among the OpenType panel options): the `proportionalMetrics` character attribute of `text.setFormat` / `text.setRangeStyle`, as the Character panel menu's item sets it. |
| Font menu: samples, live preview, filters, favourites, recent families; font matching by any name; Find Font | done | #3515: recently applied families appear first, once each; missing families are omitted and the existing Number of Recent Fonts setting applies; #339; script filter: Japanese, Latin, Thai; the font scan on Linux also reads the folders fontconfig's configuration lists, such as TeX fonts under `/usr/share/texmf/fonts` (#1548, fixes #1529; not verified on Linux); Select Text by Font takes a scope: the document, chosen artboards or chosen layers; Find Font's Find In offers Document, Artboard (the active one) and Layers (the selected ones, else the current one) (#5529, a VectorCraft addition); Replace With Font lists family and style rows, one click setting both, with a search over them; its list scrolls on its own, apart from the document's font list (#4972); wherever the font menu opens, its filters keep the same four rows, and it opens at least wide enough for them and for a family name up to 220 points wide with its sample (up to 60% of the window), each sample filling its row's height (a VectorCraft layout); a filter chosen in the font menu of the Character panel, the Control bar or the Properties panel is on in the others, and the filters are cleared when the app quits ([Font browser overview](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/font-options-overview.html)); the font menus of the Glyphs panel and of the dialogs that pick a font share the same filters (a VectorCraft choice); Show Similar Fonts: the ≈ button on a family's row lists the families that look like it first ([Font browser overview](https://helpx.adobe.com/illustrator/desktop/design-with-text/fonts-and-scripts/font-options-overview.html)), by VectorCraft's own measure of PANOSE, weight, width, heights, average width and italic angle, same script first, a family sharing none of these numbers with it last in its group (VectorCraft's own rule), and the ≈ chip under the filters clears it (`text.similarFonts`; evidence: `font_menu::tests::show_similar_fonts_orders_the_list_by_likeness`, `tests::similar::families_are_ordered_by_likeness`, `tests::similar::a_family_without_numbers_comes_after_the_measured_ones`). |
| Missing glyphs set in an installed font made for their script (Thai, Lao, Khmer, Myanmar first; then any font that has them) | done | Thai: Leelawadee UI, Tahoma, Thonburi, Sukhumvit Set, Noto Sans Thai, TLWG |
| Full font-name matching (OpenType name ID 4) | done | #1258: loaded/cataloged faces and Missing Fonts searches; localized names and variable default faces; Windows font-service QA pending |