xterm.js icon indicating copy to clipboard operation
xterm.js copied to clipboard

Underline with canvas uses less spacing

Open Tyriar opened this issue 3 years ago • 3 comments

VS Code issue: https://github.com/microsoft/vscode/issues/158874

  • set setting terminal.integrated.gpuAcceleration: canvas
  • in a terminal type
echo -e "\x1b[4:3m"  # curly underline
echo -e "\x1b[4:4m"  # dotted underline
echo -e "\x1b[4:5m"  # dashed underline
Screenshot 2022-08-23 at 12 18 35
  • set setting terminal.integrated.gpuAcceleration: on Screenshot 2022-08-23 at 12 21 56

Note that the spacing of the underline differs: with canvas it is a bit too close to the text

Tyriar avatar Aug 23 '22 14:08 Tyriar

Here's a reference for how Word renders 12, 24, 36 and 48px Calibri:

image

Tyriar avatar Sep 02 '22 13:09 Tyriar

@Tyriar Is there a middle ground possible? Its just a gut feeling, but kinda both seem slightly off to me - like canvas is too close and webgl too far?

On a sidenote: In typography there are some support lines how far glyphs should run (found with a quick search: https://material.io/design/typography/understanding-typography.html#type-properties) - maybe there is also an official way how to do it for different underline styles (not mentioned in the link)?

jerch avatar Sep 02 '22 18:09 jerch

@jerch I had a bit of a WIP this morning for this where I get the alphabetical text baseline and push it down 1-2 css pixels which looked good, I think that's the approach we should take for the upper cap of the underline

Tyriar avatar Sep 02 '22 19:09 Tyriar