warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.38k stars 373 forks source link

Add support for font-agnostic pixel-perfect rendering of ASCII box drawing glyphs. #1940

Open colepeters opened 2 years ago

colepeters commented 2 years ago

Discord username (optional)

No response

Describe the bug

Text rendering in Warp appears to be messing with ASCII box drawing. For example, here's some Neovim UI which uses box drawing characters in iTerm (see the borders on completion and signature popovers, and the box drawing characters used in the status line and file explorer):

image

Here's the same UI in Warp, with line height set to the default 1.2:

image

Even with the line height set to 1 (which makes for really cramped reading), gaps still exist, and it also creates misalignment in the status line:

image

Aside from the noticeable vertical gaps, there's also some strange horizontal collisions, like this:

image

Hope this helps, please let me know if I can provide further info!

To Reproduce

Initialize any UI which uses ASCII box drawing characters. (For a basic example, try vtop.)

Expected behaviour

Box drawing characters should draw connected lines.

Screenshots

See above

Operating System

MacOS

OS Version

11.6

Shell Version

zsh 5.7.1

Warp Version

v0.2022.10.04.08.05.stable_00

Additional context

No response

Does this block you from using Warp daily?

No

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

No response

colepeters commented 2 years ago

Following up on 2 questions from @vorporeal in #1294:

  1. The font in these screenshots is IBM Plex Mono
  2. If I disable iTerm’s custom box drawing logic, I do get similar results to Warp (see below) — so I'm not sure if this means that what I'm seeing in Warp is not so much a bug but a lack of a feature 😅 image
unphased commented 1 year ago

Hey @colepeters Just curious what is the tool you're using to display the file tree in your screenshots? Is it a nvim plugin or feature of some sort? Thanks.

colepeters commented 1 year ago

@unphased That's nvim-tree :)

dannyneira commented 1 year ago

Thanks for submitting, we'll post any updates here.

Zabriskije commented 1 year ago

+1 Box-drawing characters have rendering issues in a simple tree command too (left iTerm, right Warp):

enhancetree

Both using Liga SFMono Nerd Font.

vorporeal commented 1 year ago

Yeah, this is because iTerm ignores the actual box drawing glyphs in the font you choose and renders the lines itself. We don't do this yet (but plan to in the future!), so the "niceness" of the rendering at the moment depends on the font you're using.

I updated the labels and title for this issue to better reflect that this is a not-yet-implemented feature and not a bug, per-se.