Monospace Font - Not really Monospace?

2019-07-23 23:51发布

问题:

This appears to be a bug that I've found using JavaScript in Gedit (when you change the font from "Ubuntu mono" to "Monospace") and Geany so far. I have a right margin set to 80 chars, but when I type Object, prototype or any other key word bolded by the program, It adds some letter spacing that throws off the spacing just slightly.

Because of this, I have a line declaring Object that's 79 characters, but appears to be 81.5 characters. Can someone advise me on how to fix this? Is it a Text Editor setting? Is it an issue with the font itself?

回答1:

It's probably because your default monospace font doesn't have a native bold style. Just change the font. I'd suggest since you're in Linux, DejaVu Sans Mono or Liberation Mono; they'll work just fine.

Also, you'd think monospace would have a native bold style by now

If you're in Ubuntu you can download Unsettings and change the default monospace font so when you open programs that have "monospace" as font it'll be the one you chose.

Btw, this is not unique to Linux. Check out the default monospace font on a Windows cmd...