Code::Blocks

User forums => Using Code::Blocks => Topic started by: Alpha on November 12, 2012, 02:55:30 am

Title: Monospace Font
Post by: Alpha on November 12, 2012, 02:55:30 am
I have noticed that Ubuntu's default monospace font actually makes characters wider if they are bold.  For example, the following two comments would line up when I use Windows, but not when I use Ubuntu:
bold     // comment
not bold // comment


This is not exactly a Code::Blocks problem, but I was wondering if anyone had suggestions of what I could do about it (seeing a bolded if() not quite align properly is rather annoying).  Perhaps another font setting?
Title: Re: Monospace Font
Post by: oBFusCATed on November 12, 2012, 09:00:19 am
Why don't you report this to ubuntu developers?
Title: Re: Monospace Font
Post by: thomas on November 12, 2012, 11:42:31 am
A monospace font is not truly monospace when boldface is different from regular, if you ask me.

However, before complaining with them, you need to make sure this is really the bold variant, not a faux bold generated by... what's the backend, GTK/Cairo? If it's the latter, then it's just the "usual shit", and not something you can blame the font developers for. And, probably something one can't do about anything.
Title: Re: Monospace Font
Post by: oBFusCATed on November 12, 2012, 11:52:41 am
Code: [Select]
if       // comment
return   // comment
retur    // comment
For me this is perfectly aligned on Centos 5.8...

Title: Re: Monospace Font
Post by: Alpha on November 12, 2012, 11:12:19 pm
However, before complaining with them, you need to make sure this is really the bold variant, not a faux bold [...]
That would probably be the reason, if I had to guess, but I do not know how I would check.

I "fixed" the problem within Code::Blocks by switching the editor's font from its default setting of "Monospace" to "Liberation Mono" (now to see if I can do the same with system wide settings...).

Why don't you report this to ubuntu developers?
I plan to do that as well.
Title: Re: Monospace Font
Post by: thomas on November 12, 2012, 11:33:46 pm
However, before complaining with them, you need to make sure this is really the bold variant, not a faux bold [...]
That would probably be the reason, if I had to guess, but I do not know how I would check.
My guess would be that if it only opens one font file, it must be faux bold. If it's a bold face, it must at least open 2 font files. So, lsof | grep codeblocks or something similar should provide that info, I'd guess.

If it's faux bold, the next question would be why it does such a thing (unless no true font face is present, which pretty much makes the reason self-evident). If no good reason can be found, it would be a candidate for bug report to the GTK guys, I guess.