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

Default fonts are vertically offset on some Linux distributions #1170

Closed
Tyriar opened this issue Dec 28, 2017 · 12 comments · Fixed by #1790
Closed

Default fonts are vertically offset on some Linux distributions #1170

Tyriar opened this issue Dec 28, 2017 · 12 comments · Fixed by #1790
Labels
platform/linux type/bug Something is misbehaving
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Dec 28, 2017

VS Code issue: microsoft/vscode#36322

image

Getting around this will probably involve drawing a character and checking the pixels to see where it was drawn in the cell and adjusting as necessary. From what I can see this just happens on some fonts which happen to be default on Kali and Debian.

@rhamilto
Copy link

I'm seeing this in Chrome 64 on Fedora 26 where the default monospace font is DejaVu Sans Mono, but not in Firefox 58 on the same platform using the same font.

@AndrienkoAleksandr
Copy link
Contributor

+1 on Fedora 25. This bug do invisible symbol "_"

openshift-merge-robot added a commit to openshift/origin-web-console that referenced this issue Mar 1, 2018
Automatic merge from submit-queue.

Bump kubernetes-container-terminal to v3.0.0

Requires kubernetes-ui/container-terminal#35

![screen shot 2018-02-23 at 10 37 13 am](https://user-images.githubusercontent.com/895728/36602271-99eb8a40-1885-11e8-91d1-a5e63c4fd55b.PNG)
![screen shot 2018-02-23 at 10 37 38 am](https://user-images.githubusercontent.com/895728/36602273-99f55296-1885-11e8-8e27-927979047c9b.PNG)

Known issues:

* [Default fonts are vertically offset on some Linux distributions](xtermjs/xterm.js#1170)
  ![screen shot 2018-02-23 at 9 32 32 am](https://user-images.githubusercontent.com/895728/36599221-bf750902-187c-11e8-8f3f-becafbcbb46b.PNG)
* Firefox on Windows incorrectly calculates the terminal width due to padding on div.terminal.xterm
  ![screen shot 2018-02-23 at 9 33 56 am](https://user-images.githubusercontent.com/895728/36599319-0d1b7aba-187d-11e8-9705-4956454e92ac.PNG)
@Tyriar
Copy link
Member Author

Tyriar commented Mar 6, 2018

@AndrienkoAleksandr the underscore thing is probably happening due to #1138

This issue is about some fonts on Linux seems to not be drawing in the right spot.

@Tyriar
Copy link
Member Author

Tyriar commented May 1, 2018

This now affects Ubuntu 18.04 as well.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 29, 2018

I believe this has the same root cause as other funny font problems in the DOM on Linux using Chrome 66:

image

image

Maybe there's a Chromium bug tracking this?

foot added a commit to weaveworks/scope that referenced this issue Jul 2, 2018
- Also fixes actually using Roboto-Mono, xterm.js now only accepts
  fontFamily customization via the JS api. (uses `<canvas`).
- There is an issue (xtermjs/xterm.js#1170)
  if linux has to fall back to 'monospace' where things fail to render
  correctly, so provide a couple of common options so this rarely
  happens.
- If we distribute robo-mono in the webpack bundle that might also work.
@Demon000
Copy link

Demon000 commented Jul 2, 2018

Seems like even using Roboto Mono still doesn't fix the vertical alligment. A good example is the tmux status bar as shown in this picture.

image

This is on Firefox. On Chrome, the problem doesn't appear.

image

@Tyriar
Copy link
Member Author

Tyriar commented Jul 3, 2018

@Demon000 for Firefox that's this one #1055

lilic pushed a commit to lilic/scope that referenced this issue Jul 25, 2018
- Also fixes actually using Roboto-Mono, xterm.js now only accepts
  fontFamily customization via the JS api. (uses `<canvas`).
- There is an issue (xtermjs/xterm.js#1170)
  if linux has to fall back to 'monospace' where things fail to render
  correctly, so provide a couple of common options so this rarely
  happens.
- If we distribute robo-mono in the webpack bundle that might also work.
lilic pushed a commit to lilic/scope that referenced this issue Jul 25, 2018
- Also fixes actually using Roboto-Mono, xterm.js now only accepts
  fontFamily customization via the JS api. (uses `<canvas`).
- There is an issue (xtermjs/xterm.js#1170)
  if linux has to fall back to 'monospace' where things fail to render
  correctly, so provide a couple of common options so this rarely
  happens.
- If we distribute robo-mono in the webpack bundle that might also work.
satyamz pushed a commit to mayadata-io/scope that referenced this issue Jul 26, 2018
- Also fixes actually using Roboto-Mono, xterm.js now only accepts
  fontFamily customization via the JS api. (uses `<canvas`).
- There is an issue (xtermjs/xterm.js#1170)
  if linux has to fall back to 'monospace' where things fail to render
  correctly, so provide a couple of common options so this rarely
  happens.
- If we distribute robo-mono in the webpack bundle that might also work.
@scycer
Copy link

scycer commented Aug 20, 2018

Do we have any ideas for a temporary fix? Just running into this issue with Ubuntu and electron.

(update) for those with this issue i just changed the font family to find one that worked. Ubuntu mono seemed to do the job for me.

@EmpireJones
Copy link

EmpireJones commented Aug 23, 2018

Another workaround: changing the font size (from 14 -> 13, default font) fixed the issue for me in vscode.

@resoli
Copy link

resoli commented Sep 6, 2018

Changing fontFamily (to Ubuntu mono, for instance) does not fix, but makes the issue less evident: try to print two vertical extended bars

printf "\xe2\x94\x82\n\xe2\x94\x82\n"

or run some command that displays them (mc) and look at the gaps in vertical lines

@Tyriar Tyriar mentioned this issue Nov 20, 2018
@zwhitchcox
Copy link
Contributor

I'm havingthis problem on linux, but changing the font to 'Ubuntu mono' worked for me

@Tyriar Tyriar added this to the 4.0.0 milestone Jun 23, 2019
@Tyriar
Copy link
Member Author

Tyriar commented Jun 23, 2019

This issue was closed off as it's fixed in the experimental WebGL renderer addon. It's not ready yet but I'm closing this off so I don't forget about it. See this query for current webgl addon issues https://github.com/xtermjs/xterm.js/issues?q=is%3Aissue+is%3Aopen+label%3Aarea%2Faddon%2Fwebgl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform/linux type/bug Something is misbehaving
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants