Repository navigation
Draw a connect screen in the CJK faces only when it has wide glyphs - #201
Merged
Merged
Conversation
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
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 3
✨ Finishing Touches
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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--monoon the same machine every one of those measures 7.22px.How:
AnsiQuoteadds awideclass to the figure whenScreen.HasWideRunes, and onlyfigure.ansi.wide preuses--mono-cjk.--monogains Menlo, DejaVu Sans Mono and Liberation Mono, becauseui-monospaceandSFMono-Regularresolve 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