From 95c8c9cc5bc28605530e67e9d34b8cdd6331d8cc Mon Sep 17 00:00:00 2001 From: moppeeer Date: Mon, 12 Oct 2026 03:32:49 +0200 Subject: [PATCH] fix(hyphenation): honor capitalized-word settings for uppercase words Honor the capitalized-word hyphenation setting for uppercase words and retain the current roadmap entries. Validation: all six cargo xtask ci gates passed on the current main merge candidate; 1,170 native tests passed and all 15 WASM packages checked. Task: #538 Co-authored-by: skylartaylor <26588250+skylartaylor@users.noreply.github.com> --- ROADMAP.md | 1 + crates/compose/src/hyphen/mod.rs | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 82a42cf..ec8eb09 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -129,6 +129,7 @@ list) · [roadmap.md](docs/roadmap.md) (milestones, plan) · [parity-checklist.m Newest first. +- **2026-10-12** · Words in capitals hyphenate like capitalized words (FERRUM COM-MODI), as in InDesign; Hyphenate Capitalized Words off keeps them whole. No readiness percentage change. - **2026-10-11 (printing):** `file.printers` and `file.print` use craft-libs/craft-print for CUPS and Windows. DesignCraft retains PDF export, page selection, spreads, marks and bleed; dry runs create no temporary PDF or print job. Windows selects matching or default driver paper and shrinks oversized sheets without enlarging smaller ones; queue duplex defaults are preserved. Headless tests exercise exported bytes, job settings, dry runs and refusals; shared native Windows CI passes, including paused-queue submission and cleanup. PostScript, production print controls and physical output validation remain open. No readiness percentage change. - **2026-10-10 (UI.4–UI.5):** Panel tabs can move into other groups, split the dock, float, resize and return to their saved locations through shared docking transactions. Layouts persist in custom workspaces; UI and control commands share the same validated action path. Shared pane geometry and widget-state theme application retain all five palettes and local fonts. Split panes send keyboard input only to the focused canvas and scope contextual toolbar IDs per pane. No readiness percentage change. diff --git a/crates/compose/src/hyphen/mod.rs b/crates/compose/src/hyphen/mod.rs index e21ade0..e3f4a43 100644 --- a/crates/compose/src/hyphen/mod.rs +++ b/crates/compose/src/hyphen/mod.rs @@ -233,9 +233,8 @@ pub fn hyphen_points_in(word: &str, lim: &Limits, lang: Lang) -> Vec { if letters < lim.min_word.max(2) { return false; } - if letters > 1 && run.iter().filter(|c| c.is_alphabetic()).all(|c| c.is_uppercase()) { - return false; - } + // Words in capitals (FERRUM COMMODI) hyphenate like capitalized words, as InDesign's: Hyphenate + // Capitalized Words off keeps both, acronyms included, whole. if !lim.capitalized && run[0].is_uppercase() { return false; } @@ -333,7 +332,10 @@ mod tests { #[test] fn case_apostrophes_and_punctuation() { assert_eq!(h("Typography"), "Ty-pog-ra-phy"); - assert_eq!(h("TYPOGRAPHY"), "TYPOGRAPHY"); + assert_eq!(h("TYPOGRAPHY"), "TY-POG-RA-PHY"); + assert_eq!(h("COMMODI"), "COM-MO-DI"); + let whole = Limits { capitalized: false, ..Limits::default() }; + assert_eq!(hyphenate_word("TYPOGRAPHY", &whole), "TYPOGRAPHY", "Hyphenate Capitalized Words off"); assert_eq!(h("typography,"), "ty-pog-ra-phy,"); assert_eq!(h("“typography”"), "“ty-pog-ra-phy”"); assert_eq!(h("typography's"), "ty-pog-ra-phy's");