Skip to content

[CTX-0157] feat(render): readable default cell spacing + font stack (#253) - #296

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-0157/feat-readable-defaults
Sep 5, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-0157/feat-readable-defaults

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Readable defaults + documented Nerd fallback (CTX-0157).

Closes #253.

Priority: P2 | Area: render | Labels: feat,area:render,P2 | Milestone: v0.1.0 | RFC: - | Task: CTX-0157

What

  • Default font: JetBrainsMono Nerd Font 12pt (was monospace 12); matches ghostty-Linux acceptance probe.
  • New tunables via init.lua (optional, backwards compatible): font.line_height default 1.2, font.letter_spacing default 1.0px.
  • Effective cell 9x19 from legacy 8x16 base (breathing room); RuntimeConfig/RegistryConfig defaults updated; app wires effective cell end-to-end.
  • Documented fallback chain: JetBrainsMono Nerd Font -> JetBrains Mono -> monospace -> DejaVu Sans Mono (+ helper + tests). Per-glyph shaping stays deferred per ADR-0004.

Why (ghostty/kitty comparison)

  • Measured JetBrainsMonoNerdFont-Regular (fontTools, UPM 1000, asc 1020/des -300, adv 600): 12pt@96dpi = 16px em -> advance 9.6px, line 21.1px. Legacy 8x16 ~20% narrow / ~32% short -> cramped.
  • Ghostty Config.zig: font-size 12 Linux, embedded JetBrains Mono + symbols-only Nerd fallback, adjust-cell null. Kitty definition.py: font_family monospace, font_size 11.0, builtin Nerd font. New 9x19 sits between legacy and true metrics, near kitty-11pt (8.8x19.4).

Tests

  • New: types defaults/fallback/effective-cell; merge spacing scalar-replace; reload Live + diff; file/lua spacing parse + fail-closed; runtime defaults + pixel_extent 720x456; app spacing wiring.
  • Updated pixel expectations for 9x19 (runtime lib, resize_scrollback, selection_clear/clipboard, v01, window_winit, registry rects 720x456).
  • Gates: cargo fmt --check; cargo clippy --workspace --all-targets --locked -- -D warnings; cargo test --workspace --lib/--tests; cargo check --target x86_64-pc-windows-gnu; actionlint; act -n (ci.yml). All green.
  • Live Hyprland side-by-side SKIPPED (seat0 active, no pty here, cargo-run forbidden); screenshot-free metrics evidence in worktree recording/ctx-0157/SKIP-LIVE.md (uncommitted).

Risks

  • Default cell/geometry change (640x384 -> 720x456 @80x24) shifts window size and grid derivations; DPI/scale tests updated but visual spot-check still needed by reviewer on idle seat.
  • Scope overlaps (Definite): CTX-0180 file.rs, CTX-0185 runtime.rs, CTX-0182 runtime/* — all file-level, function-disjoint, worktree-isolated; merge ordering via commander.

@Xuepoo Xuepoo added the feat Feature label Sep 5, 2026
@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 5, 2026
@Xuepoo Xuepoo added area:render Area: rendering P2 Priority: medium labels Sep 5, 2026
…253)

Default family JetBrainsMono Nerd Font 12pt with line_height 1.2 / letter_spacing 1px (effective 9x19 from legacy 8x16); documented fallback chain; init.lua tunable. Justified by JetBrainsMono 12pt metrics (9.6x21.1) vs ghostty 12 / kitty 11.
@Xuepoo
Xuepoo force-pushed the ctx-0157/feat-readable-defaults branch from 216ced3 to c3a8656 Compare September 5, 2026 12:24
@Xuepoo
Xuepoo merged commit eb6fd43 into main Sep 5, 2026
16 of 17 checks passed
@Xuepoo
Xuepoo deleted the ctx-0157/feat-readable-defaults branch September 5, 2026 13:01
Xuepoo added a commit that referenced this pull request Oct 16, 2026
…th (#2131) (#2166)

Yazi selects its image driver off the honest child environment plus
query answers: with no known brand it sends the KGP support probe and
reads Unknown{kgp, sixel} off the replies, mapping (true, false) to
KgpOld. Bitty answers every clause (a=q OK, non-zero 16t cell probe
from #2148, honest Bitty XTVERSION, sixel-free DA1, themed OSC 11), so
kitty is selected with no manual flags; the KgpOld wire flow
(a=T/C=1/q=2/z=-1 display, a=d/d=A erase) paints and clears. Pin that
contract with yazi-exact regression tests: the full detect battery in
terminal_queries plus the end-to-end display/erase flow in
kitty_images_present.

Chafa stays name-gated upstream (1.18.3 sends no KGP probe even with
--probe=on; verified empirically): bitty cannot force kitty output
without spoofing another terminal identity, so the bitty-side fix is to
keep advertising bitty itself (TERM_PROGRAM=bitty, sanitized outer
fingerprints) and let query-based detectors select kitty. Refresh the
stale CTX-0194 rationale, which predates kitty support, to match.
Sixel honesty is unchanged: DA1 claims no sixel, sixel DCS stays
ignored, symbols fallback untouched. Upstream recognition requests
(chafa bitty rule per ghostty #296 precedent, yazi bitty Brand) are
follow-ups, not this PR.

Co-authored-by: reviewer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:render Area: rendering feat Feature P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Widen default cell spacing + ship a readable default font stack

1 participant