Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal font height incorrect since last update #84432

Closed
chris-findlay opened this issue Nov 10, 2019 · 35 comments
Closed

Terminal font height incorrect since last update #84432

chris-findlay opened this issue Nov 10, 2019 · 35 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member *duplicate Issue identified as a duplicate of another issue(s) electron Issues and items related to Electron gpu Issues concerning GPU related items terminal Integrated terminal issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Milestone

Comments

@chris-findlay
Copy link

Issue Type: Bug

Since the last VSCode update my terminal font is missing the bottom of its decenders, and altering line-height isn't helping - that just puts space between the lines.

The same font is still working fine in the editors.

VS Code version: Code 1.40.0 (86405ea, 2019-11-06T17:02:13.381Z)
OS version: Windows_NT x64 10.0.18362

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz (8 x 2494)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.88GB (0.55GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (20)
Extension Author (truncated) Version
tt-processor ais 0.8.0
vscode-apollo apo 1.12.0
npm-intellisense chr 1.3.0
vscode-postgres cko 1.1.11
vscode-svgviewer css 2.0.0
vscode-eslint dba 1.9.1
gitlens eam 10.1.2
EditorConfig Edi 0.14.2
prettier-vscode esb 2.3.0
terraform mau 1.4.0
rainbow-csv mec 1.3.1
vscode-docker ms- 0.8.2
mssql ms- 1.7.0
csharp ms- 1.21.6
vscode-typescript-next ms- 3.8.20191105
debugger-for-chrome msj 4.12.1
vscode-versionlens pfl 0.24.0
vscode-coverage-gutters rya 2.4.2
vscode-todo-highlight way 1.0.4
t4-support zbe 0.4.3

Works fine in the editor:
image

But not in the terminal window:
image

@f-aa
Copy link

f-aa commented Nov 13, 2019

This happens to me as well. My terminal is illegible. VS Code v1.40 using the Proggy Square (Slashed Zero) font available here: https://proggyfonts.net/download/

image

Environment:
Version: 1.40.1 (user setup)
Commit: 8795a98
Date: 2019-11-13T16:49:35.976Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.17134

@marvinside
Copy link

Since last VS-Code update, the Powerline Arrow to the Right renders not tall enough.
It seems 2 Pixels to small.

Font Used in the Screenshot: Fira Mono for Powerline
Ialso tested with Fira Code and Roboto Mono for Powerline. The Roboto seems to be only one Pixel to small.

Terminal Screenshot

@adamsandwich
Copy link

environment

版本: 1.40.1 (user setup)
提交: 8795a98
日期: 2019-11-13T16:49:35.976Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362

Same issue, my font Sarasa-Gothic, It seems that the font has been moved up a few pixels
Snipaste_2019-11-14_22-08-54

@joelamltc
Copy link

I changed the terminal renderer type to dom, seems things going well but canvas is not correct.

Canvas:
Screenshot 2019-11-18 at 13 03 35

DOM:
Screenshot 2019-11-18 at 13 03 17

@f-aa
Copy link

f-aa commented Nov 18, 2019

Changing render type to DOM seems to have corrected the line height for me as well. The text is however slightly blurry compared to using canvas as a render type.

image

@chris-findlay
Copy link
Author

Likewise for me - Canvas = crisp but wrong; Dom = bluryish but right. I'm stuck with Canvas so I don't get a headache, and guessing decenders since they aren't visible.

@chris-findlay
Copy link
Author

Now I look at it tho, the editor is also similarly blury, so being able to use the crisper text output there too would be nice.

@Tyriar
Copy link
Member

Tyriar commented Nov 19, 2019

This appears to be an Electron/Chrome bug possibly related to recent changes in textBaseline (https://crbug.com/890515, https://crbug.com/607053). The following screenshots were produced on Windows 10 by running the xterm.js demo after installing Proggy Square (Slashed Zero) ttf and setting fontFamily in the demo to ProggySquareTTSZ.

Electron 6 (Chromium 76, taken in VS Code):

image

Chrome 78.0.3904.108:

image

Edge (Chromium) 80.0.328.4:

image


Electron 4 (Chromium 69, taken in VS Code):

image

Firefox Nightly 72.0a1:

image

Edge (Old) 44.19013.1.0:

image

@Tyriar Tyriar added electron Issues and items related to Electron gpu Issues concerning GPU related items terminal Integrated terminal issues electron-6.0.x-update labels Nov 19, 2019
@Tyriar
Copy link
Member

Tyriar commented Nov 19, 2019

Also happens on macOS:

Edge 80.0.320.3:

Screen Shot 2019-11-19 at 7 23 43 AM

Firefox 70.0.1:

Screen Shot 2019-11-19 at 7 25 56 AM

@Tyriar
Copy link
Member

Tyriar commented Nov 19, 2019

@Tyriar
Copy link
Member

Tyriar commented Nov 19, 2019

@Tyriar Tyriar added upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream labels Nov 19, 2019
@Tyriar Tyriar added this to the November 2019 milestone Nov 19, 2019
@chris-findlay
Copy link
Author

I recommend we all go there and star it so it gets noticed more.

@Tyriar
Copy link
Member

Tyriar commented Nov 20, 2019

Minimal repro case:

<html>
<body>
<canvas width="200" height="200"></canvas>
<script>
const c = document.querySelector('canvas');
const ctx = c.getContext('2d');
// Draw a guide line at y where text is drawn
ctx.beginPath();
ctx.moveTo(0, 100);
ctx.lineTo(200, 100);
ctx.stroke();
// Draw the text
ctx.textBaseline = 'middle';
ctx.font = '30px Arial';
ctx.fillText('Works', 10, 100);
ctx.font = '30px ProggySquareTTSZ';
ctx.fillText('Doesn\'t work', 110, 100);
</script>
</body>
</html>

Chromium

image

Firefox

image

@chris-findlay
Copy link
Author

Please post that to the upstream bug.

@Tyriar
Copy link
Member

Tyriar commented Nov 21, 2019

Already did

@tigerinus
Copy link

Yes, experimentalWebgl breaks the rendering.
image

@Tyriar
Copy link
Member

Tyriar commented Apr 21, 2020

Tentatively assigning to May for debt week if there's time to see if there's a workaround.

@Tyriar Tyriar modified the milestones: On Deck, May 2020 Apr 21, 2020
@Tyriar Tyriar added the bug Issue identified by VS Code Team member as probable bug label Apr 21, 2020
@Tyriar
Copy link
Member

Tyriar commented Apr 22, 2020

Moving the webgl part to #95813. The textBaseline middle broken thing (this issue) is blocked on Chromium, but they say the font metrics have problems?

@hems
Copy link

hems commented Sep 21, 2020

Same happening here, "y" is being cut, looks like an "u" :(

image

I tried adding "terminal.integrated.rendererType": "experimentalWebgl", but did not fix anything, is it supposed to fix that issue?

I'm using ProggyCleanTTSZ as font downloaded from https://proggyfonts.net/download/

@veleek
Copy link

veleek commented Nov 20, 2020

I'm assuming this is the same thing that's causing my problem but adding details here as well.

VSCode Version: 1.50.1 (system setup)
OS: Windows_NT x64 10.0.20257

image
Extra height and some graphical artifacts on some of the powerline glyphs with the canvas renderer.

image
Slightly different behavior but same basic problem when using the dom renderer.

@hems
Copy link

hems commented Nov 20, 2020

Please have a look on this issue i created documenting how i finally fixed my font rendering problems on the terminal:

#107942 (comment)

@jefflundberg
Copy link

MacOS
VSCode 1.55.2
FiraCode Nerd Font
zsh with ohmyzsh powerlevel10k theme

auto (seems to switch between canvas and experimentalWebgl)

experimentalWebgl
image

dom
image

canvas 👈. this one looks good
image

@hologerry
Copy link

MacOS
VSCode 1.55.2
FiraCode Nerd Font
zsh with ohmyzsh powerlevel10k theme

auto (seems to switch between canvas and experimentalWebgl)

experimentalWebgl
image

dom
image

canvas 👈. this one looks good
image

image

On my machine, the icon is still been cropped.

@veleek
Copy link

veleek commented Apr 17, 2021

canvas 👈. this one looks good
image

Even this one still isn't perfect. The height of the arrow glyphs is too short. They should be the same height as the glyphs in the dom example

@Livven
Copy link

Livven commented May 21, 2021

This seems to have been fixed with 1.56 (or 1.55?) for me, using the webgl renderer on Windows.

image

See also #120129.

@Tyriar
Copy link
Member

Tyriar commented May 21, 2021

Yep vertical alignment was fixed up in that issue

/duplicate

@Tyriar Tyriar closed this as completed May 21, 2021
@unkindypie
Copy link

image
still have this problem

@Tyriar
Copy link
Member

Tyriar commented May 21, 2021

@unkindypie do you set the terminal line height setting

@unkindypie
Copy link

@Tyriar "terminal.integrated.lineHeight": 1

@hologerry
Copy link

image

The apple icon from powerline10k theme in zsh is still not aligned, it is cutted on the left.

In the iTerm2 app, it looks good:
image

@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member *duplicate Issue identified as a duplicate of another issue(s) electron Issues and items related to Electron gpu Issues concerning GPU related items terminal Integrated terminal issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests