hxin
hxin

Reputation: 1058

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

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

Upvotes: 8

Views: 7409

Answers (3)

Gibreel Abdullah
Gibreel Abdullah

Reputation: 395

For me it was because I had non ASCII text (Arabic, Tamil, Urdu) which are not monospaced in that font.

Upvotes: 0

Mina
Mina

Reputation: 17554

If you had this issue recently with Vscode, try this command.

ln -s ~/.local/share/fonts ~/snap/code/174/.local/share/fonts

Keep in mind that 174 is the VsCode version from snap, so you would change it if you have another version.

Source

Upvotes: 0

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.

Upvotes: 8

Related Questions