Merge pull request #8181 from dotCooCoo/feat/area-type-first-baseline-em-box

Type: Area Type Options First Baseline offers Em Box Height
This commit is contained in:
BFlat
2026-11-18 10:22:23 +07:00
committed by GitHub
43 changed files with 281 additions and 11 deletions
+2
View File
@@ -631,6 +631,8 @@ pub enum FirstBaseline {
XHeight,
/// The first line's leading.
Leading,
/// The top of the first line's ideographic em box touches the frame top.
EmBoxHeight,
/// Exactly `first_baseline_min` below the top.
Fixed,
}
+14
View File
@@ -647,6 +647,20 @@ fn text_flow_is_saved_only_when_by_rows() {
assert!(serde_json::from_value::<AreaOptions>(serde_json::json!({"flow": "diagonal"})).is_err());
}
/// First Baseline Em Box Height saves as `emBoxHeight` with its minimum and reads back; files from
/// before it read their own first baseline as they did, Ascent when they have none.
#[test]
fn em_box_height_first_baseline_is_saved_and_read_back() {
let set = AreaOptions { first_baseline: FirstBaseline::EmBoxHeight, first_baseline_min: 9.0, ..AreaOptions::default() };
let saved = serde_json::to_value(&set).unwrap();
assert_eq!((saved["firstBaseline"].as_str(), saved["firstBaselineMin"].as_f64()), (Some("emBoxHeight"), Some(9.0)));
assert_eq!(serde_json::from_value::<AreaOptions>(saved).unwrap(), set);
let old = serde_json::json!({"firstBaseline": "leading", "firstBaselineMin": 3.0});
assert_eq!(serde_json::from_value::<AreaOptions>(old).unwrap().first_baseline, FirstBaseline::Leading);
assert_eq!(serde_json::from_value::<AreaOptions>(serde_json::json!({})).unwrap().first_baseline, FirstBaseline::Ascent);
assert!(serde_json::from_value::<AreaOptions>(serde_json::json!({"firstBaseline": "emBox"})).is_err());
}
/// 120 × 40 area type at (40, 40), its text drawn at twice its size.
fn area_type() -> TextObject {
let mut t = TextObject::point(Point::ZERO, "Some text", CharStyle::default());
+1 -1
View File
@@ -95,7 +95,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Area Type Options…",
["Type"],
None,
"{ids?|id?, width?: pt, height?: pt, rows?, columns?, gutter?: pt (between rows and columns), rowGutter?: pt|null (between rows when it differs from gutter, which is then between columns; gutter given alone sets both; the reply gives the rows' gutter either way), inset?: pt, firstBaseline?: ascent|capHeight|xHeight|leading|fixed, firstBaselineMin?: pt, verticalAlign?: top|center|bottom|justify, flow?: columns|rows (Text Flow: down each column's rows, then across, the default; or across each row's columns, then down), fit?: none|autoHeight|shrinkText|block, fitMinPercent?: 10..100, wordGap?: % 0..1000, lineGap?: pt -1296..1296, …the keys of its own reply (it can be passed back; the values it only reports are ignored)} set the selected area type's options (each frame takes the options given over its own and keeps the rest; fit resolves against each frame's own; options that change nothing add no undo step); width and height size the type area from its top-left corner, along the type's own axes, and the text reflows at its size (with fit autoHeight, Auto Size, the frame's height follows the text after every edit and height is ignored; setting the height by hand turns it off); fit shrinkText scales overflowing text down (size, leading, baseline shift) by the largest factor down to fitMinPercent % (default 50) that makes it fit; fit block is Dynamic Text's Block, as type.dynamicText sets it (in place of Auto Size and Shrink Text to Fit; threaded frames are refused; another fit turns it off, keeping the sizes it wrote), and wordGap and lineGap set its gaps (kept while Block is off; out of range is an error) (none given: query) → the first object's options, plus wordGap and lineGap, overflow (the text doesn't fit its frame) and fitScale (Shrink Text's factor, 1 unshrunk)",
"{ids?|id?, width?: pt, height?: pt, rows?, columns?, gutter?: pt (between rows and columns), rowGutter?: pt|null (between rows when it differs from gutter, which is then between columns; gutter given alone sets both; the reply gives the rows' gutter either way), inset?: pt, firstBaseline?: ascent|capHeight|xHeight|leading|emBoxHeight|fixed (emBoxHeight: the top of the first line's ideographic em box, the largest on the line, touches the top of the type area inside the inset), firstBaselineMin?: pt (the least distance from that top to the first baseline; with fixed, the distance), verticalAlign?: top|center|bottom|justify, flow?: columns|rows (Text Flow: down each column's rows, then across, the default; or across each row's columns, then down), fit?: none|autoHeight|shrinkText|block, fitMinPercent?: 10..100, wordGap?: % 0..1000, lineGap?: pt -1296..1296, …the keys of its own reply (it can be passed back; the values it only reports are ignored)} set the selected area type's options (each frame takes the options given over its own and keeps the rest; fit resolves against each frame's own; options that change nothing add no undo step); width and height size the type area from its top-left corner, along the type's own axes, and the text reflows at its size (with fit autoHeight, Auto Size, the frame's height follows the text after every edit and height is ignored; setting the height by hand turns it off); fit shrinkText scales overflowing text down (size, leading, baseline shift) by the largest factor down to fitMinPercent % (default 50) that makes it fit; fit block is Dynamic Text's Block, as type.dynamicText sets it (in place of Auto Size and Shrink Text to Fit; threaded frames are refused; another fit turns it off, keeping the sizes it wrote), and wordGap and lineGap set its gaps (kept while Block is off; out of range is an error) (none given: query) → the first object's options, plus wordGap and lineGap, overflow (the text doesn't fit its frame) and fitScale (Shrink Text's factor, 1 unshrunk)",
has_selection,
area_options
),
@@ -2796,6 +2796,44 @@ fn area_options_columns_change_layout() {
assert!(s.execute("text.areaOptions", &json!({"firstBaseline": "nope"})).is_err());
}
/// First Baseline Em Box Height: set, reported and undone like the other kinds, with Min as the
/// least distance; setting it again adds no undo step, and the refusal of an unknown kind lists it.
#[test]
fn area_options_set_the_em_box_height_first_baseline() {
let mut s = Session::new();
s.execute("file.new", &json!({"width": 400, "height": 400})).unwrap();
let id = s.execute("text.create", &json!({"x": 10, "y": 10, "text": "word ".repeat(20), "area": {"width": 300, "height": 120}})).unwrap()["id"]
.as_u64()
.unwrap();
s.execute("select.set", &json!({"ids": [id]})).unwrap();
let first = |s: &Session| match &s.doc().unwrap().doc.node(NodeId(id)).unwrap().kind {
NodeKind::Text(t) => vectorcraft_text::layout(vectorcraft_text::FontDb::global(), t).lines[0].first_baseline,
_ => panic!("area type"),
};
let ascent = first(&s);
let r = s.execute("text.areaOptions", &json!({"firstBaseline": "emBoxHeight"})).unwrap();
assert_eq!((r["firstBaseline"].as_str(), r["firstBaselineMin"].as_f64()), (Some("emBoxHeight"), Some(0.0)));
let em_box = first(&s);
assert!(em_box > 0.0 && (em_box - ascent).abs() > 0.1, "{em_box} {ascent}");
let steps = s.doc().unwrap().history.undo.len();
s.execute("text.areaOptions", &json!({"firstBaseline": "emBoxHeight"})).unwrap();
assert_eq!(s.doc().unwrap().history.undo.len(), steps, "no change, no undo step");
// A Min nearer the top keeps the em box; one further down is the distance.
s.execute("text.areaOptions", &json!({"firstBaselineMin": em_box / 2.0})).unwrap();
assert!((first(&s) - em_box).abs() < 1e-9);
let r = s.execute("text.areaOptions", &json!({"firstBaselineMin": 30})).unwrap();
assert_eq!((r["firstBaseline"].as_str(), r["firstBaselineMin"].as_f64()), (Some("emBoxHeight"), Some(30.0)));
assert!((first(&s) - 30.0).abs() < 1e-9);
for _ in 0..3 {
s.execute("edit.undo", &json!({})).unwrap();
}
assert_eq!(s.execute("text.areaOptions", &json!({})).unwrap()["firstBaseline"], "ascent");
assert!((first(&s) - ascent).abs() < 1e-9);
let e = s.execute("text.areaOptions", &json!({"firstBaseline": "emBox"})).unwrap_err().to_string();
assert!(e.contains("emBoxHeight"), "{e}");
assert_eq!(s.execute("text.areaOptions", &json!({})).unwrap()["firstBaseline"], "ascent");
}
/// `rowGutter` sets a gutter between rows of its own, the reply passes it back, and a gutter
/// given alone is the rows' and the columns' again.
#[test]
+31
View File
@@ -5783,6 +5783,37 @@ fn an_empty_last_frame_keeps_the_style_of_the_last_paragraph() {
assert_eq!(justify, [Justify::Left, Justify::Right]);
}
/// Each First Baseline kind the text document holds, Em Box Height included, comes back with its
/// minimum, without a warning.
#[test]
fn every_first_baseline_kind_comes_back_with_its_minimum() {
use vectorcraft_doc::{FirstBaseline, TextKind, TextObject};
for (kind, min) in [
(FirstBaseline::Ascent, 0.0),
(FirstBaseline::CapHeight, 6.0),
(FirstBaseline::XHeight, 0.0),
(FirstBaseline::Leading, 4.0),
(FirstBaseline::EmBoxHeight, 0.0),
(FirstBaseline::EmBoxHeight, 18.5),
(FirstBaseline::Fixed, 40.0),
] {
let mut d = Document::new(300.0, 200.0);
let layer = d.layers[0].id;
let mut area = TextObject::point(vectorcraft_geom::Point::ZERO, "Area", style(12.0, Color::BLACK));
area.kind = TextKind::Area { frame: shapes::rectangle(Rect::new(20.0, 20.0, 140.0, 160.0)) };
area.xf = Affine::IDENTITY;
area.area.first_baseline = kind;
area.area.first_baseline_min = min;
let n = text_node(&mut d, area);
d.insert(Some(layer), usize::MAX, n).unwrap();
let warnings = export_ai_editing(&d, &opts()).unwrap().warnings;
assert!(warnings.is_empty(), "{kind:?}: {warnings:?}");
let back = read_back(&d);
let NodeKind::Text(t) = &back.layers[0].children().unwrap()[0].kind else { panic!("type") };
assert_eq!((t.area.first_baseline, t.area.first_baseline_min), (kind, min), "{kind:?}");
}
}
/// A minimum first baseline with the Ascent first baseline is reported, and kept with the others.
/// An end bracket of an open path that the reader would read as none is reported, and one further
/// from the path's end comes back.
@@ -1004,6 +1004,7 @@ impl TextDoc {
FirstBaseline::CapHeight => Some(2),
FirstBaseline::Leading => Some(3),
FirstBaseline::XHeight => Some(4),
FirstBaseline::EmBoxHeight => Some(5),
};
if let Some(k) = kind {
data.push((10, dict(vec![(0, V::Int(k)), (1, real(o.first_baseline_min / scale))])));
+7 -5
View File
@@ -345,8 +345,9 @@ impl AreaFrame {
2 => F::CapHeight,
3 => F::Leading,
4 => F::XHeight,
// Em Box Height (5) and Legacy (6) have no first baseline of their own here: the
// first baseline stays as it was.
5 => F::EmBoxHeight,
// Legacy (6) has no first baseline of its own here: the first baseline stays as it
// was.
_ => return None,
};
Some((kind, length(b.get("1")).unwrap_or(0.0)))
@@ -2944,12 +2945,12 @@ mod tests {
#[test]
fn area_frame_first_baseline_kinds_and_minimum_are_read() {
use vectorcraft_doc::FirstBaseline as F;
for (code, kind) in [(0, F::Fixed), (2, F::CapHeight), (3, F::Leading), (4, F::XHeight)] {
for (code, kind) in [(0, F::Fixed), (2, F::CapHeight), (3, F::Leading), (4, F::XHeight), (5, F::EmBoxHeight)] {
let a = area_of(vec![area_frame(&format!("/10 << /0 {code} /1 30 >>"))], 0, 2.0);
assert_eq!((a.first_baseline, a.first_baseline_min), (kind, 60.0), "code {code}");
}
// A kind without its own first baseline here, or none known, leaves Ascent.
for code in ["1", "5", "6", "7", "-1", "2.5", "(x)"] {
for code in ["1", "6", "7", "-1", "2.5", "(x)"] {
let a = area_of(vec![area_frame(&format!("/10 << /0 {code} /1 30 >>"))], 0, 1.0);
assert_eq!((a.first_baseline, a.first_baseline_min), (F::Ascent, 0.0), "code {code}");
}
@@ -2980,9 +2981,10 @@ mod tests {
};
let placed = |options: &str| placed_in(&[options]);
assert_eq!(placed("/10 << /0 2 /1 0 >>"), (false, vectorcraft_doc::FirstBaseline::CapHeight));
assert_eq!(placed("/10 << /0 5 /1 0 >>"), (false, vectorcraft_doc::FirstBaseline::EmBoxHeight));
// Without one (Ascent), or with one that isn't read, the line goes where the file has it.
assert_eq!(placed(""), (true, vectorcraft_doc::FirstBaseline::Fixed));
assert_eq!(placed("/10 << /0 5 /1 0 >>"), (true, vectorcraft_doc::FirstBaseline::Fixed));
assert_eq!(placed("/10 << /0 6 /1 0 >>"), (true, vectorcraft_doc::FirstBaseline::Fixed));
// Another frame of the thread keeping one doesn't count for the first.
assert_eq!(placed_in(&["", "/10 << /0 2 /1 0 >>"]), (true, vectorcraft_doc::FirstBaseline::Fixed));
}
+1
View File
@@ -47,6 +47,7 @@ impl Metrics {
FirstBaseline::CapHeight => self.cap,
FirstBaseline::XHeight => self.xh,
FirstBaseline::Leading => self.lead,
FirstBaseline::EmBoxHeight => self.top,
FirstBaseline::Fixed => 0.0,
};
v.max(min)
+42 -2
View File
@@ -1360,6 +1360,40 @@ fn inset_and_first_baseline_options() {
assert!(cap.lines[0].baseline < base.lines[0].baseline && cap.lines[0].baseline > 5.0);
}
/// First Baseline Em Box Height: the top of the first line's ideographic em box (the one leading
/// measured from em box top to top uses) touches the top of the type area inside the inset. On a
/// line of several sizes the largest em box decides, and a Min further down sets the baseline.
#[test]
fn em_box_height_puts_the_first_lines_em_box_top_at_the_type_area_top() {
let frame = Rect::new(0.0, 0.0, 300.0, 300.0);
let em_box = |t: &TextObject, inset: f64, min: f64| {
let opts = LayoutOptions { first_baseline: FirstBaseline::EmBoxHeight, first_baseline_min: min, inset, ..Default::default() };
layout_with(db(), t, &opts).lines[0].baseline
};
// The em box top the EmBoxTop leading model sets a frame's first line at.
let em_top = |t: &TextObject| {
let mut t = t.clone();
t.para.leading_model = vectorcraft_doc::LeadingModel::EmBoxTop;
layout(db(), &t).lines[0].baseline
};
let t = area(COPY, style(12.0), frame, Justify::Left);
let top = em_top(&t);
assert!(top > 5.0 && top < 12.0, "{top}");
let ascent = layout(db(), &t).lines[0].baseline;
assert!((top - ascent).abs() > 0.1, "not the ascent: {top} {ascent}");
assert!((em_box(&t, 0.0, 0.0) - top).abs() < 1e-9);
assert!((em_box(&t, 10.0, 0.0) - (10.0 + top)).abs() < 1e-9, "measured from the inset");
// A Min nearer the top than the em box changes nothing; one further down is the baseline.
assert!((em_box(&t, 10.0, top / 2.0) - (10.0 + top)).abs() < 1e-9);
assert!((em_box(&t, 10.0, 30.0) - 40.0).abs() < 1e-9);
// 10 pt and 20 pt on the first line: the 20 pt em box top is at the top.
let mut mixed = area("small Large", style(10.0), frame, Justify::Left);
mixed.runs = vec![run("small ", 10.0), run("Large", 20.0)];
let large = area("Large", style(20.0), frame, Justify::Left);
assert!((em_box(&mixed, 0.0, 0.0) - em_box(&large, 0.0, 0.0)).abs() < 1e-9);
assert!((em_box(&large, 0.0, 0.0) - 2.0 * top * 10.0 / 12.0).abs() < 1e-6);
}
/// `LineInfo::first_baseline`: each line that starts a column has its baseline that far below the
/// column's top inside the inset, for every first baseline option, with and without a minimum and
/// an inset, in both leading models, and for lines of several sizes (each line in one size).
@@ -1374,8 +1408,14 @@ fn lines_starting_a_column_sit_at_their_first_baseline() {
let text: String = runs.iter().map(|r| r.text.as_str()).collect();
let mut other_sizes = 0;
for model in [vectorcraft_doc::LeadingModel::RomanBaseline, vectorcraft_doc::LeadingModel::EmBoxTop] {
for first_baseline in [FirstBaseline::Ascent, FirstBaseline::CapHeight, FirstBaseline::XHeight, FirstBaseline::Leading, FirstBaseline::Fixed]
{
for first_baseline in [
FirstBaseline::Ascent,
FirstBaseline::CapHeight,
FirstBaseline::XHeight,
FirstBaseline::Leading,
FirstBaseline::EmBoxHeight,
FirstBaseline::Fixed,
] {
for (first_baseline_min, inset) in [(0.0, 0.0), (18.0, 6.0)] {
for height in [100.0, 120.0, 140.0] {
let mut t = area(&text, style(12.0), Rect::new(0.0, 0.0, 420.0, height), Justify::Left);
+26
View File
@@ -142,6 +142,32 @@ fn fit_first_line_widens_a_vertical_frame_from_its_right_edge() {
assert_eq!(layout(FontDb::global(), &t).lines.len(), 1);
}
/// First Baseline Em Box Height in vertical area type: the first column's em box edge touches the
/// frame's right edge inside the inset, as far in as leading measured from em box top to top sets
/// it.
#[test]
fn em_box_height_sets_a_vertical_frames_first_column_at_its_em_box() {
use vectorcraft_doc::{FirstBaseline, LeadingModel};
let first = |fb: FirstBaseline, model: LeadingModel| {
let mut t = vertical("§§");
t.kind = TextKind::Area { frame: PathData::from_bezpath(&Rect::new(0.0, 0.0, 100.0, 105.0).to_path(0.1)) };
t.area.first_baseline = fb;
t.area.inset = 5.0;
t.para.leading_model = model;
let l = layout(FontDb::global(), &t);
(l.lines[0].baseline, l.lines[0].first_baseline)
};
let (baseline, distance) = first(FirstBaseline::EmBoxHeight, LeadingModel::RomanBaseline);
let (em_top, _) = first(FirstBaseline::Ascent, LeadingModel::EmBoxTop);
let (ascent, ascent_distance) = first(FirstBaseline::Ascent, LeadingModel::RomanBaseline);
assert!((baseline - em_top).abs() < 1e-9, "{baseline} {em_top}");
// Measured from the edge inside the inset, where a Fixed first baseline of 0 sits.
let (edge, _) = first(FirstBaseline::Fixed, LeadingModel::RomanBaseline);
assert!((baseline - distance - edge).abs() < 1e-9, "{baseline} {distance} {edge}");
assert!((ascent - ascent_distance - edge).abs() < 1e-9, "{ascent} {ascent_distance} {edge}");
assert!((baseline - ascent).abs() > 0.1, "not the ascent: {baseline} {ascent}");
}
/// `baselines`: one per line that holds characters, along it for horizontal type and down the
/// column's centre line for vertical type (where point type's anchor is); none on a path.
#[test]
+1 -1
View File
@@ -231,7 +231,7 @@ fn a_warichu_line_keeps_the_auto_leading_of_its_own_size() {
#[test]
fn the_first_baseline_measures_a_block_at_its_own_size() {
use vectorcraft_doc::FirstBaseline;
for first in [FirstBaseline::Ascent, FirstBaseline::CapHeight, FirstBaseline::XHeight, FirstBaseline::Leading] {
for first in [FirstBaseline::Ascent, FirstBaseline::CapHeight, FirstBaseline::XHeight, FirstBaseline::Leading, FirstBaseline::EmBoxHeight] {
let baseline = |inside: CharStyle| {
let mut t = area("", style(20.0), Rect::new(0.0, 0.0, 300.0, 300.0), Justify::Left);
t.area.first_baseline = first;
+37 -2
View File
@@ -250,8 +250,14 @@ const PATH_ALIGN: form::Choices = &[("Ascender", "ascender"), ("Descender", "des
const AREA_FIT: form::Choices = &[("None", "none"), ("Auto Size", "autoHeight"), ("Shrink Text to Fit", "shrinkText"), ("Block", "block")];
/// Area Type Options › First Baseline.
const FIRST_BASELINE: form::Choices =
&[("Ascent", "ascent"), ("Cap Height", "capHeight"), ("x Height", "xHeight"), ("Leading", "leading"), ("Fixed", "fixed")];
const FIRST_BASELINE: form::Choices = &[
("Ascent", "ascent"),
("Cap Height", "capHeight"),
("x Height", "xHeight"),
("Leading", "leading"),
("Em Box Height", "emBoxHeight"),
("Fixed", "fixed"),
];
/// Area Type Options › Align (vertical alignment of the lines in each row/column).
const VERTICAL_ALIGN: form::Choices = &[("Top", "top"), ("Center", "center"), ("Bottom", "bottom"), ("Justify", "justify")];
@@ -313,6 +319,35 @@ mod tests {
assert_eq!(t.area.vertical_align, VerticalAlign::Center);
}
/// Area Type Options › First Baseline offers Em Box Height: OK sets it with its Min, and the
/// dialog opens again with it chosen.
#[test]
fn area_type_options_dialog_sets_the_em_box_height_first_baseline() {
let mut app = VectorcraftApp::new(Session::new(), Default::default());
app.run("file.new", json!({"width": 400, "height": 400})).unwrap();
let id = app.run("text.create", json!({"x": 20, "y": 20, "text": "Hello", "area": {"width": 200, "height": 200}})).unwrap()["id"]
.as_u64()
.unwrap();
app.run("select.set", json!({"ids": [id]})).unwrap();
// The labels `i18n::tests::first_baseline_choices_are_in_complete_catalogs` checks.
let labels: Vec<&str> = choices("text.areaOptions", "firstBaseline").unwrap().iter().map(|(l, _)| *l).collect();
assert_eq!(labels, ["Ascent", "Cap Height", "x Height", "Leading", "Em Box Height", "Fixed"]);
crate::menus::invoke(&mut app, "text.areaOptions", json!({}));
assert_eq!(app.ui.dialog.as_ref().unwrap().str("firstBaseline"), "ascent");
let ctx = egui::Context::default();
crate::theme::install_fonts(&ctx);
let mut out = ctx.run_ui(egui::RawInput::default(), |ui| crate::dialogs::show(&mut app, ui.ctx()));
out.textures_delta.clear();
let fields = &mut app.ui.dialog.as_mut().unwrap().fields;
fields.insert("firstBaseline".into(), json!("emBoxHeight"));
fields.insert("firstBaselineMin".into(), json!(4.0));
crate::dialogs::confirm(&mut app).unwrap();
let NodeKind::Text(t) = &app.session.doc().unwrap().doc.node(vectorcraft_doc::NodeId(id)).unwrap().kind else { panic!("text") };
assert_eq!((t.area.first_baseline, t.area.first_baseline_min), (vectorcraft_doc::FirstBaseline::EmBoxHeight, 4.0));
crate::menus::invoke(&mut app, "text.areaOptions", json!({}));
assert_eq!(app.ui.dialog.as_ref().unwrap().str("firstBaseline"), "emBoxHeight");
}
/// Area Type Options shows the gutter between rows beside the gutter, and OK sets a gutter
/// between rows of its own.
#[test]
+1
View File
@@ -5936,6 +5936,7 @@ lighting Light Светлина
of от
sRGB IEC61966-2.1 sRGB IEC61966-2.1
x Height Височина на x
Em Box Height Височина на квадратната касетка
▾ Default Actions ▾ Действия по подразбиране
⚠ {chord} was already used by {names} — it has been removed there. Внимание: Комбинацията {chord} вече се използва от {names} — премахната е там.
@id file.close Затваряне
Can't render this file because it is too large.
+1
View File
@@ -5875,6 +5875,7 @@ imageTrace Outline Obris
Ascent Uspon
Cap Height Visina velikih slova
x Height Visina malog slova x
Em Box Height Visina em okvira
Justify Poravnaj obostrano
First Baseline Prva osnovna linija
Vertical Align Okomito poravnanje
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -5488,6 +5488,7 @@ digits Malayalam Malaiàlam
Write Layers Escriu les capes
Writes, moves or deletes files Escriu, mou o suprimeix fitxers
x Height Alçada de la x
Em Box Height Alçada de la caixa em
X11 (XWayland) X11 (XWayland)
X11 (XWayland) When a Pen Is Attached X11 (XWayland) quan hi ha un llapis connectat
X: X:
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -6218,6 +6218,7 @@ variable-list-end {0}, {1} {0} a {1}
Ascent Výška nad účařím
Cap Height Výška verzálek
x Height Výška x
Em Box Height Výška čtverčíku
Justify Do bloku
First Baseline První účaří
Vertical Align Svislé zarovnání
Can't render this file because it is too large.
+1
View File
@@ -8297,6 +8297,7 @@ imageTrace Outline Kontur
Ascent Overhøjde
Cap Height Versalhøjde
x Height x-højde
Em Box Height Em-felthøjde
Justify Justér
First Baseline Første basislinje
Vertical Align Lodret justering
Can't render this file because it is too large.
+3
View File
@@ -5559,6 +5559,9 @@ variable-list-end {0}, {1} {0} und {1}
Cap Height Versalhöhe
x-Height x-Höhe
ICF Box ICF-Rahmen
Ascent Oberlänge
x Height x-Höhe
Em Box Height Gevierthöhe
Show Sample Muster einblenden
Hide Sample Muster ausblenden
Max Ascent/Descent Max. Höhe/Tiefe
Can't render this file because it is too large.
+1
View File
@@ -6166,6 +6166,7 @@ variable-list-end {0}, {1} {0} και {1}
[VectorCraft Default] [Προεπιλογή VectorCraft]
of από
x Height Ύψος x
Em Box Height Ύψος τετραγώνου em
▾ Default Actions ▾ Προεπιλεγμένες ενέργειες
⚠ {chord} was already used by {names} — it has been removed there. Προσοχή: το {chord} χρησιμοποιούνταν ήδη από {names} — αφαιρέθηκε από εκεί.
@msg give corners of the path: anchors between two straight sides ορίστε τις γωνίες της διαδρομής: σημεία αγκύρωσης μεταξύ δύο ευθύγραμμων πλευρών
Can't render this file because it is too large.
+1
View File
@@ -6161,6 +6161,7 @@ effect Regular Regular
Ascent Ascendente
Cap Height Altura de mayúsculas
x Height Altura de la x
Em Box Height Altura del cuadro eme
Justify Justificar
First Baseline Primera línea de base
Vertical Align Alineación vertical
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -6130,6 +6130,7 @@ variable-list-end {0}, {1} {0} ja {1}
Ascent Nousu
Cap Height Versaalikorkeus
x Height x-korkeus
Em Box Height Em-laatikon korkeus
Justify Tasaa molemmat reunat
First Baseline Ensimmäinen perusviiva
Vertical Align Pystytasaus
Can't render this file because it contains an unexpected character in line 2 and column 73.
+1
View File
@@ -6460,6 +6460,7 @@ lighting Light Lumière
of sur
sRGB IEC61966-2.1 sRGB IEC61966-2.1
x Height Hauteur d’x
Em Box Height Hauteur du cadratin
▾ Default Actions ▾ Scripts par défaut
⚠ {chord} was already used by {names} — it has been removed there. Attention : {chord} était déjà utilisé par {names} ; il en a été retiré.
@id file.close Fermer
Can't render this file because it is too large.
+4
View File
@@ -4515,6 +4515,10 @@
tile {number} ટાઇલ {number}
to થી
x-Height x-ઊંચાઈ
Ascent એસેન્ટ
x Height x ઊંચાઈ
Fixed નિશ્ચિત
Em Box Height Em બૉક્સ ઊંચાઈ
{count} of {total} artboards {total} માંથી {count} આર્ટબોર્ડ
{effect} is already applied {effect} પહેલેથી લાગુ છે
{file}, line {line} {file}, લાઇન {line}
Can't render this file because it contains an unexpected character in line 72 and column 5.
+1
View File
@@ -5914,6 +5914,7 @@ antiAlias Sharp शार्प
Write Layers लेयर लिखें
Writes, moves or deletes files फ़ाइलों को राइट्स, मूव या डिलीट करता है
x Height x ऊँचाई
Em Box Height एम बॉक्स ऊँचाई
X Position X स्थिति
x-height x-ऊँचाई
x-Height x-ऊँचाई
Can't render this file because it is too large.
+1
View File
@@ -5106,6 +5106,7 @@ mark-style Japanese Japán
Wrinkle Tool Gyűrés
Write Layers Rétegek írása
x Height x-magasság
Em Box Height Kvirtmező magassága
X11 (XWayland) When a Pen Is Attached X11 (XWayland), ha toll csatlakozik
If a drawing tablet's pen doesn't draw, choose an X11 (XWayland) option. Ha a grafikus tábla tolla nem rajzol, válassz egy X11 (XWayland) beállítást.
X11 (XWayland) X11 (XWayland)
Can't render this file because it is too large.
+1
View File
@@ -5531,6 +5531,7 @@ imageTrace Outline Kontur
Ascent Ascent
Cap Height Tinggi kapital
x Height Tinggi x
Em Box Height Tinggi Em Box
Justify Ratakan
First Baseline Baseline pertama
Vertical Align Perataan vertikal
Can't render this file because it contains an unexpected character in line 2521 and column 5.
+3
View File
@@ -1068,6 +1068,9 @@ font-technology Variable Variabili
Cap Height Altezza maiuscole
x-Height Altezza x
ICF Box Riquadro ICF
Ascent Ascendente
x Height Altezza x
Em Box Height Altezza riquadro em
Show Sample Mostra campione
Hide Sample Nascondi campione
Max Ascent/Descent Altezza/profondità max
Can't render this file because it is too large.
+3
View File
@@ -49,6 +49,9 @@ font-technology Variable バリアブル
Cap Height キャップハイト
x-Height x ハイト
ICF Box 平均字面
Ascent アセント
x Height x ハイト
Em Box Height 仮想ボディの高さ
Show Sample サンプルを表示
Hide Sample サンプルを隠す
Max Ascent/Descent 最大アセント/ディセント
Can't render this file because it is too large.
+1
View File
@@ -7645,6 +7645,7 @@ font-technology Variable ცვლადი
Ascent ზედა გამონაშვერი
Cap Height მთავრული ასოს სიმაღლე
x Height x-სიმაღლე
Em Box Height Em-ბლოკის სიმაღლე
Justify ორმხრივი სწორება
First Baseline პირველი საბაზისო ხაზი
Vertical Align ვერტიკალური სწორება
Can't render this file because it is too large.
+3
View File
@@ -43,6 +43,9 @@ font-technology Variable 가변
Cap Height 대문자 높이
x-Height x 높이
ICF Box ICF 박스
Ascent 어센트
x Height x 높이
Em Box Height 엠 박스 높이
Show Sample 샘플 표시
Hide Sample 샘플 숨기기
Max Ascent/Descent 최대 어센트/디센트
Can't render this file because it is too large.
+1
View File
@@ -8004,6 +8004,7 @@ imageTrace Outline Contour
Ascent Stijghoogte
Cap Height Kaphoogte
x Height x-hoogte
Em Box Height Em-vakhoogte
Justify Uitvullen
First Baseline Eerste basislijn
Vertical Align Verticaal uitlijnen
Can't render this file because it is too large.
+1
View File
@@ -6068,6 +6068,7 @@ variable-list-end {0}, {1} {0} i {1}
Ascent Wydłużenie górne
Cap Height Wysokość wersalików
x Height Wysokość x
Em Box Height Wysokość ramki firetowej
Justify Justuj
First Baseline Pierwsza linia bazowa
Vertical Align Wyrównanie pionowe
Can't render this file because it is too large.
+1
View File
@@ -6151,6 +6151,7 @@ effect Regular Regular
Ascent Ascensão
Cap Height Altura das Maiúsculas
x Height Altura do x
Em Box Height Altura da Caixa Eme
Justify Justificar
First Baseline Primeira Linha de Base
Vertical Align Alinhamento Vertical
Can't render this file because it is too large.
+1
View File
@@ -7218,6 +7218,7 @@ axis Y Axis Ось Y
[Press Quality] [Типографское качество]
of из
x Height Высота строчных
Em Box Height Высота кегельной площадки
▾ Default Actions ▾ Стандартные действия
⚠ {chord} was already used by {names} — it has been removed there. ⚠ {chord} уже было назначено: {names}; там оно удалено.
@plural {n} shortcut is assigned more than once|{n} shortcuts are assigned more than once {n} сочетание клавиш назначено несколько раз|{n} сочетания клавиш назначены несколько раз|{n} сочетаний клавиш назначены несколько раз
Can't render this file because it is too large.
+1
View File
@@ -6379,6 +6379,7 @@ lighting Light Ljus
of av
sRGB IEC61966-2.1 sRGB IEC61966-2.1
x Height x-höjd
Em Box Height Em-rutans höjd
▾ Default Actions ▾ Standardåtgärder
⚠ {chord} was already used by {names} — it has been removed there. Obs! {chord} användes redan av {names} – det har tagits bort där.
@id file.close Stäng
Can't render this file because it is too large.
+15
View File
@@ -471,6 +471,21 @@ fn font_height_reference_labels_are_in_complete_catalogs() {
}
}
/// Area Type Options › First Baseline's choices (the dropdown reads them in the "effect" context,
/// falling back to the plain row).
#[test]
fn first_baseline_choices_are_in_complete_catalogs() {
let mut missing = vec![];
for lang in LANGUAGES.iter().filter(|lang| lang.complete_menus) {
for label in ["Ascent", "Cap Height", "x Height", "Leading", "Em Box Height", "Fixed"] {
if lang.catalog().plain(label).is_none() && lang.catalog().contextual("effect", label).is_none() {
missing.push(format!("{} {label}", lang.code));
}
}
}
assert!(missing.is_empty(), "{missing:?}");
}
/// Each catalog's Saved View N and Saved Selection N rows carry the number N, and no two of a
/// catalog's saved views or saved selections show one name, whatever digits the language uses.
#[test]
+1
View File
@@ -6229,6 +6229,7 @@ lighting Light Işık
of arasında
sRGB IEC61966-2.1 sRGB IEC61966-2.1
x Height x Yükseklik
Em Box Height Em Kutusu Yüksekliği
▾ Default Actions ▾ Varsayılan Eylemler
⚠ {chord} was already used by {names} — it has been removed there. ⚠ {chord} zaten {names} tarafından kullanılmıştı — oradan kaldırıldı.
@id file.close Kapat
Can't render this file because it is too large.
+3
View File
@@ -1062,6 +1062,9 @@ font-technology Variable Варіативні
Cap Height Висота великих літер
x-Height Висота малих літер
ICF Box Рамка ICF
Ascent Підйом
x Height Висота малих літер
Em Box Height Висота кегельного майданчика
Show Sample Показати зразок
Hide Sample Приховати зразок
Max Ascent/Descent Макс. висота/глибина
Can't render this file because it is too large.
+3
View File
@@ -2044,6 +2044,9 @@ digits Hindi Hindi
Cap Height Chiều cao chữ hoa
x-Height Chiều cao chữ x
ICF Box Ô ICF
Ascent Độ cao nét trên
x Height Chiều cao chữ x
Em Box Height Chiều cao ô em
Show Sample Hiện mẫu
Hide Sample Ẩn mẫu
Max Ascent/Descent Độ cao/sâu tối đa
Can't render this file because it contains an unexpected character in line 206 and column 5.
+3
View File
@@ -999,6 +999,9 @@ antiAlias Sharp 锐利
Cap Height 大写字母高度
x-Height x 字高
ICF Box ICF 框
Ascent 上缘
x Height x 字高
Em Box Height 全角字框高度
Show Sample 显示样本
Hide Sample 隐藏样本
Max Ascent/Descent 最大上升/下降
Can't render this file because it is too large.
+3
View File
@@ -1030,6 +1030,9 @@ font-technology Variable 可變
Cap Height 大寫字母高度
x-Height x 字高
ICF Box ICF 框
Ascent 上緣
x Height x 字高
Em Box Height 全形字框高度
Show Sample 顯示樣本
Hide Sample 隱藏樣本
Max Ascent/Descent 最大上升/下降
Can't render this file because it is too large.
+17
View File
@@ -9810,6 +9810,23 @@ Native files save it only when it is `rows`, so files from before it open by col
{"name":"run_command","arguments":{"command":"text.areaOptions","params":{"rows":2,"columns":3,"flow":"rows"}}}
```
### First baseline
`text.areaOptions {firstBaseline: ascent|capHeight|xHeight|leading|emBoxHeight|fixed, firstBaselineMin?: pt}` (Area
Type Options › First Baseline and Min) sets how far below the top of the type area, inside the inset, the first line
of each row/column cell sits. `emBoxHeight` (Em Box Height) puts the top of the line's ideographic em box at that
top; on a line of several sizes the largest em box is used, and vertical type measures it from the frame's right
edge. The em box is the one leading measured from em box top to top uses: an ideograph's cell in the font's
vertical metrics, or 0.88 em above the baseline when the font has none (VectorCraft's own rule). With every kind but
`fixed`, `firstBaselineMin` is the least distance from the top to the first baseline; with `fixed` it is the
distance. Each threaded frame keeps its own setting. Native files and `.ai` files save `emBoxHeight` and open it again; other values are refused. The help
page describes the option:
https://helpx.adobe.com/illustrator/desktop/design-with-text/add-manage-text/add-margins-to-text-and-adjust-the-first-baseline.html
```json
{"name":"run_command","arguments":{"command":"text.areaOptions","params":{"firstBaseline":"emBoxHeight","firstBaselineMin":6}}}
```
## Fitting area type: Auto Size, Shrink Text to Fit, overflow
`text.areaOptions` (and `text.create`'s `area`, `text.createInPath` in area mode) take a `fit`:
+1
View File
@@ -1566,6 +1566,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
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`).
Exports to PDF, EPS, SVG, EMF, WMF and the raster formats warn about the area type and type on a path that they draw without the text that doesn't fit, and give their ids, as Print and Print Preview do.
On a shaped area type frame, Inset Spacing keeps text that far from the frame's edge, holes included, measured from the edge itself rather than along the line; the archived help treats the inset as the space an area type object leaves between its text and the path that bounds it (<https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=317>, <https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=325>). A rectangular frame keeps its inset from each side as before, and a column's inner edges keep it once. An edge that two contours of the frame share lies inside the frame, so text runs across it with no inset on either side, and a negative text wrap offset does not shrink a wrap object beside such an edge. Tests: `layout::region::inset_on_a_shaped_frame_is_measured_from_its_sloped_edge`, `inset_keeps_text_clear_of_a_hole_s_sloped_edges`, `inset_applies_once_at_a_column_s_edge_and_at_the_frame_s_edge`, `inset_is_not_kept_beside_an_edge_two_contours_share`, `negative_wrap_offset_does_not_shrink_beside_an_edge_two_contours_share`.
Area Type Options › First Baseline offers Em Box Height (`text.areaOptions {firstBaseline: "emBoxHeight"}`), which the help page describes as using the font's em box height (<https://helpx.adobe.com/illustrator/desktop/design-with-text/add-manage-text/add-margins-to-text-and-adjust-the-first-baseline.html>): the top of the first line's ideographic em box, the largest on a line of several sizes, touches the top of the type area inside the inset, in each row/column cell and in vertical type from the frame's right edge. The em box is the one Top-to-Top leading uses (VectorCraft's own measure: an ideograph's cell in the font's vertical metrics, else 0.88 em above the baseline), and Min is the least distance, as with the other kinds. Native files and `.ai` files save and open it; a `.ai` First Baseline kind VectorCraft does not read keeps today's fallback. Tests: `em_box_height_puts_the_first_lines_em_box_top_at_the_type_area_top`, `em_box_height_sets_a_vertical_frames_first_column_at_its_em_box`, `area_options_set_the_em_box_height_first_baseline`, `every_first_baseline_kind_comes_back_with_its_minimum`.
An edit copies a thread's story only when it changes one of the thread's frames: with a story of 50,000 characters threaded through 8 frames with a style change at every word, moving another object took 7.8 ms and now takes 0.013 ms, and a frame of a drag took 7.2 ms and now takes 0.012 ms (release build, `threaded_story_edit_timing`).
When a story flows through threaded area type, each frame is measured with the whole paragraphs of the story that it needs and a few more, not with the whole rest of the story, and it keeps the same text as before. A story of 1,500 one-line paragraphs (55,892 bytes) through 40 frames was laid out over 2,126,762 bytes of text while the frames were measured, and is now laid out over 21,035 (`thread::tests::many_frames_measure_about_the_text_they_take`). Area type with its lines aligned to the center, the bottom or justified vertically, and type on a path whose first paragraph is aligned Left, Justify Left, Justify All or Auto, are measured the same way: the same story through 40 area frames aligned to the center was laid out over 2,126,762 bytes and is now laid out over 21,035, through 40 paths aligned Left over 2,135,202 bytes and now over 20,583, and through 40 paths aligned Justify All over 2,135,202 bytes and now over 20,583 (same test). Shrink Text to Fit, Dynamic Text, Optical Margin Alignment and Roman Hanging Punctuation on a path, a path aligned to the center or the right, horizontal type on a path whose first paragraph is set right to left or with right-to-left text in the rest of the story, and a frame whose share ends in the story's last paragraph are still measured with the whole rest.
A paragraph that continues from one threaded frame into the next has its first-line indent and bullet or number in the frame where it starts; in the next frame its first line starts where its wrapped lines start. In frames that are no longer threaded, copies of a frame and point type converted from one, the first paragraph has its indent and bullet or number again.