Paragraph panel: Optical Margin Alignment checkbox (#494)

The composer already hangs punctuation when a paragraph's opticalMargin is on, but nothing in the UI could turn it on.

Reported by @mjohnson7cd
This commit is contained in:
Mara Johnson
2026-10-11 12:41:33 -04:00
parent ca343e8985
commit a02fc011bf
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -2372,6 +2372,10 @@ const TABLE: &[(&str, [&str; 5])] = &[
("Inward", ["Inward", "Inward", "Inward", "Inward", "向内"]),
("Metrics", ["Metrics", "Metrics", "Metrics", "Metrics", "度量"]),
("Optical", ["Optical", "Optical", "Optical", "Optical", "视觉"]),
(
"Optical Margin Alignment",
["Optischer Randausgleich", "Marges optiques", "Alineación de márgenes ópticos", "オプティカルマージン揃え", "视觉边距对齐"],
),
("Applies to fill", ["Applies to fill", "Applies to fill", "Applies to fill", "Applies to fill", "应用于填色"]),
("Applies to text", ["Applies to text", "Applies to text", "Applies to text", "Applies to text", "应用于文本"]),
("Gray", ["Gray", "Gray", "Gray", "Gray", "灰度"]),
+4
View File
@@ -1478,6 +1478,10 @@ pub fn paragraph_panel(app: &mut DesignApp, ui: &mut egui::Ui) {
let _ = app.run("type.para", json!({"attrs": {"gridAlign": if grid { "allLines" } else { "none" }}}));
}
});
let mut optical = p["opticalMargin"].as_bool().unwrap_or(false);
if ui.checkbox(&mut optical, crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Optical Margin Alignment"))).changed() {
let _ = app.run("type.para", json!({"attrs": {"opticalMargin": optical}}));
}
ui.horizontal(|ui| {
caption(ui, crate::i18n::tr(&app.ui.language, "Composer"));
let single = p["composer"].as_str() == Some("singleLine");