Chapter 10·Scripts and Layout·~7 min·
Line Breaking Across Writing Systems
Writing systems use different line-breaking mechanisms. Chinese and Japanese break between ideographs under kinsoku punctuation constraints, Korean breaks at spaces, and Thai segments unspaced text with a word dictionary.
Overview
Latin text wraps at spaces, but Chinese, Japanese, and Thai do not place spaces between words. Browsers apply Unicode Annex #14 character classes, CJK punctuation constraints, and dictionary segmentation to find valid break opportunities. CSS `line-break` and `word-break` properties control how strictly these rules apply.
Core rule
Configure CSS line-break: strict for CJK text, scope word-break: keep-all to Korean only, and never apply word-break: break-all to dictionary-segmented Southeast Asian scripts.
Specification note: Layout engines break the Thai phrase สวัสดีครับ between สวัสดี and ครับ by looking up word boundaries in an embedded Thai dictionary.
Failure mode
Japanese typesetting rules (kinsoku shori) prohibit lines from starting with closing punctuation (。, 、) or small kana. The CSS line-break property controls how strictly the browser enforces these prohibitions. Thai, Lao, Khmer, and Burmese do not use spaces between words and rely on dictionary segmentation to locate word boundaries. Setting word-break: break-all overrides that dictionary and splits Southeast Asian words mid-syllable.
Long German and Finnish compound nouns contain no internal spaces. In narrow columns, unhyphenated compounds overflow their container unless CSS hyphenation or emergency overflow wrapping is enabled.
East Asian languages do not use spaces between words. Breaking lines at arbitrary characters breaks words in half and creates illegible layouts.
Business stakes & user risk
In Chinese and Japanese, breaking a two-character word across two lines disrupts reading comprehension and can accidentally form unintended slang or offensive words.
Rule of thumb
Use CSS word-break: auto-phrase for CJK headings and Intl.Segmenter for script-aware word wrapping.
The Novice Trap vs. Production Standard
Contrast the intuitive assumption with the architecture required for global releases.
“Browsers automatically know where to wrap text because every language uses spaces between words.”
Naive approach: Default Western line breaking
<h1 className="text-4xl">日本語の見出しテキスト</h1>Defect:Compound words like '見出し' (heading) split across lines ('見' on line 1, '出し' on line 2), impairing readability.
Chinese, Japanese, and Thai have no spaces between words. Without dictionary segmentation, text breaks wherever the container boundary falls.
Production standard: CSS auto-phrase with lang attribute
<h1 lang="ja" style={{ wordBreak: "auto-phrase" }}>日本語の見出しテキスト</h1>Benefit:The browser uses Japanese grammar dictionaries to keep natural semantic word phrases together on the same line.
Cross-Functional Review Questions
Questions for product managers, designers, engineers, and testers to ask during sprint reviews.
“Do our marketing and landing page typography guidelines account for CJK line-breaking?”
“Are HTML lang attributes correctly set on pages and embedded multi-language blocks?”
“Are CJK and Thai mobile viewports audited for awkward single-character line wraps?”
“Have native Japanese and Chinese reviewers signed off on marketing copy wrapping?”
Mechanism
Line-breaking algorithms across writing systems
Unicode Standard Annex #14 (UAX #14) defines character line-breaking classes across scripts. While Latin text wraps primarily at space characters, Chinese and Japanese write no spaces between words and allow line breaks between most ideographs. Japanese typography enforces *kinsoku shori* prohibitions, which forbid lines from starting with closing punctuation (。, 、), small kana (っ, ゅ), or prolonged sound marks (ー), and forbid lines from ending with opening brackets.
Thai, Lao, Khmer, and Burmese also omit spaces between words, but lines may break only at lexical word boundaries. Layout engines segment these scripts by matching character sequences against an embedded word dictionary. Application code can access the same dictionary segmentation via new Intl.Segmenter('th', { granularity: 'word' }).
CSS properties adjust these rules. Setting line-break: strict enforces the full *kinsoku* prohibition set. Setting :lang(ko) { word-break: keep-all } wraps Korean text at spaces rather than mid-syllable. Never set word-break: keep-all on Chinese or Japanese, because unspaced CJK sentences will overflow their containers. For German and Finnish compound words, combine hyphens: auto with overflow-wrap: anywhere.
Interactive demo
Guided exercises
- 1Select the Japanese sample, drag the column width to roughly 200px, and toggle line-break between normal and strict. Under `strict`, small kana (`ッ`, `ュ`) and the prolonged sound mark (`ー`) in プッシュ通知 never start a new line, pulling the preceding character down with them.
- 2Switch to the Thai sample and narrow the column width. Even though the Thai sentence contains no space characters, the browser wraps lines cleanly at dictionary word boundaries.
- 3Select the German sample at roughly 200px width and check “hyphens: auto”. The compound noun Benachrichtigungseinstellungen overflows the container until `hyphens: auto` inserts a syllable hyphen.
- 4Select the English long-URL sample and switch overflow-wrap from normal to anywhere. Setting `overflow-wrap: anywhere` allows emergency breaks inside long unspaced tokens without altering normal word wrapping.
Hyphenation needs a lang attribute and a browser dictionary for that language. Of these samples, only German and English can hyphenate.
Rendered output (280px wide)
Narrow the column below 200px and switch modes. overflow-wrap: anywhere breaks the long URL and, unlike break-word, lets a flex or grid item shrink narrower than the URL.
The four line-break modes, side by side
Sentence segmentation (Intl.Segmenter)
- #1订单确认后,我们会在24小时内发货。
- #2您可以随时在“我的订单”页面查看物流状态、预计送达时间,以及iPhone 15 Pro等商品的发票明细。
- #3如果在2026年12月31日前仍未收到货,请联系客服申请全额退款。
Sentence boundaries come from punctuation (UAX #29). Thai ends a sentence with a space, so a Thai paragraph comes back as one segment; the dictionaries for Thai, Chinese, and Japanese apply only at granularity: "word".
Implementation rules
- Set
line-break: stricton CJK body text. Strict mode prevents small kana and prolonged sound marks (ー) from starting a new line and keeps CJK brackets attached to their enclosed text. - Scope
word-break: keep-allto Korean only. Apply:lang(ko) { word-break: keep-all; }so Korean wraps at spaces rather than mid-syllable. Do not applykeep-allto Chinese or Japanese, which contain no inter-word spaces and will overflow the container. - Never apply
word-break: break-allto Thai, Lao, Khmer, or Burmese. Let the browser's built-in dictionary engine segment words, or pre-segment strings withIntl.Segmenterand insertU+200B(Zero-Width Space) at word boundaries. - Enable automatic hyphenation and overflow wrapping for compounding languages. Set
hyphens: autoalongside an accurate HTMLlangattribute, and addoverflow-wrap: anywhereon narrow containers. - Test layouts at a 320px viewport width. This width matches WCAG 2.1 Success Criterion 1.4.10 (Reflow) and exposes line breaking defects early.
Operational context
Roles
Workflow stages
- ·Auditing typography in component libraries
- ·Reviewing layouts for CJK and Southeast Asian releases
- ·Designing narrow sidebars, cards, and badges
Production incident
JIS X 4051 and the W3C Requirements for Japanese Text Layout (JLReq) specify the character classes prohibited at line start (*gyōtō kinsoku*) and line end (*gyōmatsu kinsoku*).