mirror of
https://github.com/penpot/penpot.git
synced 2026-11-06 10:00:38 +00:00
TextLayoutPolicy had nine flat variants that mixed language, Chinese region and Korean wrap. It is now Plain, Japanese, Chinese(ChineseRegion) or Korean(KoreanWrap), and the layout code asks it named questions (uses_jlreq, plans_breaks, keeps_overlong_units, reopens_overlong_words, bounded_justify, needs_joiner, normalizes_western_spaces, uses_clreq_positions, ...) instead of comparing variants. Paragraph parses its language once, when the language or the Korean wrap changes, and copies the policy to its spans. Span code no longer builds a policy from the tag with a dummy Korean wrap, and the emphasis and underline positions take the policy instead of a Chinese flag. A LanguageTag parser now serves both the layout policy and the CJK font choice. It also accepts '_' as a separator, as the font choice did, so a tag such as "ja_JP" now selects the Japanese policy. The korean-wrap byte decodes through a new exported RawKoreanWrap enum (Syllable=0, SpacesOnly=1, KeepWords=2) with the same byte values. AI-assisted-by: claude-opus-5-5