Skip to content

fix(terminal): preserve glyph size and correct grid proportions; improve native reading - #770

Merged
Kuddev merged 7 commits into
mainfrom
fix/restore-font-metrics-20261025
Oct 25, 2026
Merged

Kuddev merged 7 commits into
mainfrom
fix/restore-font-metrics-20261025

Conversation

@Kuddev

@Kuddev Kuddev commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Result / 用户结果

Keep ordinary terminal glyphs at the selected font size while correcting stretched character art. The default row is twice the already-rounded device-pixel column width, and styled/fallback text shares the primary face's baseline. Explicit theme line heights and offsets remain supported. Native Windows inspection changed a Maple 14px Braille circle from 387×499 to 387×387 pixels; isolated text ink stayed 370×27 pixels. Maple 13px and Consolas 14px produced 355×355 circles.

Powerline and interface icons use an independent 1.94 MB symbol face. Complete Maple stays bundled and registers when selected by terminal, CJK, interface or theme draft fonts. Settings now exposes the existing interface-font preference. JSON output uses a selectable, collapsible tree with inline short arrays and useful collapsed previews; Markdown selection works and formula scrollbars stay beside their own content.

Design / 设计边界

Typography owns grid measurement and baseline placement; the existing terminal geometry renderer owns Braille, boxes, blocks and Powerline. Glyph sizes and outlines are unchanged. Startup, prepaint, PTY dimensions, selection and cursor geometry share the same cell metrics. Symbol-font registration belongs to the application lifecycle; system font names use the existing platform adapter. JSON parsing and bounded tree state remain separate from GPUI presentation. No new runtime dependency, persistence key, terminal protocol or background service is introduced.

The new proportional-grid note supersedes the intermediate natural-row rollback in this branch. Font selection remains explicit; switching away does not unload already-registered native font caches.

Evidence / 验证依据

  • Windows GPUI product build passed with the locked Rust 1.97.1 toolchain. cargo fmt --all -- --check, architecture checks against the updated main base c7e3e8a, and git diff --check passed.
  • Final focused font/grid/terminal/reading regression: 122 passed, 0 failed, 2 opt-in tests ignored, using an isolated configuration directory. A preliminary run without isolation read a local history entry in a completion test; rerunning the complete selected suite with isolation passed without changing completion code.
  • Grid policy covers six display scales, six font sizes, four column advances and both width modes. Baseline checks preserve the shaped layout and original font size.
  • Native Windows captures at 150% cover Maple 13/14px, Consolas 14px, text-only A/B, JSON, Markdown and interface-font settings. Fastfetch 2.70.0 ran in the newly built product's real ConPTY session, exited zero, and rendered the Windows 11 logo with aligned information and following output.
  • Earlier directly relevant validation: 103 settings tests, 24 i18n contract tests, 55 architecture checker tests and 2 file-budget tests passed. Symbol-font regeneration was byte-identical.
  • Baseline placement adds arithmetic per shaped run without extra allocation or shaping. The 60-frame Maple fixture had median draw CPU 4.73ms versus 4.29ms with taller rows; the new grid shows more rows, so these are local fixture measurements rather than an isolated overhead benchmark.
  • macOS/Linux desktop inspection, process RSS comparison and cross-screen JSON drag-selection acceptance were not run locally. No distribution package is included. One earlier ancillary application link failed for disk space; the required product was subsequently rebuilt successfully after removing old build artifacts.

Required Review / 必须确认

  • Followed contribution, architecture and project constraints.
  • Shared behavior retains one authority; no mechanical file splitting.
  • Architecture checks pass without increasing budgets.
  • Validation and platform limitations are stated.
  • New UI strings use typed identifiers with matching English/Chinese placeholders.
  • No governance policy changes.

@github-actions github-actions Bot added the size/L 501–1500 行 label Oct 25, 2026
@Kuddev
Kuddev merged commit cab1790 into main Oct 25, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L 501–1500 行

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant