Page 1 of 1

Is "Courier" monospaced? (and some other stuff)

Posted: Fri Apr 01, 2011 7:45 pm
by Zach
I had thought that it was, and even sources I found on the 'net say it is. But I have been annoyed for a really long time, with problems during coding where my pitch would deviate depending on the characters I used in a line. This is extremely annoying because I like things to be proper and symmetrical, so I've been looking at other fonts to try and solve the problem..

Right now I've settled on using "Consolas" because everything lines up and it is similar enough to Courier. I did try "Courier New", but it looked ugly to me, and I've noticed some weird resizing mechanics I don't think I've seen in other applications (although I could be wrong).

If you change the point size, to the next in the list, depending on the size the aspect ratio of the font appears to distort.. It is more noticeable on some then others, although perhaps it is an optical illusion.. It seems some of them grow taller with particular point sizes, while the next point size (up or down) seems to correct the issue and it looks proportionate again.

What are the observations of others regarding Fonts in the IDE? Which font do you prefer? Which size? I like small sized fonts that are just large enough to read, and keep a lot of info on the screen.. But I may have to look beyond Consolas, because I can see the ClearType Artifacts (I am assuming) in certain cases for some reason, and I don't wish to turn it off because I like the effect overall :p Usually going beyond 10 makes the text bigger than I prefer (which says a lot @ 1080p)..

Oh well.. just kind of a random subject I felt like bringing up :)

edit: This is really strange.. even Fixedsys and Terminal do not have Columns that perfectly line up! :| Although turning Consolas to Bold helped with the ClearType Artifacts.

Re: Is "Courier" monospaced? (and some other stuff)

Posted: Fri Apr 01, 2011 10:19 pm
by moogle
Zach wrote:edit: This is really strange.. even Fixedsys and Terminal do not have Columns that perfectly line up! :| Although turning Consolas to Bold helped with the ClearType Artifacts.
I think it is because some keywords are bold and take different widths than normal :)

Re: Is "Courier" monospaced? (and some other stuff)

Posted: Sat Apr 02, 2011 2:05 am
by Zach
I guess that's true.

I'm pretty happy with the Font setup I have now though.. Now I've been working on a Color theme, trying to get it just right 8)
I like the Black Theme, but its too high a contrast, so I'm making a lower contrast theme with dark colors. Hopefully it'll come out nice.. I keep deciding I'm happy then changing something, which throws something else a little off whack...lol

Re: Is "Courier" monospaced? (and some other stuff)

Posted: Sat Apr 02, 2011 12:16 pm
by Trond
Do you use tabs or spaces for indent? If you mix them, that could be a reason for things to not line up.

Re: Is "Courier" monospaced? (and some other stuff)

Posted: Sat Apr 02, 2011 3:16 pm
by Zach
I use Tabs, in fact I started looking at other fonts because I got so sick of having to adjust my tabbed-out comments with regular spaces to make them -mostly- line up.

But I'm sure its probably the issue with Keywords, because I tested it thuroughly and even when I made sure to tab out (from the end of whatever code line I was writing) that I was tabbing to the same exact column number.

Here are two examples to illustrate. Same document, different Font.

Consolas
Image

Courier
Image

In fact I just noticed the option "Enable Bolding of Keywords". If you turn it off, Courier lines up properly just like Consolas. Turning it on or off makes no effect on Consolas however, it always lines up.

Re: Is "Courier" monospaced? (and some other stuff)

Posted: Sat Apr 02, 2011 3:27 pm
by moogle
Zach wrote:In fact I just noticed the option "Enable Bolding of Keywords". If you turn it off, Courier lines up properly just like Consolas. Turning it on or off makes no effect on Consolas however, it always lines up.

Seeeeeeeeeeeeeeeeeeeeee :twisted:

Anyway thanks. I've just switched to consolas, because I'm so OCD like that and want the comments to line up :D

Re: Is "Courier" monospaced? (and some other stuff)

Posted: Sat Apr 02, 2011 3:56 pm
by Trond
What you need to make comments line up is a font where all characters (bold or not) are the same size. Courier (old) has all characters in same size, but doesn't have bold characters at all. The bold courier is artifically generated by the font renderer, and thus the characters aren't the same size any more.

Select a monospace font with a bold variant (that is, when you click bold in the list, at the bottom of the font selector it should NOT say "this font style is imitated for the display") and your comments will line up.

Also, using tabs is just a mess with current editors. I recommend unchecking "use real tab" in Preferences -> Editor.

Re: Is "Courier" monospaced? (and some other stuff)

Posted: Sat Apr 02, 2011 6:26 pm
by Zach
I misspoke earlier, I do not use "Real Tab", I had it unchecked.

In any case, I think my issue is solved with the current setup I have going now :)