Author Topic: Monospace Font  (Read 5536 times)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Monospace Font
« 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?

Online oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12022
    • Travis build status
Re: Monospace Font
« Reply #1 on: November 12, 2012, 09:00:19 am »
Why don't you report this to ubuntu developers?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Monospace Font
« Reply #2 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Online oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12022
    • Travis build status
Re: Monospace Font
« Reply #3 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...

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Monospace Font
« Reply #4 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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Monospace Font
« Reply #5 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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."