Describe the bug
Chinese / CJK text is rendered with overlapping glyphs in the editor view.
The file is valid UTF-8. After switching to a CJK-capable monospace font (SarasaMonoSlabSC-Regular.ttf), the glyphs display, but adjacent Chinese characters still overlap horizontally. This suggests the issue is display-column / cell-width handling rather than file decoding or missing glyphs.
To Reproduce
Steps to reproduce the behavior:
- Open a UTF-8 Markdown file containing Chinese text.
- Configure a CJK-capable font, for example:
Screenshots
I will attach screenshots showing the overlapping Chinese text.
OS: Windows
If on Linux - please specify whether you're on Wayland or X11: N/A
Focus Version: 0.3.8 release binary
Additional context
I also checked the current main source locally, at commit a651849 from 2026-06-05, and the likely cause still appears to be present.
Relevant source locations:
src/utils/unicode.jai
num_cols_in_string counts every non-tab UTF-8 character as 1 column.
modules/Simp/font.jai
draw_code advances by exactly char_x_advance for every non-tab character.
src/buffer.jai
coordinate/offset conversion and line wrapping also appear to count non-tab UTF-8 characters as 1 column.
This works for ASCII but not for CJK fullwidth characters.
I made a local experimental patch that adds a minimal unicode_display_width / CJK wide-character check and uses it in code drawing, line wrapping, and column calculations. I cannot compile or verify it locally because the Jai compiler is not publicly available, so I am opening an issue instead of a PR.
Describe the bug
Chinese / CJK text is rendered with overlapping glyphs in the editor view.
The file is valid UTF-8. After switching to a CJK-capable monospace font (
SarasaMonoSlabSC-Regular.ttf), the glyphs display, but adjacent Chinese characters still overlap horizontally. This suggests the issue is display-column / cell-width handling rather than file decoding or missing glyphs.To Reproduce
Steps to reproduce the behavior:
Screenshots
I will attach screenshots showing the overlapping Chinese text.
OS: Windows
If on Linux - please specify whether you're on Wayland or X11: N/A
Focus Version: 0.3.8 release binary
Additional context
I also checked the current main source locally, at commit a651849 from 2026-06-05, and the likely cause still appears to be present.
Relevant source locations:
src/utils/unicode.jai
num_cols_in_string counts every non-tab UTF-8 character as 1 column.
modules/Simp/font.jai
draw_code advances by exactly char_x_advance for every non-tab character.
src/buffer.jai
coordinate/offset conversion and line wrapping also appear to count non-tab UTF-8 characters as 1 column.
This works for ASCII but not for CJK fullwidth characters.
I made a local experimental patch that adds a minimal unicode_display_width / CJK wide-character check and uses it in code drawing, line wrapping, and column calculations. I cannot compile or verify it locally because the Jai compiler is not publicly available, so I am opening an issue instead of a PR.