Terminal font letter spacing is huge on Arch Linux (not on Windows or Ubuntu)
See original GitHub issueDetails
I’ve only tested this on Windows 10, Ubuntu, and Arch Linux, but I’ve only had the problem on Arch, in Chrome, Konqueror, Vivaldi, and GNOME Web. Essentially, the each character in the terminal is its normal width, but the space around it is doubled, so each character takes up the space of two. Here’s some images from Cockpit on Chrome, and some more from xtermjs.org, also on Chrome. And as I said, on Windows it’s not an issue.
- Browser and browser version: Chrome 81.0.4044.138 (Official Build) (64-bit), Konqueror 4.0.97, Vivaldi 3.0.1874.38 (Stable channel) (64-bit), and GNOME Web 3.36.2
- OS version: Arch Linux (last
pacman -Syu
was a day ago) - xterm.js version: 4.6.0 within the Cockpit terminal on Fedora Server 32, and even on the xtermjs.org website (!).
Steps to reproduce
- Open any of the browsers listed (and I don’t think it’s limited to just those, but curiously it’s not an issue in VS Code…) on Arch Linux.
- Look at an xterm.js terminal and observe the extremely wide letter spacing.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (8 by maintainers)
Top Results From Across the Web
[Solved]spacing between characters not correct on any termial ...
I'm using Xfce on my laptop. The fonts don't look right in any of the terminal emulators. I've tried Xfce terminal, guake and...
Read more >(Ubuntu) bad font rendering / weird letter spacing : r/linux4noobs
I'm asking because everything looks great on Windows which I've used before :/.
Read more >Why text in the gnome-terminal has characters slightly ...
The font you use in your terminal is not a monospaced font or the configuration file of the terminal has a font size...
Read more >Terminal Appearance in Visual Studio Code
fontSize : Changes the font size of text in the terminal. terminal.integrated.letterSpacing : Configures additional horizontal spacing between characters in ...
Read more >How to change the default font size of XTerm? - Ask Ubuntu
Using Monospace will not just change the size but use a quite different font (at least that's the case on Ubuntu 18.04). And...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here’s an addon that waits for fonts to load and then opens: https://github.com/CoderPad/xterm-webfont
Daniel, I finally understand the wisdom in your comment.
xterm.js creates a <span> element (xterm-char-measure-element) containing the letter “W” and measures its width using getBoundingClientRect() to determine the character width. However, if the webfont is not loaded before this, getBoundingClientRect returns an overly conservative width instead. Even if there is an @font-face in the style sheet, the browser does not load the font until it is used.
xterm-webfont uses fontfaceobserver to solve the font loading problem and generate an event when the font is loaded. Unfortunately, I never could get xterm-webfont to work because my project cannot use javascript modules. The workaround was simply to use fontfaceobserver directly.
So now I have the following in my html webpage, which gives me a single-spaced webfont:
Hopefully this helps someone in future.