`CharExt::column_count` was hard-coded to return 1 for every char. The
code editor's layouter advances x-position by this value per grapheme
(see `code_editor.rs:1217`), so CJK glyphs — which the text shaper draws
at ~2× the Latin monospace advance — overlap one another. Cursor
placement, selection rectangles, and wrap points suffer the same
off-by-half because they all read from `column_count`.
Match the Unicode East Asian Width property so Wide and Fullwidth
characters (plus common emoji that render at double-width) report 2
columns. Keeps a small literal match table instead of pulling in the
\`unicode-width\` crate, since only broad blocks are needed and perf on
the layout hot path matters.
Ranges covered:
U+3000..U+30FF CJK punctuation / Hiragana / Katakana
U+3400..U+4DBF CJK Unified Ideographs Extension A
U+4E00..U+9FFF CJK Unified Ideographs
U+AC00..U+D7AF Hangul Syllables
U+F900..U+FAFF CJK Compatibility Ideographs
U+FF00..U+FF60 Fullwidth forms
U+FFE0..U+FFE6 Fullwidth sign forms
U+20000..U+2FFFF CJK Unified Ideographs Extensions B..F
U+1F300..U+1F9FF Emoticons / symbols / transport / supplemental
Effect: Chinese/Japanese/Korean/emoji in code blocks render with correct
spacing in CodeView (and in any widget that layouts via CodeSession).
Latin-only workflows are unaffected.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace unwraps when querying the first glyph with safe handling and provide a fallback monospace cell size if no glyph is available (e.g. on wasm while fonts are still loading). Computes a reasonable width/height from the current font_size (width = 0.6 * font_size, height = font_size) so the editor can render on first draw instead of aborting. Keeps existing cell_size and cell_offset_y calculations based on the chosen dimensions.