fix(fonts): match Ghostty CJK width scaling - #31
Merged
Conversation
Deploying restty with
|
| Latest commit: |
b5a444e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f6a251a5.restty.pages.dev |
| Branch Preview URL: | https://agent-fix-cjk-ic-width-scali.restty.pages.dev |
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.
Summary
ic_widthadjustment水advance, with Ghostty-compatible ex-height, cap-height, and line-height fallbacksRoot cause
Version 0.2.3 forced wide fallback faces to the primary em scale but bypassed the existing metric adjustment. Ghostty instead scales ordinary fallback faces by an em-normalized
ic_widthratio. For the bundled fonts, this ratio is1050 / 1000 = 1.05; retaining it increases the CJK advance from 13.64 px to 14.32 px in a 16 px two-cell span and removes the excess whitespace.Validation
bun test tests/fallback-font-layout.test.ts tests/symbol-rendering.test.tsbun run test:ci: 316 tests passedmetricAdjust=1.05,advancePx=14.3181818bun run build:typesbun run check:themesbun run format:checkbun run lintbun run buildbun run playground:buildFixes #24