xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.72k stars 1.63k forks source link

Try position nerd font and powerline glyphs absolutely in the DOM renderer #3287

Open Tyriar opened 3 years ago

Tyriar commented 3 years ago

From https://github.com/microsoft/vscode/issues/120129#issuecomment-812724879

The DOM renderer works a little differently, to get cells to align perfectly they are laid our using inline-block and regular rely on the regular flow of the page as opposed to absolute positioning for performance reasons. I wonder if we could take the nerd font glyph ranges and the powerlines glyph ranges, and handle them specially. Positioning absolute won't work but I wonder if we could do some something using :before { content: '' } so that it could be positioned absolutely on top of the cell 🤔

Surprisingly I didn't see the line on my tests, maybe it's only on certain font sizes or something.

Mellbourn commented 3 years ago

I said in the original ticket:

In Insiders, renderType is removed, so, as you say, you can't force it explicitly. If I set terminal.integrated.gpuAcceleration to off, I get this:

Delugia Nerd Font Book gpuAcceleration off

Here there is still a vertical line. Also, the double-width Nerd Fonts glyphs look cut off to single character width.

Some more info about my VSCode in case the issue is hard to reproduce:

Version: 1.56.0-insider
Commit: 550035808407c15252e581e8abe1b820b9d311ee
Date: 2021-04-02T05:23:43.134Z (16 hrs ago)
Electron: 11.4.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin arm64 20.3.0

These are my relevant font settings:

  "terminal.integrated.gpuAcceleration": "off",
  "terminal.integrated.fontFamily": "Cascadia Code PL, Delugia Nerd Font Book, CaskaydiaCove Nerd Font, Menlo, monospace",
  "editor.fontLigatures": "'ss02', 'ss03', 'ss05', 'ss07'",
  "editor.fontWeight": "500",
  "editor.fontSize": 12,
  "terminal.integrated.fontSize": 12,

Simplifying these two settings made no difference:

  "terminal.integrated.fontFamily": "Delugia Nerd Font Book",
  "editor.fontLigatures": "off",

The occurrence of the vertical lines seem dependent on font size! 10 has two lines

Delugia Nerd Font Book gpuAcceleration off 10

11 has one line

Delugia Nerd Font Book gpuAcceleration off 11

12 has one

Delugia Nerd Font Book gpuAcceleration off 12

13 has one on each end

Delugia Nerd Font Book gpuAcceleration off 13

14 has a very thin line

Delugia Nerd Font Book gpuAcceleration off 14

The position of the vertical lines kept changing as I increased the font. The lines seem to be approximately constant width, so as the font grows they become less and less noticeable.