VSCode monospace fonts are not monospaced, how to fix this?
Asked Answered
C

1

6

Not sure if I messed up something in the settings, even though all the fonts in Text Editor Settings are monospace fonts, but some words get rendered not monospaced, noticeably for 'fi', it seems that the 2 characters only occupy one space, like in 'file', 'fix', 'Identification', etc. What should I do to fix that?

I tried a number of different fonts and rearranged them. Currently the Font Family setting is: Menlo, Monaco, 'Courier New', monospace, but the problem never goes away.

macOS Mojave Version 10.14.6

VSCode Version: 1.37.0

Chatelaine answered 14/8, 2019 at 14:58 Comment(2)
I turned it off on both Users and Workspace settings, and it works now. Thanks a ton!Chatelaine
turned it into an answer instead, since most users won't know the name for this kind of behaviour, and so won't know what to websearch for (if you do know the name, the solution is trivially found)Brummett
C
7

That kind of "collapsing into a single glyph" for things like fi and fl are called ligatures. Why they'd be in a monospaced font at all, I have no idea, but you can turn those off in "settings" -> "ligatures" -> then making sure that checkbox is turned off.

Concurrence answered 14/8, 2019 at 15:16 Comment(2)
I also found that the Font Ligatures setting has no effect on 'Courier New' when I put it at the first. I just didn't try that before. That should be the behavior for all monospaced fonts.Chatelaine
Thanks for the correct definition of "ligatures". It helped me to fix it in a totally different IDE. I've experienced the same issue in Intellij Idea 2019.02 (macOS Mojave). After an automated update, my code screwed up with ugly "fi" ligatures. And I was able to find and turn it off under "Preferences > Editor > Font > Enable font ligatures". And I'm completely confused why ligatures are applied in monospaced fonts.Monopode

© 2022 - 2024 — McMap. All rights reserved.