DesignCraft: An open-source page and layout design editor written by scratch in pure Rust
T.DE1: restrict German reform hyphenation variants
RoHaX175c6f6ae31f
diff --git a/ROADMAP.md b/ROADMAP.mdindex 6652c7def..e7da44792 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -348,7 +348,7 @@ list) · [roadmap.md](docs/roadmap.md) (milestones, plan) · [parity-checklist.mNewest first.-- **2026-10-18** · German text hyphenates using the MIT-licensed 2006 reform patterns (`hyph-de-1996.tex`) through `hypher`. Language names and locale codes reach both composers; tests cover umlauts, ß, compounds, reformed ck/st breaks and paragraph limits. Six of InDesign's ~40 hyphenation languages. No readiness percentage change.+- **2026-10-18** · German text hyphenates using the MIT-licensed 2006 reform patterns (`hyph-de-1996.tex`) through `hypher`. Explicit 2006 names and plain/2006 locale codes reach both composers; traditional and unknown spelling variants stay unhyphenated. Tests cover this distinction, umlauts, ß, compounds, reformed ck/st breaks and paragraph limits. Six of InDesign's ~40 hyphenation languages. No readiness percentage change.- **2026-10-16** · Threading: the loaded text cursor threads into a text frame inside a group (it hit the group and showed it could not thread); a plain click still selects the group (#1075). Gap 27 closed. No readiness percentage change.- **2026-10-16** · Greek text hyphenates. The patterns were never compiled in, so Greek set unhyphenated however narrow the column; `"Greek"`, `"Greek: Greece"`, `el` and `el-GR` all resolve now and ανθρωπος breaks αν-θρω-πος. They are the monotonic patterns (hyph-el-monoton, Dimitrios Filippou, under MIT), which is what polytonic text hyphenates by too. Five of InDesign's ~40 hyphenation languages. No readiness percentage change.diff --git a/crates/compose/src/hyphen/mod.rs b/crates/compose/src/hyphen/mod.rsindex a3b2156cd..462e5348d 100644--- a/crates/compose/src/hyphen/mod.rs+++ b/crates/compose/src/hyphen/mod.rs@@ -7,8 +7,9 @@//! under MIT. Those are the **monotonic** patterns, which is what `hypher` maps `el` to, so//! polytonic text hyphenates by them as well.//! German uses `hyph-de-1996.tex` (2024-02-28, Deutschsprachige Trennmustermannschaft, MIT):-//! despite the filename, these are the reformed 2006 spelling patterns. All German language-//! names and locale codes resolve to this set; no separate old-spelling or Swiss set is bundled.+//! despite the filename, these are the reformed 2006 spelling patterns. Only the two 2006 reform+//! names and German locale codes without a reform year or with 2006 use this set. Traditional,+//! 1901 and unknown German variants have no automatic hyphenation; no old-spelling set is bundled.//!//! English lookup order for each word://! 1. the **dictionary** ([`Dictionary::en_us`]) — the public-domain Moby Hyphenator II word list@@ -87,6 +88,11 @@ impl Lang {}let tag = designcraft_doc::language_tag(language)?;let sub = designcraft_doc::language_subtag(tag);+ // language_tag deliberately drops spelling variants for shaping and quotes. Hyphenation+ // must retain that distinction: the 2006 patterns are wrong for traditional ck/st breaks.+ if sub == "de" && !german_2006_language(language) {+ return None;+ }if sub == "en" {return Some(Lang::English);}@@ -98,6 +104,15 @@ impl Lang {}}+/// Accept explicit reform names and unqualified German locales (our modern default), but never+/// silently substitute reform patterns for another spelling variant imported from IDML.+fn german_2006_language(language: &str) -> bool {+ let language = language.trim();+ let normalized = language.strip_prefix("$ID/").unwrap_or(language).to_lowercase();+ let words: Vec<&str> = normalized.split(|c: char| !c.is_alphanumeric()).filter(|w| !w.is_empty()).collect();+ matches!(words.as_slice(), ["german", "2006", "reform"] | ["german", "swiss", "2006", "reform"] | ["de"] | ["de", _] | ["de", _, "2006"])+}+/// Where a word's break points came from.#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum Source {@@ -386,7 +401,18 @@ mod tests {fn german_2006_uses_reformed_patterns() {let de = Lang::for_language("German: 2006 Reform").unwrap();assert_eq!(de, Lang::Patterns(hypher::Lang::German));- for name in ["German", "$ID/German: 2006 Reform", "de", "de-DE", "de_AT", "de_DE_2006", "German: Swiss 2006 Reform", "de_CH_2006"] {+ for name in [+ "$ID/German: 2006 Reform",+ " german: 2006 reform ",+ "de",+ "de-DE",+ "de_AT",+ "de_CH",+ "de_DE_2006",+ "German: Swiss 2006 Reform",+ "$ID/German: Swiss 2006 Reform",+ "de_CH_2006",+ ] {assert_eq!(Lang::for_language(name), Some(de), "{name}");}for (word, expected) in [@@ -405,6 +431,27 @@ mod tests {}}+ #[test]+ fn non_2006_german_has_no_bundled_hyphenation() {+ for name in [+ "German",+ "German: Traditional",+ "$ID/German: Traditional",+ "German: Swiss",+ "German: 1901",+ "German: 1996 Reform",+ "German: Unknown",+ "German: Traditional 2006 Reform",+ "de_DE_1901",+ "de-CH-1901",+ "de_AT_1996",+ "de_DE_2099",+ ] {+ assert_eq!(designcraft_doc::language_subtag(designcraft_doc::language_tag(name).unwrap()), "de", "{name}");+ assert_eq!(Lang::for_language(name), None, "{name}: do not use 2006 ck/st breaks for unsupported spelling variants");+ }+ }+#[test]fn german_2006_respects_paragraph_limits() {let de = Lang::for_language("de_DE_2006").unwrap();diff --git a/docs/localization-parity.md b/docs/localization-parity.mdindex 9fe3b3319..8e69bed79 100644--- a/docs/localization-parity.md+++ b/docs/localization-parity.md@@ -67,6 +67,9 @@ InDesign 2026 hyphenates and spell-checks ~40 languages (Hunspell and Duden dictDesignCraft hyphenates **English, Spanish, Portuguese, Norwegian, Greek and German (2006 reform)** and spell-checks **English** only. Text languagecan be set per paragraph and character (Properties, Character panel) and drives quotes andlocale shaping. See [typography-parity.md](typography-parity.md).+German hyphenation accepts `German: 2006 Reform`, `German: Swiss 2006 Reform` and `de` locale+codes without a spelling year or with `2006`. Traditional names, `de_DE_1901` and unknown+German variants have no automatic hyphenation; their German shaping and quotes are unchanged.## Remaining effortdiff --git a/docs/target-app-parity.md b/docs/target-app-parity.mdindex 4577033cb..d2a849ab7 100644--- a/docs/target-app-parity.md+++ b/docs/target-app-parity.md@@ -355,7 +355,7 @@ It is evidence of breadth: each item exists. It is not a claim of InDesign-level- Edit ▸ Menus (`window.hideMenuItem`): hide menu items; menus with hidden items end in Show All Menu Items.- View ▸ Separations Preview (`view.separations`): one process plate as ink density, or areas over an ink limit in red (a GCR preview of the rendered view; spot plates and the flattener preview aren't there).- Separations Preview plates now come from each object's own colour (CMYK as authored; RGB and images through the colour settings, images via a cached 17³ table), so pure black shows only on the black plate.-- Language (Character panel ▸ Language, Properties ▸ Character, `type.char {language}`): text in other languages isn't hyphenated or spell-checked with the English dictionaries, typographer's quotes follow the language (German „…“, French and Russian «…», Swiss, Spanish, Dutch, Nordic, Japanese and Traditional Chinese 「…」, Simplified Chinese “…”), the font's localized forms (OpenType `locl`: Turkish i, Bulgarian Cyrillic, Japanese / Chinese / Korean glyph variants) follow it too, and so does the fallback for CJK characters the font lacks (with Draw Missing Glyphs from Fallback Fonts on): Japanese, Simplified Chinese, Traditional Chinese and Korean each try their own installed system fonts (Japanese starts with the craft-fonts Japanese faces, Mincho first, when built with them; Hangul, kana and Bopomofo pick their language's fonts whatever the language). Language names from IDML keep their spelling; locale codes as InDesign writes them for some languages (`de_DE_2006`, `nl_NL_2005`; any `ll`, `ll_CC`, `ll-CC`) are their language and region for all of the above, and Chinese is also recognised in its common spellings ("Simplified Chinese", "Chinese (Traditional)", `zh_CN`, `zh-Hant`). Spanish is hyphenated with Javier Bezos's Liang patterns (`hyph-es.tex` 5.0, MIT), Portuguese with hyph-utf8's `hyph-pt.tex` 1.4 (BSD-3-Clause) and Norwegian with hyph-utf8's `hyph-no.tex` (permissive), all through the `hypher` crate; Greek uses `hyph-el-monoton.tex` (MIT). German uses hyph-utf8's `hyph-de-1996.tex` 2024-02-28 (MIT), which contains the reformed 2006 patterns despite its filename. German names and locale codes (including `German: 2006 Reform` and `de_DE_2006`) use this set; no separate old-spelling or Swiss set is bundled. Hyphenation for other languages isn't bundled yet.+- Language (Character panel ▸ Language, Properties ▸ Character, `type.char {language}`): text in other languages isn't hyphenated or spell-checked with the English dictionaries, typographer's quotes follow the language (German „…“, French and Russian «…», Swiss, Spanish, Dutch, Nordic, Japanese and Traditional Chinese 「…」, Simplified Chinese “…”), the font's localized forms (OpenType `locl`: Turkish i, Bulgarian Cyrillic, Japanese / Chinese / Korean glyph variants) follow it too, and so does the fallback for CJK characters the font lacks (with Draw Missing Glyphs from Fallback Fonts on): Japanese, Simplified Chinese, Traditional Chinese and Korean each try their own installed system fonts (Japanese starts with the craft-fonts Japanese faces, Mincho first, when built with them; Hangul, kana and Bopomofo pick their language's fonts whatever the language). Language names from IDML keep their spelling; locale codes as InDesign writes them for some languages (`de_DE_2006`, `nl_NL_2005`; any `ll`, `ll_CC`, `ll-CC`) are their language and region for all of the above, and Chinese is also recognised in its common spellings ("Simplified Chinese", "Chinese (Traditional)", `zh_CN`, `zh-Hant`). Spanish is hyphenated with Javier Bezos's Liang patterns (`hyph-es.tex` 5.0, MIT), Portuguese with hyph-utf8's `hyph-pt.tex` 1.4 (BSD-3-Clause) and Norwegian with hyph-utf8's `hyph-no.tex` (permissive), all through the `hypher` crate; Greek uses `hyph-el-monoton.tex` (MIT). German uses hyph-utf8's `hyph-de-1996.tex` 2024-02-28 (MIT), which contains the reformed 2006 patterns despite its filename. Only the explicit 2006 reform names and plain or 2006 German locale codes use this set; `German: Traditional`, `de_DE_1901` and unknown German variants have no automatic hyphenation. No separate old-spelling or Swiss set is bundled. Hyphenation for other languages isn't bundled yet.- Books (`book.new/open/add/remove/list/styleSource/paginate/syncStyles/exportPdf`, Book panel): `.dcbook` files, continuous page numbering, chapter numbers resolved in book order (Automatic, Start Chapter Numbering at, Same as Previous Document; `layout.chapterNumbering`, with a style for Chapter Number variables and cross-references), style sync from a style source, one merged PDF. Section prefixes follow InDesign's rule (up to 8 characters, no + or comma).- Numbering & Section Options window as in InDesign (Start Section, automatic or explicit page numbering up to 99999, prefix, style, marker, Include Prefix; the document's chapter numbering and its book); OK applies both in one undo step (`layout.numberingOptions`).- Book numbering/style updates validate and serialize all targets before changing the first chapter. They write only closed native chapters, checking canonical paths for open aliases; IDML remains a read-only style source and PDF input. Snapshots are staged on disk with at most 4,096 chapter records in memory. Each replacement is atomic; a later write failure explicitly lists completed chapters rather than claiming whole-book rollback. Import/serialization memory limits and advanced book TOC/index work remain separate.