From 6f853810bf146b8747a5e11ac7ceba17fe650972 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 12:47:40 -0800 Subject: [PATCH 1/2] Type: Composite Fonts' Show Sample draws the font picked with its metric lines Show Sample (Hide Sample when it shows) in Type > Composite Fonts... draws the font picked in a line of sample text, with the first character of each custom set added, through the renderer, so color and bitmap glyphs keep their colors. Buttons beside it show or hide lines for the ICF box, em box, baseline, cap height, highest ascent and lowest descent, highest ascender and x-height, and Zoom draws it at 25% to 800% of 36 pt. The em box and ICF box are the Kanji part's font's; the other lines measure the faces the glyphs are drawn in, fallback faces included. Each line takes its part's size, baseline and vertical scale, and Kana scaled at center, as layout sets them. ui.dialog.set takes sample, zoom and the seven line fields, and refuses a zoom outside the menu or a line that is not true or false. FontFace gains cap_height(), the estimate a face without an OS/2 cap height uses, beside x_height(). Docs: docs/mcp.md, docs/type-parity.md, docs/target-app-parity.md. --- crates/text/src/fontdb/face.rs | 5 + crates/ui-egui/src/dialogs.rs | 6 +- crates/ui-egui/src/dialogs/composite_fonts.rs | 34 +- .../src/dialogs/composite_fonts/sample.rs | 382 ++++++++++++++++++ .../src/dialogs/composite_fonts/tests.rs | 190 +++++++++ crates/ui-egui/src/i18n/bg.tsv | 4 + crates/ui-egui/src/i18n/bs.tsv | 4 + crates/ui-egui/src/i18n/ca.tsv | 4 + crates/ui-egui/src/i18n/cs.tsv | 4 + crates/ui-egui/src/i18n/da.tsv | 4 + crates/ui-egui/src/i18n/de.tsv | 4 + crates/ui-egui/src/i18n/el.tsv | 4 + crates/ui-egui/src/i18n/es.tsv | 4 + crates/ui-egui/src/i18n/fi.tsv | 4 + crates/ui-egui/src/i18n/fr.tsv | 4 + crates/ui-egui/src/i18n/gu.tsv | 4 + crates/ui-egui/src/i18n/hi.tsv | 4 + crates/ui-egui/src/i18n/hu.tsv | 4 + crates/ui-egui/src/i18n/id.tsv | 4 + crates/ui-egui/src/i18n/it.tsv | 4 + crates/ui-egui/src/i18n/ja.tsv | 4 + crates/ui-egui/src/i18n/ka.tsv | 4 + crates/ui-egui/src/i18n/ko.tsv | 4 + crates/ui-egui/src/i18n/nl.tsv | 4 + crates/ui-egui/src/i18n/pl.tsv | 4 + crates/ui-egui/src/i18n/pt-br.tsv | 4 + crates/ui-egui/src/i18n/ru.tsv | 4 + crates/ui-egui/src/i18n/sv.tsv | 4 + crates/ui-egui/src/i18n/tr.tsv | 4 + crates/ui-egui/src/i18n/uk.tsv | 4 + crates/ui-egui/src/i18n/vi.tsv | 4 + crates/ui-egui/src/i18n/zh-hans.tsv | 4 + crates/ui-egui/src/i18n/zh-hant.tsv | 4 + docs/mcp.md | 16 +- docs/target-app-parity.md | 1 + docs/type-parity.md | 2 +- 36 files changed, 739 insertions(+), 9 deletions(-) create mode 100644 crates/ui-egui/src/dialogs/composite_fonts/sample.rs diff --git a/crates/text/src/fontdb/face.rs b/crates/text/src/fontdb/face.rs index ff9ad8d58f..5d90bf6976 100644 --- a/crates/text/src/fontdb/face.rs +++ b/crates/text/src/fontdb/face.rs @@ -356,6 +356,11 @@ impl FontFace { pub fn x_height(&self) -> f64 { self.x_height } + /// The height of the capital letters in font units, positive (estimated from the ascent when + /// the font has no OS/2 value). + pub fn cap_height(&self) -> f64 { + self.cap_height + } /// The line gap the font asks for between lines, in font units (from the same table as /// [`vertical_metrics`](Self::vertical_metrics); 0 when it has none). pub fn line_gap(&self) -> f64 { diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index fe48f28952..551854023a 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -645,12 +645,16 @@ pub(crate) fn parent(d: &Dialog) -> Option { /// `ui.dialog.set` changed `field` of the open dialog from `old`: a choice that sets other fields /// sets them as choosing it in the dialog does (Export for Screens' `exportPreset`), a change /// to Export for Screens' sub-folder controls ends an applied preset's item folders, as it does in -/// the dialog, and Transform Each's Relative / Absolute keeps the Scale fields' size. +/// the dialog, and Transform Each's Relative / Absolute keeps the Scale fields' size. A value +/// Composite Fonts' Show Sample can't take is refused. pub(crate) fn field_set(app: &mut VectorcraftApp, field: &str, old: Option<&Value>) -> Result<(), String> { if app.ui.dialog.as_ref().is_some_and(|d| d.kind == transform_each::KIND) { transform_each::field_set(app, field, old); return Ok(()); } + if let Some(d) = app.ui.dialog.as_ref().filter(|d| d.kind == composite_fonts::KIND) { + return composite_fonts::field_set(d, field); + } let Some(d) = app.ui.dialog.as_mut().filter(|d| d.kind == export_for_screens::KIND) else { return Ok(()) }; match field { "exportPreset" => export_for_screens::preset_set(app), diff --git a/crates/ui-egui/src/dialogs/composite_fonts.rs b/crates/ui-egui/src/dialogs/composite_fonts.rs index 6e3b6f84e1..41bef1f45b 100644 --- a/crates/ui-egui/src/dialogs/composite_fonts.rs +++ b/crates/ui-egui/src/dialogs/composite_fonts.rs @@ -5,14 +5,17 @@ //! out, Import… adds the fonts of a file and Export… writes the one picked to a file. Custom shows //! the custom character sets of the font picked: New adds a set based on the one picked, Delete Set //! takes it out, and Add puts the characters typed (Direct Entry) or the character of a Unicode code -//! into it; Delete takes the character picked out. Nothing changes in the document until OK, which +//! into it; Delete takes the character picked out. Show Sample draws a sample of the font picked +//! with lines that mark its metrics ([`sample`]). Nothing changes in the document until OK, which //! runs `type.compositeFonts.set` with every font as one undo step; Cancel leaves them as they were. //! //! Fields: `fonts` (the composite fonts as `type.compositeFonts.set` takes them), `selected` (the //! index of the one picked) and `name` (its name as typed); `custom` (whether the custom character //! sets show), `set` (the index of the set picked), `setName` (its name as typed), `entryMode` //! (`direct` or `unicode`), `entry` (the characters or code typed) and `char` (the index of the -//! character picked in the set). +//! character picked in the set); `sample` (whether the sample shows), `zoom` (its magnification in +//! percent) and `lineIcfBox`, `lineEmBox`, `lineBaseline`, `lineCapHeight`, `lineAscentDescent`, +//! `lineAscender` and `lineXHeight` (whether each of its lines shows). //! //! Behavior reference (public documentation): //! , @@ -29,6 +32,8 @@ use crate::picks::PickRequest; use crate::state::Dialog; use crate::{FilePick, VectorcraftApp, widgets}; +mod sample; + /// The dialog kind of Composite Fonts. pub const KIND: &str = "compositeFonts"; @@ -53,15 +58,22 @@ pub(super) const SPEC: DialogSpec = DialogSpec { }; /// Open Composite Fonts on the active document's composite fonts, the first one picked, with the -/// custom character sets hidden and nothing typed. +/// custom character sets and the sample hidden and nothing typed. pub fn open(app: &mut VectorcraftApp) -> Result { let fonts = app.session.active().ok_or("no document open")?.doc.composite_fonts.to_vec(); let mut d = Dialog::new(KIND, json!({ "fonts": fonts, "selected": 0, "custom": false, "entryMode": "direct", "entry": "" })); + sample::defaults(&mut d.fields); show_selected(&mut d); app.ui.dialog = Some(d); Ok(Value::Null) } +/// Why `ui.dialog.set` can't set `field` of Composite Fonts `d` to the value it now holds (Show +/// Sample's fields, [`sample::check_field`]). +pub(super) fn field_set(d: &Dialog, field: &str) -> Result<(), String> { + sample::check_field(d, field) +} + /// The fonts the dialog holds. fn fonts(d: &Dialog) -> Vec { d.fields.get("fonts").and_then(|v| serde_json::from_value(v.clone()).ok()).unwrap_or_default() @@ -138,6 +150,8 @@ enum Action { Export, /// Custom: show or hide the custom character sets. Custom, + /// Show Sample or Hide Sample. + Sample, NewSet, DeleteSet, /// Add the characters typed, or the character of the code typed, to the set picked. @@ -178,6 +192,10 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { if ui.add_enabled_ui(!list.is_empty(), |ui| widgets::flat_button(ui, tl!("Custom"), 64.0)).inner.clicked() { act = Some(Action::Custom); } + let label = if d.bool("sample") { tl!("Hide Sample") } else { tl!("Show Sample") }; + if ui.add_enabled_ui(!list.is_empty(), |ui| widgets::flat_button(ui, label, 96.0)).inner.clicked() { + act = Some(Action::Sample); + } }); if let Some(k) = picked { select(d, k); @@ -192,6 +210,10 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { f.name = d.str("name"); ui.add_space(8.0); parts_table(app, ui, f); + if d.bool("sample") { + ui.add_space(8.0); + sample::show(ui, d, f); + } if d.bool("custom") { ui.add_space(8.0); ui.separator(); @@ -319,6 +341,10 @@ fn run(app: &mut VectorcraftApp, d: &mut Dialog, act: Action) -> Result<(), Stri let open = !d.bool("custom"); d.fields.insert("custom".into(), json!(open)); } + Action::Sample => { + let open = !d.bool("sample"); + d.fields.insert("sample".into(), json!(open)); + } Action::NewSet | Action::DeleteSet | Action::AddChars | Action::DeleteChar => { let f = list.get_mut(i).ok_or("no composite font")?; let at = edit_sets(d, f, act)?; @@ -389,7 +415,7 @@ fn edit_sets(d: &mut Dialog, f: &mut CompositeFont, act: Action) -> Result Ok(None), + Action::New | Action::Delete | Action::Import | Action::Export | Action::Custom | Action::Sample => Ok(None), } } diff --git a/crates/ui-egui/src/dialogs/composite_fonts/sample.rs b/crates/ui-egui/src/dialogs/composite_fonts/sample.rs new file mode 100644 index 0000000000..952e88be1c --- /dev/null +++ b/crates/ui-egui/src/dialogs/composite_fonts/sample.rs @@ -0,0 +1,382 @@ +//! Show Sample in Composite Fonts: the font picked set in a line of sample text, with lines that +//! mark its ICF box, em box, baseline, cap height, highest ascent and lowest descent, highest +//! ascender and x-height, each shown or hidden by its button, at the size Zoom picks. +//! +//! The sample text, the zoom steps, the size at 100% and what each line measures are VectorCraft's +//! own: the em box and ICF box are those of the Kanji part's face +//! ([`vectorcraft_text::FontFace::ideographic_centre`], [`vectorcraft_text::FontFace::icf_margins`]), +//! the cap height and x-height those of the face the Roman letters are drawn in, Max Ascent/Descent +//! the highest ascent and lowest descent among the faces the sample is drawn in (fallback faces +//! included), and Max Ascender the top of the sample's tallest glyph. Each takes its part's size, +//! baseline and vertical scale. +//! +//! Behavior reference (public documentation): +//! , +//! . + +use std::hash::{DefaultHasher, Hash, Hasher}; + +use egui::{Color32, Rect, Sense, Stroke, Ui, vec2}; +use serde_json::{Value, json}; +use vectorcraft_doc::{CharClass, CharStyle, CompositeClass, CompositeFont, FontHeightReference, TextObject}; +use vectorcraft_geom::kurbo::BezPath; +use vectorcraft_geom::{Affine, Point}; +use vectorcraft_text::FontDb; + +use crate::state::Dialog; +use crate::widgets; + +/// The text the sample sets: two Kanji, two kana, two punctuation marks, a symbol, Roman letters +/// with an ascender and a descender, and two numerals, then the first character of each custom set. +pub(super) const TEXT: &str = "永国あア、。※Agh12"; + +/// The Zoom menu's magnifications, in percent. +pub(super) const ZOOMS: [u64; 7] = [25, 50, 75, 100, 200, 400, 800]; + +/// The size the sample is set at with Zoom at 100%, in points. +const SIZE: f64 = 36.0; + +/// How tall the sample is drawn, in points. +const HEIGHT: f32 = 150.0; + +/// How far the sample text starts from the left edge, in points. +const INSET: f64 = 12.0; + +/// The width of the column of line buttons and Zoom beside the sample, in points. +const BUTTONS: f32 = 190.0; + +/// The narrowest and widest the sample is drawn, in points. +const WIDTH: std::ops::RangeInclusive = 240.0..=720.0; + +/// The name the sample lends the font under, so a name that is empty, being typed or shared with +/// another font still draws. +const NAME: &str = "VectorCraft Composite Sample"; + +/// A line Show Sample can mark. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub(super) enum Mark { + IcfBox, + EmBox, + Baseline, + CapHeight, + AscentDescent, + Ascender, + XHeight, +} + +impl Mark { + /// The marks, in the order their buttons show. + pub(super) const ALL: [Self; 7] = + [Self::IcfBox, Self::EmBox, Self::Baseline, Self::CapHeight, Self::AscentDescent, Self::Ascender, Self::XHeight]; + + /// The dialog field that holds whether the mark shows. + pub(super) fn field(self) -> &'static str { + match self { + Self::IcfBox => "lineIcfBox", + Self::EmBox => "lineEmBox", + Self::Baseline => "lineBaseline", + Self::CapHeight => "lineCapHeight", + Self::AscentDescent => "lineAscentDescent", + Self::Ascender => "lineAscender", + Self::XHeight => "lineXHeight", + } + } + + fn label(self) -> &'static str { + match self { + Self::IcfBox => tl!("ICF Box"), + Self::EmBox => tl!("Em Box"), + Self::Baseline => tl!("Baseline"), + Self::CapHeight => tl!("Cap Height"), + Self::AscentDescent => tl!("Max Ascent/Descent"), + Self::Ascender => tl!("Max Ascender"), + Self::XHeight => tl!("x-height"), + } + } + + /// Shown when the dialog opens: the em box, the ICF box and the baseline. + pub(super) fn shown_at_first(self) -> bool { + matches!(self, Self::IcfBox | Self::EmBox | Self::Baseline) + } + + fn color(self) -> Color32 { + match self { + Self::IcfBox => Color32::from_rgb(0, 150, 170), + Self::EmBox => Color32::from_rgb(220, 60, 60), + Self::Baseline => Color32::from_rgb(40, 110, 230), + Self::CapHeight => Color32::from_rgb(40, 160, 70), + Self::AscentDescent => Color32::from_rgb(230, 140, 30), + Self::Ascender => Color32::from_rgb(150, 80, 200), + Self::XHeight => Color32::from_rgb(200, 60, 160), + } + } +} + +/// The fields Show Sample adds to the dialog when it opens: hidden, at 100%, with the marks of +/// [`Mark::shown_at_first`]. +pub(super) fn defaults(fields: &mut serde_json::Map) { + fields.insert("sample".into(), json!(false)); + fields.insert("zoom".into(), json!(100)); + for m in Mark::ALL { + fields.insert(m.field().into(), json!(m.shown_at_first())); + } +} + +/// Why `ui.dialog.set` can't set Show Sample's `field` to the value `d` now holds: `sample` and the +/// marks take true or false, and `zoom` one of [`ZOOMS`]. +pub(super) fn check_field(d: &Dialog, field: &str) -> Result<(), String> { + let v = d.fields.get(field); + let key = field; + if field == "sample" || Mark::ALL.iter().any(|m| m.field() == field) { + if !v.is_some_and(Value::is_boolean) { + return Err(format!("`{key}` must be true or false")); + } + } else if field == "zoom" && !v.and_then(Value::as_u64).is_some_and(|z| ZOOMS.contains(&z)) { + return Err(format!("`{key}` must be one of {}", ZOOMS.map(|z| z.to_string()).join(", "))); + } + Ok(()) +} + +/// The Zoom `d` holds, 100 when it holds none of [`ZOOMS`]. +fn zoom(d: &Dialog) -> u64 { + d.fields.get("zoom").and_then(Value::as_u64).filter(|z| ZOOMS.contains(z)).unwrap_or(100) +} + +/// The heights the marks are drawn at, in points above the baseline (a mark's line is not drawn +/// when its height is `None`). The baseline is at 0. +#[derive(Clone, Copy, Debug, Default, PartialEq)] +pub(super) struct Heights { + /// The em box's bottom and top. + pub em_box: Option<(f64, f64)>, + /// The ICF box's bottom and top. + pub icf_box: Option<(f64, f64)>, + pub cap_height: Option, + pub x_height: Option, + /// The lowest descent and the highest ascent. + pub ascent_descent: Option<(f64, f64)>, + /// The top of the tallest glyph. + pub ascender: Option, +} + +impl Heights { + /// The heights of mark `m`. + fn of(&self, m: Mark) -> Vec { + let pair = |p: Option<(f64, f64)>| p.map_or_else(Vec::new, |(a, b)| vec![a, b]); + match m { + Mark::IcfBox => pair(self.icf_box), + Mark::EmBox => pair(self.em_box), + Mark::Baseline => vec![0.0], + Mark::CapHeight => self.cap_height.into_iter().collect(), + Mark::AscentDescent => pair(self.ascent_descent), + Mark::Ascender => self.ascender.into_iter().collect(), + Mark::XHeight => self.x_height.into_iter().collect(), + } + } +} + +/// `f` as the sample sets it: named [`NAME`], without its custom sets when one of them can't be +/// used (a set whose name is empty or shared while it is typed). +fn sample_font(f: &CompositeFont) -> CompositeFont { + let mut s = f.clone(); + s.name = NAME.to_string(); + if s.check().is_err() { + s.custom.clear(); + } + s +} + +/// [`TEXT`], then the first character of each of `f`'s custom sets that it does not hold yet. +pub(super) fn text(f: &CompositeFont) -> String { + let mut t = TEXT.to_string(); + for c in f.custom.iter().filter_map(|s| s.characters.chars().next()) { + if !t.contains(c) { + t.push(c); + } + } + t +} + +/// The outlines of the sample of `f` set at `size` points with its baseline at y 0 (y down), and +/// the heights of its marks. +pub(super) fn measure(f: &CompositeFont, size: f64) -> (BezPath, Heights) { + let db = FontDb::global(); + let font = sample_font(f); + let _lent = db.lend_composite_fonts(std::slice::from_ref(&font)); + let text = text(&font); + let style = CharStyle { font_family: NAME.to_string(), size, ..Default::default() }; + let layout = vectorcraft_text::layout(db, &TextObject::point(Point::ZERO, &text, style)); + let path = layout.to_bezpath(); + let classes = font.classes(); + // The face of character `c`'s part, the face layout draws it in (a fallback face when the part's + // font lacks it), the size of its em and the shift of its baseline (points), and its part's + // vertical scale, as layout sets them: Kana scaled at center keep the middle of their part's em + // box where it is. + let placed = |c: char| { + let (part_face, _) = db.composite_resolve(NAME, c)?; + let drawn = text.find(c).and_then(|at| layout.glyphs.iter().find(|g| g.byte == at)).and_then(|g| db.face_by_id(g.font_id)); + let class = classes.of(c); + let p = font.part(class).unwrap_or(&font.parts.kanji); + let em = size * p.size / 100.0; + let mut shift = size * p.baseline / 100.0; + if class == CompositeClass::Fixed(CharClass::Kana) && p.scale_at_center && p.v_scale != 100.0 { + shift += em * part_face.ideographic_centre() * (1.0 - p.v_scale / 100.0); + } + let drawn = drawn.unwrap_or_else(|| part_face.clone()); + Some((part_face, drawn, em, shift, p.v_scale / 100.0)) + }; + let mut h = Heights::default(); + // The em box and ICF box are the Kanji part's, the base of the composite font, as layout + // measures that part's face for Scale at Center. + if let Some((face, _, em, shift, v)) = TEXT.chars().next().and_then(placed) { + let tall = em * v; + let mid = shift + face.ideographic_centre() * tall; + let (bottom, top) = (mid - tall * 0.5, mid + tall * 0.5); + let m = face.icf_margins(); + h.em_box = Some((bottom, top)); + h.icf_box = Some((bottom + m.bottom * tall, top - m.top * tall)); + } + if let Some((_, face, em, shift, v)) = placed('A') { + let height = |r| face.font_height(r, false); + let cap = height(FontHeightReference::CapHeight).unwrap_or_else(|| face.cap_height() / face.units_per_em()); + h.cap_height = Some(shift + cap * em * v); + let x = height(FontHeightReference::XHeight).unwrap_or_else(|| face.x_height() / face.units_per_em()); + h.x_height = Some(shift + x * em * v); + } + let mut seen = Vec::new(); + for c in text.chars().filter(|c| !c.is_whitespace()) { + let Some((_, face, em, shift, v)) = placed(c) else { continue }; + if seen.contains(&(face.id(), em.to_bits(), shift.to_bits(), v.to_bits())) { + continue; + } + seen.push((face.id(), em.to_bits(), shift.to_bits(), v.to_bits())); + let (ascent, descent) = face.vertical_metrics(); + let scale = em * v / face.units_per_em(); + let (low, high) = (shift - descent * scale, shift + ascent * scale); + h.ascent_descent = Some(h.ascent_descent.map_or((low, high), |(l, t)| (l.min(low), t.max(high)))); + } + // Outlines, color glyphs and bitmap glyphs alike. + h.ascender = layout.ink_bounds().filter(|ink| ink.height() > 0.0).map(|ink| -ink.y0); + (path, h) +} + +/// The sample drawn for a key, kept until the font, zoom, size, display scale, text color or the +/// fonts installed change. +struct Drawn { + key: u64, + texture: Option, + heights: Heights, +} + +thread_local! { + static DRAWN: crate::graphics::TexCache> = crate::graphics::TexCache::default(); + static RENDERER: std::cell::RefCell = std::cell::RefCell::new(vectorcraft_render::Renderer::new()); +} + +/// Show Sample's area under the table: the sample of `f` with its marks, then the mark buttons and +/// Zoom beside it. +pub(super) fn show(ui: &mut Ui, d: &mut Dialog, f: &CompositeFont) { + let zoom = zoom(d); + ui.horizontal(|ui| { + let width = (ui.available_width() - BUTTONS).clamp(*WIDTH.start(), *WIDTH.end()); + let (rect, _) = ui.allocate_exact_size(vec2(width, HEIGHT), Sense::hover()); + paint(ui, rect, d, f, zoom); + ui.vertical(|ui| { + ui.spacing_mut().item_spacing.y = 2.0; + for m in Mark::ALL { + let on = d.bool(m.field()); + ui.horizontal(|ui| { + let (swatch, _) = ui.allocate_exact_size(vec2(10.0, 10.0), Sense::hover()); + ui.painter().rect_filled(swatch, 1.0, m.color()); + if ui.add(egui::Button::selectable(on, m.label())).clicked() { + d.fields.insert(m.field().into(), json!(!on)); + } + }); + } + ui.add_space(4.0); + ui.horizontal(|ui| { + widgets::dim_label(ui, tl!("Zoom")); + let names: Vec = ZOOMS.iter().map(|z| format!("{z}%")).collect(); + let options: Vec<&str> = names.iter().map(String::as_str).collect(); + let current = format!("{zoom}%"); + if let Some(k) = widgets::dropdown(ui, "composite-fonts-zoom", ¤t, &options, 80.0) + && let Some(z) = ZOOMS.get(k) + { + d.fields.insert("zoom".into(), json!(z)); + } + }); + }); + }); +} + +/// Draw the sample of `f` at `zoom` percent into `rect`, its em box centered in it, with the marks +/// `d` shows. +fn paint(ui: &Ui, rect: Rect, d: &Dialog, f: &CompositeFont, zoom: u64) { + let painter = ui.painter_at(rect); + let visuals = ui.visuals(); + painter.rect_filled(rect, 2.0, visuals.extreme_bg_color); + let ppp = ui.ctx().pixels_per_point(); + let ink = visuals.text_color(); + let mut h = DefaultHasher::new(); + serde_json::to_string(f).unwrap_or_default().hash(&mut h); + (zoom, ppp.to_bits(), rect.width().to_bits(), rect.height().to_bits(), ink.to_array(), FontDb::global().generation()).hash(&mut h); + let key = h.finish(); + let size = SIZE * zoom as f64 / 100.0; + let (texture, heights) = DRAWN.with(|cache| { + let mut cache = cache.borrow_mut(); + if let Some(drawn) = cache.as_ref().filter(|c| c.key == key) { + return (drawn.texture.clone(), drawn.heights); + } + let (_, heights) = measure(f, size); + let texture = render(ui.ctx(), f, size, baseline(&heights, size, rect), rect, ppp, ink); + *cache = Some(Drawn { key, texture: texture.clone(), heights }); + (texture, heights) + }); + if let Some(t) = &texture { + painter.image(t.id(), rect, Rect::from_min_max(egui::pos2(0.0, 0.0), egui::pos2(1.0, 1.0)), Color32::WHITE); + } + let base = rect.top() + baseline(&heights, size, rect) as f32; + for m in Mark::ALL.into_iter().filter(|m| d.bool(m.field())) { + for y in heights.of(m) { + painter.hline(rect.x_range(), base - y as f32, Stroke::new(1.0, m.color())); + } + } + painter.rect_stroke(rect, 2.0, visuals.widgets.noninteractive.bg_stroke, egui::StrokeKind::Inside); +} + +/// Where the baseline goes, in points down from the top of `rect`: the em box's middle (else +/// 0.38 em above the baseline) at the middle of `rect`. +fn baseline(h: &Heights, size: f64, rect: Rect) -> f64 { + let mid = h.em_box.map_or(size * 0.38, |(bottom, top)| (bottom + top) * 0.5); + f64::from(rect.height()) * 0.5 + mid +} + +/// The sample of `f` drawn into a texture the size of `rect` in pixels ([`draw`]). `None` when +/// `rect` is empty or larger than the largest texture. +fn render(ctx: &egui::Context, f: &CompositeFont, size: f64, baseline: f64, rect: Rect, ppp: f32, ink: Color32) -> Option { + let (w, h) = ((rect.width() * ppp).round(), (rect.height() * ppp).round()); + let max = ctx.input(|i| i.max_texture_side) as f32; + if w < 1.0 || h < 1.0 || w > max || h > max || w > f32::from(u16::MAX) || h > f32::from(u16::MAX) { + return None; + } + let image = draw(f, size, baseline, (w as u16, h as u16), ppp, ink); + Some(ctx.load_texture("composite-font-sample", crate::canvas::color_image_owned(image), egui::TextureOptions::LINEAR)) +} + +/// The sample of `f` set at `size` points in `ink`, its baseline `baseline` points down from the +/// top, drawn by the renderer as the canvas draws type (color and bitmap glyphs in their own +/// colors) into `px` pixels at `ppp` pixels per point. +pub(super) fn draw(f: &CompositeFont, size: f64, baseline: f64, px: (u16, u16), ppp: f32, ink: Color32) -> vectorcraft_render::Rendered { + let (w, h) = px; + let mut doc = vectorcraft_doc::Document::new(f64::from(w) / f64::from(ppp), f64::from(h) / f64::from(ppp)); + let font = sample_font(f); + let sample = text(&font); + *doc.composite_fonts = vec![font]; + let [r, g, b, _] = ink.to_normalized_gamma_f32(); + let fill = vectorcraft_color::Paint::solid(vectorcraft_color::Color::rgb(r, g, b)); + let style = CharStyle { font_family: NAME.to_string(), size, fill, ..Default::default() }; + let t = TextObject::point(Point::new(INSET, baseline), &sample, style); + let node = std::sync::Arc::new(vectorcraft_doc::Node::new(doc.alloc_id(), vectorcraft_doc::NodeKind::Text(Box::new(t)))); + let view = Affine::scale(f64::from(ppp)); + let empty = || vectorcraft_render::Rendered { width: u32::from(w), height: u32::from(h), pixels: vec![0; usize::from(w) * usize::from(h) * 4] }; + RENDERER.with(|r| r.borrow_mut().render_node(&doc, &node, w, h, view)).unwrap_or_else(empty) +} diff --git a/crates/ui-egui/src/dialogs/composite_fonts/tests.rs b/crates/ui-egui/src/dialogs/composite_fonts/tests.rs index e50ce1b566..fa909973b1 100644 --- a/crates/ui-egui/src/dialogs/composite_fonts/tests.rs +++ b/crates/ui-egui/src/dialogs/composite_fonts/tests.rs @@ -280,3 +280,193 @@ fn custom_sets_sharing_a_name_keep_the_dialog_open() { assert!(app.ui.dialog.is_some()); assert!(names(&app).is_empty()); } + +/// A composite font set in Inter, with its Roman part as `roman` changes it. +fn inter_font(roman: impl FnOnce(&mut vectorcraft_doc::CompositePart)) -> CompositeFont { + let mut parts = vectorcraft_doc::CompositeParts::all(vectorcraft_doc::CompositePart::new("Inter", "Regular")); + roman(&mut parts.roman); + CompositeFont { name: "UI Composite Sample".into(), parts, custom: Vec::new() } +} + +/// Show Sample opens hidden at 100% with the ICF box, em box and baseline shown; its button shows +/// and hides the sample, which draws with every line shown and at every zoom; nothing changes in +/// the document. +#[test] +fn show_sample_shows_and_hides_the_sample() { + let mut app = app(); + open(&mut app).unwrap(); + let d = dialog(&mut app); + assert!(!d.bool("sample")); + assert_eq!(d.fields.get("zoom"), Some(&json!(100))); + let shown: Vec = sample::Mark::ALL.iter().map(|m| d.bool(m.field())).collect(); + assert_eq!(shown, [true, true, true, false, false, false, false]); + press(&mut app, Action::New); + press(&mut app, Action::Sample); + assert!(dialog(&mut app).bool("sample")); + frame(&mut app); + for m in sample::Mark::ALL { + dialog(&mut app).fields.insert(m.field().into(), json!(true)); + } + for z in sample::ZOOMS { + dialog(&mut app).fields.insert("zoom".into(), json!(z)); + frame(&mut app); + } + press(&mut app, Action::Sample); + assert!(!dialog(&mut app).bool("sample")); + super::super::cancel(&mut app); + assert!(names(&app).is_empty()); +} + +/// `ui.dialog.set` takes `sample`, `zoom` and the line fields; a zoom outside the Zoom menu or a +/// line that is not true or false is refused and leaves the dialog as it was. +#[test] +fn sample_fields_are_set_and_checked() { + let mut app = app(); + let ctx = egui::Context::default(); + open(&mut app).unwrap(); + let set = |app: &mut VectorcraftApp, field: &str, value: Value| { + let (req, _) = crate::control::ControlRequest::new("ui.dialog.set", json!({"field": field, "value": value})); + let crate::control::Outcome::Done(r) = crate::control::handle(app, &ctx, &req) else { panic!("not done") }; + r + }; + for (field, value) in [("sample", json!(true)), ("zoom", json!(400)), ("lineCapHeight", json!(true)), ("lineBaseline", json!(false))] { + let r = set(&mut app, field, value.clone()); + assert!(r.get("error").is_none(), "{field}: {r}"); + assert_eq!(dialog(&mut app).fields.get(field), Some(&value), "{field}"); + } + for (field, value) in [("zoom", json!(30)), ("zoom", json!("200")), ("sample", json!(1)), ("lineXHeight", json!("yes"))] { + let r = set(&mut app, field, value.clone()); + assert!(r.get("error").is_some(), "{field} {value}: {r}"); + } + let d = dialog(&mut app); + assert_eq!((d.fields.get("zoom"), d.bool("sample"), d.bool("lineXHeight")), (Some(&json!(400)), true, false)); +} + +/// The sample's lines: the em box and ICF box of the face the Kanji are set in (a face without +/// ideographs centers its em box 0.38 em above the baseline), the cap height and x-height of the +/// Roman part's face raised by its baseline and scaled by its vertical scale, the lowest descent +/// and highest ascent, and the top of the tallest glyph; all of them grow with the size. +#[test] +fn sample_lines_follow_the_parts() { + let close = |a: f64, b: f64| (a - b).abs() < 1e-6; + let (path, h) = sample::measure(&inter_font(|_| {}), 36.0); + assert!(!path.elements().is_empty()); + let (bottom, top) = h.em_box.unwrap(); + assert!(close(bottom, -0.12 * 36.0) && close(top, 0.88 * 36.0), "{h:?}"); + let (ib, it) = h.icf_box.unwrap(); + assert!(ib >= bottom && it <= top && ib < it, "{h:?}"); + let (cap, x) = (h.cap_height.unwrap(), h.x_height.unwrap()); + assert!(0.0 < x && x < cap && cap < top, "{h:?}"); + let (low, high) = h.ascent_descent.unwrap(); + assert!(low < 0.0 && high > cap, "{h:?}"); + assert!(h.ascender.unwrap() > x, "{h:?}"); + // The Roman part raised by 10% and squeezed to half height moves its lines; the Kanji's stay. + let (_, raised) = sample::measure( + &inter_font(|p| { + p.baseline = 10.0; + p.v_scale = 50.0; + }), + 36.0, + ); + assert!(close(raised.cap_height.unwrap(), 3.6 + cap * 0.5), "{raised:?}"); + assert!(close(raised.x_height.unwrap(), 3.6 + x * 0.5), "{raised:?}"); + assert_eq!(raised.em_box, h.em_box); + // At 200% every line is twice as far from the baseline. + let (_, double) = sample::measure(&inter_font(|_| {}), 72.0); + assert!(close(double.cap_height.unwrap(), cap * 2.0) && close(double.em_box.unwrap().1, top * 2.0), "{double:?}"); +} + +/// The ICF box is the Kanji face's ideographic character face inside its em box, and a Roman face +/// without an OS/2 cap height still gets a Cap Height line, estimated from its ascent. +#[test] +fn sample_lines_read_the_icf_box_and_estimate_a_missing_cap_height() { + use vectorcraft_text::test_fonts::{HEIGHT_FAMILY, HEIGHTLESS_FAMILY, height_font}; + let db = vectorcraft_text::FontDb::global(); + db.add_font(height_font(true).expect("the test font builds")); + db.add_font(height_font(false).expect("the test font builds")); + let close = |a: f64, b: f64| (a - b).abs() < 1e-6; + let mut f = inter_font(|p| p.font = HEIGHTLESS_FAMILY.into()); + f.parts.kanji.font = HEIGHT_FAMILY.into(); + let (_, h) = sample::measure(&f, 36.0); + let (bottom, top) = h.icf_box.unwrap(); + assert!(close(bottom, -0.07 * 36.0) && close(top, 0.83 * 36.0), "{h:?}"); + let cap = h.cap_height.expect("an estimated cap height"); + assert!(cap > h.x_height.unwrap() && cap < h.ascent_descent.unwrap().1, "{h:?}"); +} + +/// A character its part's font lacks is drawn in a fallback face, and the lines measure that face: +/// in a font whose box runs to 0.9 em and which maps no `A`, `g`, `h`, `1` or `2`, the highest +/// ascent is the fallback face's. +#[test] +fn sample_lines_measure_the_faces_that_draw_the_glyphs() { + use vectorcraft_text::test_fonts::{PATH_ALIGN_HHEA_FAMILY, path_align_font}; + vectorcraft_text::FontDb::global().add_font(path_align_font(PATH_ALIGN_HHEA_FAMILY).expect("the test font builds")); + let mut f = inter_font(|_| {}); + f.parts = vectorcraft_doc::CompositeParts::all(vectorcraft_doc::CompositePart::new(PATH_ALIGN_HHEA_FAMILY, "Regular")); + let (_, h) = sample::measure(&f, 36.0); + let (_, high) = h.ascent_descent.unwrap(); + assert!(high > 0.9 * 36.0 + 0.5, "{h:?}"); +} + +/// The lines follow a vertical scale as the glyphs do: a custom set that holds the first Kanji at +/// half height halves the em box about its baseline, and Kana scaled at center keep the middle of +/// their em box, so their ascent moves up by the half they lose below it. +#[test] +fn sample_lines_follow_vertical_scale() { + let close = |a: f64, b: f64| (a - b).abs() < 1e-6; + let mut f = inter_font(|_| {}); + let mut half = vectorcraft_doc::CompositePart::new("Inter", "Regular"); + half.v_scale = 50.0; + f.custom = vec![CustomCharSet { name: "Half".into(), characters: "永".into(), part: half }]; + let (_, h) = sample::measure(&f, 36.0); + let (bottom, top) = h.em_box.unwrap(); + assert!(close(bottom, (0.38 - 0.5) * 18.0) && close(top, (0.38 + 0.5) * 18.0), "{h:?}"); + let kana = |at_center: bool| { + let mut f = inter_font(|_| {}); + f.parts.kana.size = 300.0; + f.parts.kana.v_scale = 50.0; + f.parts.kana.scale_at_center = at_center; + sample::measure(&f, 36.0).1.ascent_descent.unwrap() + }; + // The Kana, at three times the size, give the highest ascent either way. + let ((_, high), (_, raised)) = (kana(false), kana(true)); + assert!(close(raised, high + 0.38 * 108.0 * 0.5), "{high} {raised}"); +} + +/// The sample adds the first character of each custom set it does not hold yet, and a font whose +/// sets can't be used yet (two sharing a name while it is typed) still draws, without them. +#[test] +fn the_sample_takes_the_custom_sets() { + let mut f = inter_font(|_| {}); + let set = |name: &str, characters: &str| CustomCharSet { + name: name.into(), + characters: characters.into(), + part: vectorcraft_doc::CompositePart::new("Inter", "Regular"), + }; + f.custom = vec![set("Marks", "〒※"), set("Letters", "A")]; + assert_eq!(sample::text(&f), format!("{}〒", sample::TEXT)); + f.custom = vec![set("Marks", "〒"), set("marks", "〒")]; + let (path, h) = sample::measure(&f, 36.0); + assert!(!path.elements().is_empty() && h.cap_height.is_some()); +} + +/// The sample draws a color font's glyphs in their own colors, not in the dialog's text color. +#[test] +fn the_sample_draws_color_glyphs_in_their_colors() { + use vectorcraft_text::test_fonts::{COLOUR_CHAR, colr_family, colr_font}; + vectorcraft_text::FontDb::global().add_font(colr_font(false).expect("the test font builds")); + let mut f = inter_font(|_| {}); + let mut colr = vectorcraft_doc::CompositePart::new(colr_family(false), "Regular"); + colr.size = 300.0; + f.custom = vec![CustomCharSet { name: "Color".into(), characters: COLOUR_CHAR.to_string(), part: colr }]; + let img = sample::draw(&f, 36.0, 120.0, (900, 160), 1.0, egui::Color32::BLACK); + let red = (0..img.height).flat_map(|y| (0..img.width).map(move |x| (x, y))).any(|(x, y)| { + let p = img.pixel(x, y); + p[0] > 200 && p[1] < 60 && p[2] < 60 && p[3] > 200 + }); + assert!(red, "the glyph's red layer is drawn"); + // Max Ascender reaches the top of the color glyph, three times the size of the rest. + let (_, plain) = sample::measure(&inter_font(|_| {}), 36.0); + let (_, tall) = sample::measure(&f, 36.0); + assert!(tall.ascender.unwrap() > plain.ascender.unwrap() * 1.5, "{plain:?} {tall:?}"); +} diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index a6a69d9100..2354b6f3c8 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -5013,6 +5013,10 @@ axis Both И двете Em Box Квадратна касетка (Em Box) x-Height Височина на x ICF Box Касетка ICF + Show Sample Показване на образец + Hide Sample Скриване на образец + Max Ascent/Descent Макс. височина нагоре/надолу + Max Ascender Макс. възходящ елемент @msg `id` is the step reference {r}, which only `run` and `command_batch` resolve `id` е референцията за стъпка {r}, която се разрешава само от `run` и `command_batch` @msg `ids` must be an array of object ids, not {v} `ids` трябва да бъде масив от идентификатори на обекти, а не {v} @msg `colors` must be an array of colors, not {v} `colors` трябва да бъде масив от цветове, а не {v} diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 5da48b6cff..a36b7521e2 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -1676,6 +1676,10 @@ digits Malayalam Malajalam Em Box Em okvir x-Height Visina malih slova ICF Box ICF okvir + Show Sample Prikaži uzorak + Hide Sample Sakrij uzorak + Max Ascent/Descent Maks. visina gore/dolje + Max Ascender Maks. gornji produžetak Copy Color Value (Hex) Kopiraj vrijednost boje (hex) Create New Swatch… Kreiraj novi uzorak boje… Name 40% Naziv 40% diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index e861e61fec..e98f0dd09b 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6972,6 +6972,10 @@ theme Appearance Aparença Em Box Caixa em x-Height Alçada de la x ICF Box Caixa ICF + Show Sample Mostra l'exemple + Hide Sample Amaga l'exemple + Max Ascent/Descent Alçada/profunditat màx. + Max Ascender Ascendent màx. # Average & Join (Object › Path, Cmd+Alt+Shift+J). Average & Join… Mitjana i unió… Average & Join Mitjana i unió diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 1a4d359b93..dd07cb030a 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -1747,6 +1747,10 @@ digits Malayalam Malajálamské Em Box Čtverčík x-Height Výška x ICF Box Rámeček ICF + Show Sample Zobrazit ukázku + Hide Sample Skrýt ukázku + Max Ascent/Descent Max. výška/hloubka + Max Ascender Max. horní dotah Copy Color Value (Hex) Kopírovat hodnotu barvy (hex) Create New Swatch… Vytvořit novou položku vzorníku… Name 40% Název 40 % diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 723766f020..96c485db68 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -2269,6 +2269,10 @@ digits Malayalam Malayalam Em Box Em-felt x-Height x-højde ICF Box ICF-felt + Show Sample Vis eksempel + Hide Sample Skjul eksempel + Max Ascent/Descent Maks. højde/dybde + Max Ascender Maks. overhøjde Copy Color Value (Hex) Kopiér farveværdi (hex) Create New Swatch… Opret ny farveprøve… Name 40% Navn 40% diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 21a07e09e5..85a10b39bd 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5282,6 +5282,10 @@ theme Appearance Erscheinungsbild Cap Height Versalhöhe x-Height x-Höhe ICF Box ICF-Rahmen + Show Sample Muster einblenden + Hide Sample Muster ausblenden + Max Ascent/Descent Max. Höhe/Tiefe + Max Ascender Max. Oberlänge @msg `id` is the step reference {r}, which only `run` and `command_batch` resolve `id` ist der Schrittverweis {r}, den nur `run` und `command_batch` auflösen @msg `ids` must be an array of object ids, not {v} `ids` muss ein Array von Objekt-IDs sein, nicht {v} @msg `colors` must be an array of colors, not {v} `colors` muss ein Array von Farben sein, nicht {v} diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index ebd167f397..3ce4a48110 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5314,6 +5314,10 @@ digits Malayalam Μαλαγιάλαμ Em Box Τετράγωνο em x-Height Ύψος x ICF Box Πλαίσιο ICF + Show Sample Εμφάνιση δείγματος + Hide Sample Απόκρυψη δείγματος + Max Ascent/Descent Μέγ. ύψος/βάθος + Max Ascender Μέγ. άνω επέκταση @msg `id` is the step reference {r}, which only `run` and `command_batch` resolve το `id` είναι η αναφορά βήματος {r}, την οποία αναλύουν μόνο τα `run` και `command_batch` @msg `ids` must be an array of object ids, not {v} το `ids` πρέπει να είναι πίνακας αναγνωριστικών αντικειμένων, όχι {v} @msg `colors` must be an array of colors, not {v} το `colors` πρέπει να είναι πίνακας χρωμάτων, όχι {v} diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 27d7d4aaf8..bcaf070409 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -1024,6 +1024,10 @@ font-technology Variable Variables Em Box Cuadro eme x-Height Altura de la x ICF Box Cuadro ICF + Show Sample Mostrar muestra + Hide Sample Ocultar muestra + Max Ascent/Descent Altura/profundidad máx. + Max Ascender Ascendente máx. Em Dash Raya Em Space Espacio eme Embed Incrustar diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 3f29fd7f7a..1a7bc7ba2e 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -1720,6 +1720,10 @@ digits Malayalam Malajalam Em Box Em-laatikko x-Height x-korkeus ICF Box ICF-laatikko + Show Sample Näytä näyte + Hide Sample Piilota näyte + Max Ascent/Descent Suurin korkeus/syvyys + Max Ascender Suurin yläpidennys Copy Color Value (Hex) Kopioi väriarvo (heksa) Create New Swatch… Luo uusi värimalli… Name 40% Nimi 40% diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 20e94749c5..2a8cb022f6 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5345,6 +5345,10 @@ axis Both Les deux Em Box Cadratin x-Height Hauteur d’x ICF Box Cadre ICF + Show Sample Afficher l'échantillon + Hide Sample Masquer l'échantillon + Max Ascent/Descent Hauteur/profondeur max. + Max Ascender Jambage ascendant max. ICF Top/Right ICF haut/droite ICF Bottom/Left ICF bas/gauche @msg `id` is the step reference {r}, which only `run` and `command_batch` resolve `id` est la référence d’étape {r}, que seuls `run` et `command_batch` résolvent diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index ff59a464c5..6e02028235 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -1729,6 +1729,10 @@ ICC Profile ICC પ્રોફાઇલ ICF Bottom/Left ICF નીચે/ડાબે ICF Box ICF બૉક્સ + Show Sample નમૂનો બતાવો + Hide Sample નમૂનો છુપાવો + Max Ascent/Descent મહત્તમ એસેન્ટ/ડિસેન્ટ + Max Ascender મહત્તમ એસેન્ડર ICF Top/Right ICF ઉપર/જમણે ID: {id} ID: {id} Identify Objects By ઑબ્જેક્ટ્સ આ રીતે ઓળખો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 6fe8f254f4..61262b0e24 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -2358,6 +2358,10 @@ antiAlias Sharp शार्प ICC Profile ICC प्रोफ़ाइल ICF Bottom/Left ICF बॉटम/लेफ्ट ICF Box ICF बॉक्स + Show Sample नमूना दिखाएँ + Hide Sample नमूना छिपाएँ + Max Ascent/Descent अधिकतम एसेंट/डिसेंट + Max Ascender अधिकतम एसेंडर ICF Top/Right ICF ऊपर/दाएँ Identify Objects By ऑब्जेक्ट्स की पहचान करके If a drawing tablet's pen doesn't draw, choose an X11 (XWayland) option. अगर ड्रॉइंग टैबलेट के पेन से ड्रॉ नहीं हो रहा, तो X11 (XWayland) ऑप्शन चुनें। diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 4a93411b47..f544a2841c 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -2139,6 +2139,10 @@ file-filter Templates Sablonok Em Box Kvirtmező x-Height x-magasság ICF Box ICF-mező + Show Sample Minta megjelenítése + Hide Sample Minta elrejtése + Max Ascent/Descent Max. magasság/mélység + Max Ascender Max. felnyúló szár ICF Top/Right ICF teteje/jobb oldala Identify Objects By Objektumok azonosítása Ignore Kihagy diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index bf029526f7..3203386c2b 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -1603,6 +1603,10 @@ digits Malayalam Malayalam Em Box Em Box x-Height Tinggi x ICF Box Kotak ICF + Show Sample Tampilkan contoh + Hide Sample Sembunyikan contoh + Max Ascent/Descent Tinggi/kedalaman maks. + Max Ascender Ascender maks. Copy Color Value (Hex) Salin nilai warna (Hex) Create New Swatch… Buat swatch baru… Name 40% Nama 40% diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 360ec1d5ba..21bb2b3f5c 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -1033,6 +1033,10 @@ font-technology Variable Variabili Cap Height Altezza maiuscole x-Height Altezza x ICF Box Riquadro ICF + Show Sample Mostra campione + Hide Sample Nascondi campione + Max Ascent/Descent Altezza/profondità max + Max Ascender Ascendente max Em Dash Lineetta Em Space Spazio em Embed Incorpora diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 37089bb835..1d45694030 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -49,6 +49,10 @@ font-technology Variable バリアブル Cap Height キャップハイト x-Height x ハイト ICF Box 平均字面 + Show Sample サンプルを表示 + Hide Sample サンプルを隠す + Max Ascent/Descent 最大アセント/ディセント + Max Ascender 最大アセンダ Proportional Metrics プロポーショナルメトリクス H or V Style 横組み・縦組み用かな Roman Italics 欧文イタリック diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 25fb4f87ed..2973e0d974 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -3668,6 +3668,10 @@ digits Malayalam მალაიალამური Em Box Em-ბლოკი x-Height x-სიმაღლე ICF Box ICF-ბლოკი + Show Sample ნიმუშის ჩვენება + Hide Sample ნიმუშის დამალვა + Max Ascent/Descent მაქს. სიმაღლე/სიღრმე + Max Ascender მაქს. ზედა გამონაშვერი Copy Color Value (Hex) ფერის მნიშვნელობის კოპირება (Hex) Create New Swatch… ახალი ფერის ნიმუშის შექმნა… Name 40% სახელი 40% diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 0787180a1c..c83ba8fcac 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -43,6 +43,10 @@ font-technology Variable 가변 Cap Height 대문자 높이 x-Height x 높이 ICF Box ICF 박스 + Show Sample 샘플 표시 + Hide Sample 샘플 숨기기 + Max Ascent/Descent 최대 어센트/디센트 + Max Ascender 최대 어센더 Proportional Metrics 비례 메트릭 H or V Style 가로 또는 세로 스타일 Roman Italics 로마자 이탤릭 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index ab30a3639f..7a58d4268f 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -2165,6 +2165,10 @@ digits Malayalam Malayalam Em Box Em-vak x-Height x-hoogte ICF Box ICF-vak + Show Sample Voorbeeld tonen + Hide Sample Voorbeeld verbergen + Max Ascent/Descent Max. hoogte/diepte + Max Ascender Max. stijger Copy Color Value (Hex) Kleurwaarde kopiëren (Hex) Create New Swatch… Nieuw staal maken… Name 40% Naam 40% diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 085935a9bd..c6565f9917 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -1659,6 +1659,10 @@ digits Malayalam Malajalam Em Box Ramka firetowa x-Height Wysokość x ICF Box Ramka ICF + Show Sample Pokaż próbkę + Hide Sample Ukryj próbkę + Max Ascent/Descent Maks. wysokość/głębokość + Max Ascender Maks. wydłużenie górne Copy Color Value (Hex) Kopiuj wartość koloru (hex) Create New Swatch… Utwórz nową próbkę… Name 40% Nazwa 40% diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 0289161fe4..1b0833c0b1 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -917,6 +917,10 @@ antiAlias Sharp Nítido Em Box Caixa Eme x-Height Altura do x ICF Box Caixa ICF + Show Sample Mostrar Amostra + Hide Sample Ocultar Amostra + Max Ascent/Descent Altura/Profundidade Máx. + Max Ascender Ascendente Máx. Em Dash Travessão Em Space Espaço Em Embed Incorporar diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index e45ac9423a..8ffa9c8294 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -1022,6 +1022,10 @@ font-technology Variable Вариативные Em Box Кегельная площадка x-Height Высота строчных ICF Box Рамка ICF + Show Sample Показать образец + Hide Sample Скрыть образец + Max Ascent/Descent Макс. высота/глубина + Max Ascender Макс. выносной элемент вверх Em Dash Длинное тире Em Space Круглая шпация Embed Внедрить diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 95e7c34b47..5fc69aee4f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5261,6 +5261,10 @@ axis Both Båda Em Box Em-ruta x-Height x-höjd ICF Box ICF-ruta + Show Sample Visa exempel + Hide Sample Dölj exempel + Max Ascent/Descent Max höjd/djup + Max Ascender Max uppstapel @msg `id` is the step reference {r}, which only `run` and `command_batch` resolve `id` är stegreferensen {r}, som bara `run` och `command_batch` löser upp @msg `ids` must be an array of object ids, not {v} `ids` måste vara en array med objekt-id:n, inte {v} @msg `colors` must be an array of colors, not {v} `colors` måste vara en array med färger, inte {v} diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index d8249b1c79..fd7874ca0d 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -5102,6 +5102,10 @@ axis Both Her İkisi Em Box Em Kutusu x-Height x-Yüksekliği ICF Box ICF Kutusu + Show Sample Örneği Göster + Hide Sample Örneği Gizle + Max Ascent/Descent Maks. Yükseklik/Derinlik + Max Ascender Maks. Yükselen @msg `colors` must be an array of colors, not {v} `colors` {v} değil, bir renk dizisi olmalıdır @msg `id` is the step reference {r}, which only `run` and `command_batch` resolve `id`, yalnızca `run` ve `command_batch` komutlarının çözümlediği {r} adım referansıdır @msg `ids` must be an array of object ids, not {v} `ids` bir nesne kimlikleri dizisi olmalıdır, {v} değil diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 8ebb97a5be..23518b48a3 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -1027,6 +1027,10 @@ font-technology Variable Варіативні Cap Height Висота великих літер x-Height Висота малих літер ICF Box Рамка ICF + Show Sample Показати зразок + Hide Sample Приховати зразок + Max Ascent/Descent Макс. висота/глибина + Max Ascender Макс. виносний елемент вгору Em Dash Довге тире Em Space Кругла шпація Embed Вбудувати diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index a9a9cb140a..c7f88b944d 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -1992,6 +1992,10 @@ digits Hindi Hindi Cap Height Chiều cao chữ hoa x-Height Chiều cao chữ x ICF Box Ô ICF + Show Sample Hiện mẫu + Hide Sample Ẩn mẫu + Max Ascent/Descent Độ cao/sâu tối đa + Max Ascender Nét chân chữ trên tối đa ICF Top/Right ICF Trên/Phải Identify Objects By Nhận diện đối tượng theo Ignore Bỏ qua diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index f3a87e6b84..0c9f32b932 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -964,6 +964,10 @@ antiAlias Sharp 锐利 Cap Height 大写字母高度 x-Height x 字高 ICF Box ICF 框 + Show Sample 显示样本 + Hide Sample 隐藏样本 + Max Ascent/Descent 最大上升/下降 + Max Ascender 最大上伸部 Em Dash 长破折号 Em Space 全角空格 Embed 嵌入 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 52715f8360..6f031565c4 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -995,6 +995,10 @@ font-technology Variable 可變 Cap Height 大寫字母高度 x-Height x 字高 ICF Box ICF 框 + Show Sample 顯示樣本 + Hide Sample 隱藏樣本 + Max Ascent/Descent 最大上升/下降 + Max Ascender 最大上伸部 Em Dash 長破折號 Em Space 全形空格 Embed 嵌入 diff --git a/docs/mcp.md b/docs/mcp.md index e623b86cac..cce0bf108f 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -9705,9 +9705,19 @@ font based on the one picked, Delete Font takes it out, Import… adds the fonts picked. Custom shows the font's custom character sets: Character Set picks one, New adds a set based on the one picked, Delete Set takes it out, and Name renames it. Character › Direct Entry adds the characters typed, and Character › Unicode adds the characters of hexadecimal codes (`3042`, `U+3042`, several separated by spaces or commas); Add skips -characters the set already lists. Delete takes the character picked out of the set. OK runs `type.compositeFonts.set` -with every font as one undo step; a refused font keeps the dialog open. `ui.dialog.set` takes `custom`, `entry` and -`char` (the index of the character picked in the set) as soon as the dialog opens. +characters the set already lists. Delete takes the character picked out of the set. Show Sample (Hide Sample when it +shows) draws the font picked in a line of sample text, with the first character of each custom set added, and a button +beside it for each line it can mark: ICF Box, Em Box, Baseline, Cap Height, Max Ascent/Descent, Max Ascender and +x-height ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=300)). +The em box and ICF box are those of the Kanji part's font, the cap height and x-height those of the face the +Roman letters are drawn in (a fallback face when the part's font lacks the character), Max Ascent/Descent the highest +ascent and lowest descent of the faces the sample uses, and Max Ascender the top of its tallest glyph; each takes its +part's size, baseline and vertical scale. Zoom draws it at 25% to 800% of 36 pt. The +sample text, the zoom steps and the size are VectorCraft's own. OK runs `type.compositeFonts.set` with every font as one +undo step; a refused font keeps the dialog open. `ui.dialog.set` takes `custom`, `entry` and `char` (the index of the +character picked in the set) as soon as the dialog opens, and `sample` (true or false), `zoom` (25, 50, 75, 100, 200, +400 or 800) and `lineIcfBox`, `lineEmBox`, `lineBaseline`, `lineCapHeight`, `lineAscentDescent`, `lineAscender` and +`lineXHeight` (true or false; the first three start true); another value is refused. ```json {"name":"run_command","arguments":{"command":"type.compositeFonts.set","params":{"fonts":[{"name":"My Composite","parts":{"kanji":{"font":"Source Han Sans"},"roman":{"font":"Source Sans 3","size":95,"baseline":-2},"numerals":{"font":"Source Sans 3"}}}]}}} diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 65cbf9e216..fce00c8fb2 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -710,6 +710,7 @@ since 2026-10-01. - **Composite fonts that two documents define differently:** when two open documents each define a composite font (Type › Composite Fonts…) by the same name with different parts, each document draws and exports its type in its own definition: in a tiled or floating window drawn while the front document draws, when it is placed in a document that defines the name differently, and in an export made while another document is in front. Evidence: `tests::composite::nested_loans_of_one_name_use_each_documents_definition` and `threads_lending_one_name_at_once_use_their_own_definitions` (`crates/text`), `tests::fontchange::a_placed_document_draws_its_own_definition_of_a_name_the_page_defines` (`crates/render`). Scores unchanged (estimated). - **Composite fonts only another document defines:** a document draws, measures and exports its type only in the composite fonts it defines itself. Type naming a composite font that only another open document, or the document a placed document sits in, defines is set as in a missing font, also when the document defines no composite font: in a window, a thumbnail or an export of a document in the back, in a file being opened and in a placed document. A temporary document drawn while a document draws keeps that document's composite fonts. Evidence: `tests::composite::a_lent_document_does_not_use_another_documents_composite_font` and `a_document_without_composite_fonts_uses_none_and_a_preview_is_unchanged` (`crates/text`), `tests::fontchange::a_placed_document_draws_its_own_definition_of_a_name_the_page_defines` and `a_document_draws_type_in_another_documents_composite_font_as_missing` (`crates/render`), `a_document_replaced_in_the_back_measures_a_font_it_lacks_as_missing` (`crates/engine`). Scores unchanged (estimated). - **Composite fonts' custom character sets:** Type › Composite Fonts… › Custom adds named character sets to a composite font, each setting the characters it lists in its own font, style, size, baseline and scales ahead of their class; the later of two sets that list a character sets it ([the help page](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=348)). Characters are added by Direct Entry or by Unicode code and deleted one at a time; the sets are saved with the document and in `.vccomposite` files (`custom` in `type.compositeFonts.set`). Evidence: `tests::composite::custom_character_sets_take_their_characters_first` (`crates/text`), `compositefonts::tests::custom_character_sets_set_their_characters` (`crates/engine`), `dialogs::composite_fonts::tests::custom_character_sets_are_edited_in_the_dialog` (`crates/ui-egui`). Scores unchanged (estimated). +- **Composite fonts' Show Sample:** Type › Composite Fonts… › Show Sample draws the font picked in a line of sample text with lines for its ICF box, em box, baseline, cap height, highest ascent and lowest descent, highest ascender and x-height, each shown or hidden by its button, at the magnification Zoom picks ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=300)). The sample text, the zoom steps and what each line measures are VectorCraft's own. Evidence: `dialogs::composite_fonts::tests::sample_lines_follow_the_parts`, `show_sample_shows_and_hides_the_sample` and `sample_fields_are_set_and_checked` (`crates/ui-egui`). Scores unchanged (estimated). - **Character-style Auto leading:** capture and explicit style attributes retain Auto as a reset, distinct from omitted leading. Redefine and later numeric updates preserve local leading overrides; the Character Styles marker recognizes Auto correctly. Regression assertions cover partial definitions, Undo/Redo and native save/load serialization. Public references: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html) and [Leading](https://helpx.adobe.com/illustrator/using/line-character-spacing.html). - **Character-style numeric bounds:** `charStyle.new`, `charStyle.edit`, and `charStyle.setAttrs` accept size from 0.1 to 1296 pt, explicit leading from 0.1 to 5000 pt, horizontal and vertical scale from 1% to 10,000%, and baseline shift and Tate-chu-yoko offsets from -1296 to 1296 pt. Out-of-range input leaves the style and Undo history unchanged; Auto leading remains available. These limits match the Character panel controls. - **Character Style Options, General and Basic Character Formats:** the dialog edits a style's name and stored character formats together. Empty fields remain unset, checkboxes show an indeterminate unset state, Basic's Reset Panel clears its explicit settings, and Preview can be canceled without changing history. OK saves one undo step; New Character Style offers the same fields from captured text or the interface language's defaults without a selection. Public reference: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html). diff --git a/docs/type-parity.md b/docs/type-parity.md index e6adf78d09..9576d55d72 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -74,7 +74,7 @@ against Illustrator's public documentation; **estimated** unless noted. | CJK: Standard Vertical Roman Alignment | done | Character panel menu › Standard Vertical Roman Alignment (`text.setFormat` / `text.setRangeStyle {standardVerticalRoman}`), with Show East Asian Options, off by default: in vertical type the marked half-width characters (Latin letters, digits and other characters that would lie on their side) stand upright one below the other, each in its upright cell; spaces keep their width and tate-chu-yoko blocks stay across the column; horizontal type keeps the mark and does not change. Character Style Options has its own checkbox for it. Evidence: `tests_vertical::standard_vertical_roman_alignment_stands_half_width_characters_upright`, `typecmd::standard_vertical_roman_is_a_character_attribute_saved_only_when_on` | | CJK: East Asian glyph forms | done | Glyphs panel menu › Traditional Forms, Expert Forms, JIS 04, JIS 90, JIS 78 and JIS 83 Forms, Monospaced Full-Width, Half-Width, Third-Width and Quarter-Width Forms, and Revert To Default Forms, with Show East Asian Options ([Format East Asian characters](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html)): the selected characters are drawn with the font's OpenType feature for that form (`trad`, `expt`, `jp04`, `jp90`, `jp78`, `jp83`, `fwid`, `hwid`, `twid`, `qwid`; [feature list](https://learn.microsoft.com/en-us/typography/opentype/spec/featurelist)), one form at a time (`text.setFormat` / `text.setRangeStyle {glyphForm}`); a form none of the faces that draw the selected text (fallback faces included) has a feature for (in `GSUB`, or for the width forms `GSUB` or `GPOS`) is disabled, and Revert To Default Forms draws the default glyphs. A form other than the default takes away a character's glyph choice, and with a width form Proportional Metrics' `palt` is not applied and the font's pair kerning is off. Saved natively only when set, carried by character styles, drawn on the canvas and in PDF, and written to SVG as `font-feature-settings`. Character Style Options has no field for it. Evidence: `tests::typo::glyph_forms_draw_the_fonts_east_asian_forms`, `typecmd::area_tests::glyph_form_is_one_character_attribute_saved_only_when_set`, `typecmd::area_tests::a_glyph_form_takes_away_the_characters_glyph_choice`, `features::tests::width_forms_turn_off_proportional_metrics`, `panels::glyphs::tests::east_asian_glyph_forms_in_the_panel_menu_set_the_selected_characters_form`, `panels::glyphs::tests::glyph_form_items_at_a_caret_follow_all_the_text`, `panels::glyphs::tests::a_glyph_choice_lets_the_current_form_be_chosen_again` | | CJK: warichu | done | Character panel menu › Warichu and Warichu Settings… (`text.setFormat` / `text.setRangeStyle {warichu, warichuLines, warichuGap, warichuScale, warichuAlign}`, `ui.warichuSettings`), with Show East Asian Options ([Format East Asian characters](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html)): marked characters set at a percentage of their size and stacked on 1 to 6 lines inside their line, one above the other in horizontal type and side by side in vertical type, with a line gap and eight alignments; a block stays whole on one line. Saved natively, carried by character styles, drawn on the canvas and in every export (SVG, PDF and `.ai` write such type as outlines). Type on a path sets the characters at their own size. Evidence: `tests::warichu`, `dialogs::warichu::tests`, `typecmd::area_tests::warichu_is_a_character_attribute_set_saved_and_exported` | -| CJK: composite fonts | partial | Type › Composite Fonts… (`type.compositeFonts.set`), with Show East Asian Options: a font made of a font per class of character (Kanji, Kana, Punctuation, Symbols, Roman, Numerals), each with its own style, size and baseline in percent of the type's size, Kana, Roman and Numerals with horizontal and vertical scale, and Kana with Scale at Center; New, Delete Font, Import… and Export… (`.vccomposite`, `type.compositeFonts.import` and `.export`) ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=347)); custom character sets (Custom: New, Delete Set, characters added by Direct Entry or Unicode code and deleted), each with its own font, style, size, baseline and scales, ahead of the classes, the later set winning a character two list (`custom` in `type.compositeFonts.set`) ([Customize characters in a composite font](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=348)). Composite fonts are listed first in the font menus, saved with the document, and their type is laid out per set and class; SVG and legacy `.ai` write it as outlines. Not yet: the Units menu, Show Sample. Evidence: `text::composite::tests::characters_fall_in_their_classes`, `text::composite::tests::custom_sets_take_their_characters_before_the_classes`, `tests::composite::composite_type_draws_each_class_in_its_font`, `tests::composite::custom_character_sets_take_their_characters_first`, `compositefonts::tests`, `dialogs::composite_fonts::tests` | +| CJK: composite fonts | partial | Type › Composite Fonts… (`type.compositeFonts.set`), with Show East Asian Options: a font made of a font per class of character (Kanji, Kana, Punctuation, Symbols, Roman, Numerals), each with its own style, size and baseline in percent of the type's size, Kana, Roman and Numerals with horizontal and vertical scale, and Kana with Scale at Center; New, Delete Font, Import… and Export… (`.vccomposite`, `type.compositeFonts.import` and `.export`) ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=347)); custom character sets (Custom: New, Delete Set, characters added by Direct Entry or Unicode code and deleted), each with its own font, style, size, baseline and scales, ahead of the classes, the later set winning a character two list (`custom` in `type.compositeFonts.set`) ([Customize characters in a composite font](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=348)). Composite fonts are listed first in the font menus, saved with the document, and their type is laid out per set and class; SVG and legacy `.ai` write it as outlines. Show Sample draws the font picked with lines for its ICF box, em box, baseline, cap height, highest ascent and lowest descent, highest ascender and x-height, each shown or hidden by its button, at the Zoom picked ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=300)). Not yet: the Units menu. Evidence: `text::composite::tests::characters_fall_in_their_classes`, `text::composite::tests::custom_sets_take_their_characters_before_the_classes`, `tests::composite::composite_type_draws_each_class_in_its_font`, `tests::composite::custom_character_sets_take_their_characters_first`, `compositefonts::tests`, `dialogs::composite_fonts::tests` | | CJK: ruby | partial | ruby (ふりがな) for live text (`type.ruby`): a reading over a byte range, above (right of the column in vertical type) or below, start/centre/end alignment, size, overhang or squeeze; saved natively, laid out with its line growing, drawn on the canvas, in SVG and PDF (as outlines where ruby is present), in EPS, EMF/WMF and legacy `.ai` (legacy `.ai` writes type with ruby as outlines), and kept by Create Outlines, Expand Appearance and flattening, each glyph where the layout puts it (`typecmd::ruby_tests::create_outlines_keeps_the_ruby_where_it_is_laid_out`) | #633 | | Language per character (Character panel › Language, character styles), text shaped in it | done | `text.setFormat` / `text.setRangeStyle {language}` by name or BCP 47 tag, one of Document Setup's languages (Hindi, Marathi, Gujarati, Bengali, Punjabi, Tamil, Telugu, Kannada, Malayalam, Odia and Urdu added, #4943; Assamese and Sanskrit added, #4947; Serbian: Cyrillic, Serbian: Latin and Croatian); the shaper gets the tag, so the font's language forms apply (OpenType `locl`: Turkish keeps `fi` apart and the dot on its i, #4940); new type takes the document's language; saved as the tag only when set, carried by character styles (#4946). English and eleven Indian languages hyphenate by run language; Sanskrit automatic hyphenation awaits allowlisted patterns (#4947). Not yet: `.ai`/PDF import of a text's language, paragraph styles. Evidence: `features::tests::language_picks_the_fonts_forms`, `features::tests::serbian_gets_the_fonts_serbian_forms`, `typecmd::area_tests::language_is_a_character_attribute_saved_only_when_set`, `tests::typo::indic_language_runs_hyphenate_with_both_composers`, `hyphen::tests::sanskrit_without_allowlisted_patterns_uses_only_exceptions`; spelling is checked in each run's Language (`text.spelling.check`, #4936) | | Language per character (Character panel › Language, character styles), text shaped in it | done | `text.setFormat` / `text.setRangeStyle {language}` by name or BCP 47 tag, one of Document Setup's languages (Hindi, Marathi, Gujarati, Bengali, Punjabi, Tamil, Telugu, Kannada, Malayalam, Odia and Urdu added, #4943; Serbian: Cyrillic, Serbian: Latin and Croatian; Bulgarian, #5945); the shaper gets the tag, so the font's language forms apply (OpenType `locl`: Turkish keeps `fi` apart and the dot on its i, #4940); new type takes the document's language; saved as the tag only when set, carried by character styles (#4946). Not yet: hyphenation by it in languages other than English and the eleven Indian languages above, `.ai`/PDF import of a text's language, paragraph styles. Evidence: `features::tests::language_picks_the_fonts_forms`, `features::tests::serbian_gets_the_fonts_serbian_forms`, `typecmd::area_tests::language_is_a_character_attribute_saved_only_when_set`; spelling is checked in each run's Language (`text.spelling.check`, #4936) | From be26bddb7e588d5f4e716b3b0d4db3dff7f6140e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 15 Nov 2026 16:08:25 -0800 Subject: [PATCH 2/2] Type: Show Sample cites the help page that describes it The links to the archived help PDFs now open the page with the Show Sample step (#page=352 in the CS4 help, #page=348 in the CS6 reference) instead of an earlier page. The comments and docs/mcp.md also say which part's face gives the em box and ICF box: the part that sets the sample's first Kanji, which is a custom set when one holds that character. --- crates/ui-egui/src/dialogs/composite_fonts/sample.rs | 12 +++++++----- docs/mcp.md | 6 +++--- docs/target-app-parity.md | 2 +- docs/type-parity.md | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/dialogs/composite_fonts/sample.rs b/crates/ui-egui/src/dialogs/composite_fonts/sample.rs index 952e88be1c..849eb63b51 100644 --- a/crates/ui-egui/src/dialogs/composite_fonts/sample.rs +++ b/crates/ui-egui/src/dialogs/composite_fonts/sample.rs @@ -3,7 +3,8 @@ //! ascender and x-height, each shown or hidden by its button, at the size Zoom picks. //! //! The sample text, the zoom steps, the size at 100% and what each line measures are VectorCraft's -//! own: the em box and ICF box are those of the Kanji part's face +//! own: the em box and ICF box are those of the face of the part that sets the sample's first Kanji +//! (the Kanji part, or a custom set that holds that character) //! ([`vectorcraft_text::FontFace::ideographic_centre`], [`vectorcraft_text::FontFace::icf_margins`]), //! the cap height and x-height those of the face the Roman letters are drawn in, Max Ascent/Descent //! the highest ascent and lowest descent among the faces the sample is drawn in (fallback faces @@ -11,8 +12,8 @@ //! baseline and vertical scale. //! //! Behavior reference (public documentation): -//! , -//! . +//! , +//! . use std::hash::{DefaultHasher, Hash, Hasher}; @@ -225,8 +226,9 @@ pub(super) fn measure(f: &CompositeFont, size: f64) -> (BezPath, Heights) { Some((part_face, drawn, em, shift, p.v_scale / 100.0)) }; let mut h = Heights::default(); - // The em box and ICF box are the Kanji part's, the base of the composite font, as layout - // measures that part's face for Scale at Center. + // The em box and ICF box are those of the part that sets the sample's first Kanji (the Kanji + // part, or a custom set that holds that character), as layout measures that part's face for + // Scale at Center. if let Some((face, _, em, shift, v)) = TEXT.chars().next().and_then(placed) { let tall = em * v; let mid = shift + face.ideographic_centre() * tall; diff --git a/docs/mcp.md b/docs/mcp.md index cce0bf108f..e96d89cf54 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -9708,9 +9708,9 @@ Unicode adds the characters of hexadecimal codes (`3042`, `U+3042`, several sepa characters the set already lists. Delete takes the character picked out of the set. Show Sample (Hide Sample when it shows) draws the font picked in a line of sample text, with the first character of each custom set added, and a button beside it for each line it can mark: ICF Box, Em Box, Baseline, Cap Height, Max Ascent/Descent, Max Ascender and -x-height ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=300)). -The em box and ICF box are those of the Kanji part's font, the cap height and x-height those of the face the -Roman letters are drawn in (a fallback face when the part's font lacks the character), Max Ascent/Descent the highest +x-height ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=352)). +The em box and ICF box are those of the font of the part that sets the sample's first Kanji (the Kanji part, or a +custom set that holds that character), the cap height and x-height those of the face the Roman letters are drawn in (a fallback face when the part's font lacks the character), Max Ascent/Descent the highest ascent and lowest descent of the faces the sample uses, and Max Ascender the top of its tallest glyph; each takes its part's size, baseline and vertical scale. Zoom draws it at 25% to 800% of 36 pt. The sample text, the zoom steps and the size are VectorCraft's own. OK runs `type.compositeFonts.set` with every font as one diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index fce00c8fb2..8d2dfb527c 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -710,7 +710,7 @@ since 2026-10-01. - **Composite fonts that two documents define differently:** when two open documents each define a composite font (Type › Composite Fonts…) by the same name with different parts, each document draws and exports its type in its own definition: in a tiled or floating window drawn while the front document draws, when it is placed in a document that defines the name differently, and in an export made while another document is in front. Evidence: `tests::composite::nested_loans_of_one_name_use_each_documents_definition` and `threads_lending_one_name_at_once_use_their_own_definitions` (`crates/text`), `tests::fontchange::a_placed_document_draws_its_own_definition_of_a_name_the_page_defines` (`crates/render`). Scores unchanged (estimated). - **Composite fonts only another document defines:** a document draws, measures and exports its type only in the composite fonts it defines itself. Type naming a composite font that only another open document, or the document a placed document sits in, defines is set as in a missing font, also when the document defines no composite font: in a window, a thumbnail or an export of a document in the back, in a file being opened and in a placed document. A temporary document drawn while a document draws keeps that document's composite fonts. Evidence: `tests::composite::a_lent_document_does_not_use_another_documents_composite_font` and `a_document_without_composite_fonts_uses_none_and_a_preview_is_unchanged` (`crates/text`), `tests::fontchange::a_placed_document_draws_its_own_definition_of_a_name_the_page_defines` and `a_document_draws_type_in_another_documents_composite_font_as_missing` (`crates/render`), `a_document_replaced_in_the_back_measures_a_font_it_lacks_as_missing` (`crates/engine`). Scores unchanged (estimated). - **Composite fonts' custom character sets:** Type › Composite Fonts… › Custom adds named character sets to a composite font, each setting the characters it lists in its own font, style, size, baseline and scales ahead of their class; the later of two sets that list a character sets it ([the help page](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=348)). Characters are added by Direct Entry or by Unicode code and deleted one at a time; the sets are saved with the document and in `.vccomposite` files (`custom` in `type.compositeFonts.set`). Evidence: `tests::composite::custom_character_sets_take_their_characters_first` (`crates/text`), `compositefonts::tests::custom_character_sets_set_their_characters` (`crates/engine`), `dialogs::composite_fonts::tests::custom_character_sets_are_edited_in_the_dialog` (`crates/ui-egui`). Scores unchanged (estimated). -- **Composite fonts' Show Sample:** Type › Composite Fonts… › Show Sample draws the font picked in a line of sample text with lines for its ICF box, em box, baseline, cap height, highest ascent and lowest descent, highest ascender and x-height, each shown or hidden by its button, at the magnification Zoom picks ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=300)). The sample text, the zoom steps and what each line measures are VectorCraft's own. Evidence: `dialogs::composite_fonts::tests::sample_lines_follow_the_parts`, `show_sample_shows_and_hides_the_sample` and `sample_fields_are_set_and_checked` (`crates/ui-egui`). Scores unchanged (estimated). +- **Composite fonts' Show Sample:** Type › Composite Fonts… › Show Sample draws the font picked in a line of sample text with lines for its ICF box, em box, baseline, cap height, highest ascent and lowest descent, highest ascender and x-height, each shown or hidden by its button, at the magnification Zoom picks ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=352)). The sample text, the zoom steps and what each line measures are VectorCraft's own. Evidence: `dialogs::composite_fonts::tests::sample_lines_follow_the_parts`, `show_sample_shows_and_hides_the_sample` and `sample_fields_are_set_and_checked` (`crates/ui-egui`). Scores unchanged (estimated). - **Character-style Auto leading:** capture and explicit style attributes retain Auto as a reset, distinct from omitted leading. Redefine and later numeric updates preserve local leading overrides; the Character Styles marker recognizes Auto correctly. Regression assertions cover partial definitions, Undo/Redo and native save/load serialization. Public references: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html) and [Leading](https://helpx.adobe.com/illustrator/using/line-character-spacing.html). - **Character-style numeric bounds:** `charStyle.new`, `charStyle.edit`, and `charStyle.setAttrs` accept size from 0.1 to 1296 pt, explicit leading from 0.1 to 5000 pt, horizontal and vertical scale from 1% to 10,000%, and baseline shift and Tate-chu-yoko offsets from -1296 to 1296 pt. Out-of-range input leaves the style and Undo history unchanged; Auto leading remains available. These limits match the Character panel controls. - **Character Style Options, General and Basic Character Formats:** the dialog edits a style's name and stored character formats together. Empty fields remain unset, checkboxes show an indeterminate unset state, Basic's Reset Panel clears its explicit settings, and Preview can be canceled without changing history. OK saves one undo step; New Character Style offers the same fields from captured text or the interface language's defaults without a selection. Public reference: [Character and paragraph styles](https://helpx.adobe.com/illustrator/using/character-paragraph-styles.html). diff --git a/docs/type-parity.md b/docs/type-parity.md index 9576d55d72..823b559a2e 100644 --- a/docs/type-parity.md +++ b/docs/type-parity.md @@ -74,7 +74,7 @@ against Illustrator's public documentation; **estimated** unless noted. | CJK: Standard Vertical Roman Alignment | done | Character panel menu › Standard Vertical Roman Alignment (`text.setFormat` / `text.setRangeStyle {standardVerticalRoman}`), with Show East Asian Options, off by default: in vertical type the marked half-width characters (Latin letters, digits and other characters that would lie on their side) stand upright one below the other, each in its upright cell; spaces keep their width and tate-chu-yoko blocks stay across the column; horizontal type keeps the mark and does not change. Character Style Options has its own checkbox for it. Evidence: `tests_vertical::standard_vertical_roman_alignment_stands_half_width_characters_upright`, `typecmd::standard_vertical_roman_is_a_character_attribute_saved_only_when_on` | | CJK: East Asian glyph forms | done | Glyphs panel menu › Traditional Forms, Expert Forms, JIS 04, JIS 90, JIS 78 and JIS 83 Forms, Monospaced Full-Width, Half-Width, Third-Width and Quarter-Width Forms, and Revert To Default Forms, with Show East Asian Options ([Format East Asian characters](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html)): the selected characters are drawn with the font's OpenType feature for that form (`trad`, `expt`, `jp04`, `jp90`, `jp78`, `jp83`, `fwid`, `hwid`, `twid`, `qwid`; [feature list](https://learn.microsoft.com/en-us/typography/opentype/spec/featurelist)), one form at a time (`text.setFormat` / `text.setRangeStyle {glyphForm}`); a form none of the faces that draw the selected text (fallback faces included) has a feature for (in `GSUB`, or for the width forms `GSUB` or `GPOS`) is disabled, and Revert To Default Forms draws the default glyphs. A form other than the default takes away a character's glyph choice, and with a width form Proportional Metrics' `palt` is not applied and the font's pair kerning is off. Saved natively only when set, carried by character styles, drawn on the canvas and in PDF, and written to SVG as `font-feature-settings`. Character Style Options has no field for it. Evidence: `tests::typo::glyph_forms_draw_the_fonts_east_asian_forms`, `typecmd::area_tests::glyph_form_is_one_character_attribute_saved_only_when_set`, `typecmd::area_tests::a_glyph_form_takes_away_the_characters_glyph_choice`, `features::tests::width_forms_turn_off_proportional_metrics`, `panels::glyphs::tests::east_asian_glyph_forms_in_the_panel_menu_set_the_selected_characters_form`, `panels::glyphs::tests::glyph_form_items_at_a_caret_follow_all_the_text`, `panels::glyphs::tests::a_glyph_choice_lets_the_current_form_be_chosen_again` | | CJK: warichu | done | Character panel menu › Warichu and Warichu Settings… (`text.setFormat` / `text.setRangeStyle {warichu, warichuLines, warichuGap, warichuScale, warichuAlign}`, `ui.warichuSettings`), with Show East Asian Options ([Format East Asian characters](https://helpx.adobe.com/illustrator/using/formatting-asian-characters.html)): marked characters set at a percentage of their size and stacked on 1 to 6 lines inside their line, one above the other in horizontal type and side by side in vertical type, with a line gap and eight alignments; a block stays whole on one line. Saved natively, carried by character styles, drawn on the canvas and in every export (SVG, PDF and `.ai` write such type as outlines). Type on a path sets the characters at their own size. Evidence: `tests::warichu`, `dialogs::warichu::tests`, `typecmd::area_tests::warichu_is_a_character_attribute_set_saved_and_exported` | -| CJK: composite fonts | partial | Type › Composite Fonts… (`type.compositeFonts.set`), with Show East Asian Options: a font made of a font per class of character (Kanji, Kana, Punctuation, Symbols, Roman, Numerals), each with its own style, size and baseline in percent of the type's size, Kana, Roman and Numerals with horizontal and vertical scale, and Kana with Scale at Center; New, Delete Font, Import… and Export… (`.vccomposite`, `type.compositeFonts.import` and `.export`) ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=347)); custom character sets (Custom: New, Delete Set, characters added by Direct Entry or Unicode code and deleted), each with its own font, style, size, baseline and scales, ahead of the classes, the later set winning a character two list (`custom` in `type.compositeFonts.set`) ([Customize characters in a composite font](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=348)). Composite fonts are listed first in the font menus, saved with the document, and their type is laid out per set and class; SVG and legacy `.ai` write it as outlines. Show Sample draws the font picked with lines for its ICF box, em box, baseline, cap height, highest ascent and lowest descent, highest ascender and x-height, each shown or hidden by its button, at the Zoom picked ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=300)). Not yet: the Units menu. Evidence: `text::composite::tests::characters_fall_in_their_classes`, `text::composite::tests::custom_sets_take_their_characters_before_the_classes`, `tests::composite::composite_type_draws_each_class_in_its_font`, `tests::composite::custom_character_sets_take_their_characters_first`, `compositefonts::tests`, `dialogs::composite_fonts::tests` | +| CJK: composite fonts | partial | Type › Composite Fonts… (`type.compositeFonts.set`), with Show East Asian Options: a font made of a font per class of character (Kanji, Kana, Punctuation, Symbols, Roman, Numerals), each with its own style, size and baseline in percent of the type's size, Kana, Roman and Numerals with horizontal and vertical scale, and Kana with Scale at Center; New, Delete Font, Import… and Export… (`.vccomposite`, `type.compositeFonts.import` and `.export`) ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs3/illustrator_cs3_help.pdf#page=347)); custom character sets (Custom: New, Delete Set, characters added by Direct Entry or Unicode code and deleted), each with its own font, style, size, baseline and scales, ahead of the classes, the later set winning a character two list (`custom` in `type.compositeFonts.set`) ([Customize characters in a composite font](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=348)). Composite fonts are listed first in the font menus, saved with the document, and their type is laid out per set and class; SVG and legacy `.ai` write it as outlines. Show Sample draws the font picked with lines for its ICF box, em box, baseline, cap height, highest ascent and lowest descent, highest ascender and x-height, each shown or hidden by its button, at the Zoom picked ([Creating composite fonts](https://help.adobe.com/archive/en_US/illustrator/cs4/illustrator_cs4_help.pdf#page=352)). Not yet: the Units menu. Evidence: `text::composite::tests::characters_fall_in_their_classes`, `text::composite::tests::custom_sets_take_their_characters_before_the_classes`, `tests::composite::composite_type_draws_each_class_in_its_font`, `tests::composite::custom_character_sets_take_their_characters_first`, `compositefonts::tests`, `dialogs::composite_fonts::tests` | | CJK: ruby | partial | ruby (ふりがな) for live text (`type.ruby`): a reading over a byte range, above (right of the column in vertical type) or below, start/centre/end alignment, size, overhang or squeeze; saved natively, laid out with its line growing, drawn on the canvas, in SVG and PDF (as outlines where ruby is present), in EPS, EMF/WMF and legacy `.ai` (legacy `.ai` writes type with ruby as outlines), and kept by Create Outlines, Expand Appearance and flattening, each glyph where the layout puts it (`typecmd::ruby_tests::create_outlines_keeps_the_ruby_where_it_is_laid_out`) | #633 | | Language per character (Character panel › Language, character styles), text shaped in it | done | `text.setFormat` / `text.setRangeStyle {language}` by name or BCP 47 tag, one of Document Setup's languages (Hindi, Marathi, Gujarati, Bengali, Punjabi, Tamil, Telugu, Kannada, Malayalam, Odia and Urdu added, #4943; Assamese and Sanskrit added, #4947; Serbian: Cyrillic, Serbian: Latin and Croatian); the shaper gets the tag, so the font's language forms apply (OpenType `locl`: Turkish keeps `fi` apart and the dot on its i, #4940); new type takes the document's language; saved as the tag only when set, carried by character styles (#4946). English and eleven Indian languages hyphenate by run language; Sanskrit automatic hyphenation awaits allowlisted patterns (#4947). Not yet: `.ai`/PDF import of a text's language, paragraph styles. Evidence: `features::tests::language_picks_the_fonts_forms`, `features::tests::serbian_gets_the_fonts_serbian_forms`, `typecmd::area_tests::language_is_a_character_attribute_saved_only_when_set`, `tests::typo::indic_language_runs_hyphenate_with_both_composers`, `hyphen::tests::sanskrit_without_allowlisted_patterns_uses_only_exceptions`; spelling is checked in each run's Language (`text.spelling.check`, #4936) | | Language per character (Character panel › Language, character styles), text shaped in it | done | `text.setFormat` / `text.setRangeStyle {language}` by name or BCP 47 tag, one of Document Setup's languages (Hindi, Marathi, Gujarati, Bengali, Punjabi, Tamil, Telugu, Kannada, Malayalam, Odia and Urdu added, #4943; Serbian: Cyrillic, Serbian: Latin and Croatian; Bulgarian, #5945); the shaper gets the tag, so the font's language forms apply (OpenType `locl`: Turkish keeps `fi` apart and the dot on its i, #4940); new type takes the document's language; saved as the tag only when set, carried by character styles (#4946). Not yet: hyphenation by it in languages other than English and the eleven Indian languages above, `.ai`/PDF import of a text's language, paragraph styles. Evidence: `features::tests::language_picks_the_fonts_forms`, `features::tests::serbian_gets_the_fonts_serbian_forms`, `typecmd::area_tests::language_is_a_character_attribute_saved_only_when_set`; spelling is checked in each run's Language (`text.spelling.check`, #4936) |