Skip to content

Draw a connect screen in the CJK faces only when it has wide glyphs - #201

Merged
HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-uafn4b
Oct 20, 2026
Merged

HarryCordewener merged 1 commit into
mainfrom
claude/project-thread-uafn4b

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

Requested by Grave · project thread

Before: on a reader without Cascadia Mono or Consolas (most Linux desktops, or Chrome/Firefox on a Mac), an ASCII banner built from █ and ▄, such as /g/mygame-5, rendered every block twice as wide as the spaces around it, so the logo came out ragged.

After: such a screen renders in a Latin monospace face where blocks and spaces have the same advance. Screens that contain a double-width glyph still use the CJK stack.

The stored banner is fine. It is plain SGR (1m, 33m, 0m…), bare \n, no tabs or cursor moves, and the columns line up in the text. The cause is the font stack. Every connect screen used --mono-cjk. Its Noto Sans Mono CJK, MS Gothic and SimSun faces draw East Asian Ambiguous characters (block elements, box drawing) two cells wide, and with no Latin face in front, those faces draw the whole screen. Measured in Chromium with Noto Sans Mono CJK SC at 12px: space 6px, █ 12px, ▄ 12px. With the new --mono on the same machine every one of those measures 7.22px.

How: AnsiQuote adds a wide class to the figure when Screen.HasWideRunes, and only figure.ansi.wide pre uses --mono-cjk. --mono gains Menlo, DejaVu Sans Mono and Liberation Mono, because ui-monospace and SFMono-Regular resolve only in Safari and Courier has no block elements. One new test covers the class.

Not built locally: the .NET SDK download host is blocked from this session, so CI is the first build.


Generated by Claude Code

Every connect screen used --mono-cjk, whose Noto/MS Gothic/SimSun faces
draw East Asian Ambiguous characters (block elements, box drawing) two
cells wide. A reader without Cascadia Mono or Consolas falls through to
those faces for Latin text too, so an ASCII banner built from █ and ▄
rendered every block at twice the width of the spaces around it.
Measured in Chromium with Noto Sans Mono CJK SC at 12px: space 6px,
█ 12px.

Screens without a double-width rune now use --mono, and the figure gets
a `wide` class when they have one. --mono gains Menlo, DejaVu Sans Mono
and Liberation Mono, since ui-monospace and SFMono-Regular resolve only
in Safari.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y8B9umJggwfAHzzLUPUyVj
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: a805857c-667e-4a26-aca8-aae91f8db508
📥 Commits

Reviewing files that changed from the base of the PR and between 5126360 and f480b29.

📒 Files selected for processing: 3
  • src/MUI.Web/Components/AnsiQuote.razor
  • src/MUI.Web/wwwroot/app.css
  • tests/MUI.Web.Tests/Text/AnsiTests.cs
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@HarryCordewener HarryCordewener self-assigned this Oct 20, 2026
@HarryCordewener
HarryCordewener marked this pull request as ready for review October 20, 2026 15:22
@HarryCordewener
HarryCordewener merged commit dd5c559 into main Oct 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants