Inconsolata: The Programmer’s Friend

I can’t remember where I first heard of the Inconsolata font, but I am continually amazed at the quality, readability, and beauty of it. Inconsolata, though it is apparently a work-in-progress, is very easy on the eyes, and I don’t feel nearly as overwhelmed by dense text forests as when I’m using, say, Courier New — even DejaVu Sans Mono just doesn’t seem quite as nice. Inconsolata just seems to hit that perfect sweet spot of sans-serif, legible at 8 points or lower 😉 , and enjoyable to look at.

When looking at code, I prefer a variant — Inconsolata-dz to be precise — that adds straight single/double quotation marks to Inconsolata, which makes heavily quoted text (or code) much easier to look at.

Inconsolata works beautifully as a monospace font in many text-oriented apps — Quassel, Geany, Kate, etc. — however, I’ve been having a terrible time getting Inconsolata (or Inconsolata-dz, for that matter) to display properly in Konsole:

Inconsolata is broken!

Inconsolata is broken! Noooooooo!

Inconsolata breaks in Konsole, failing to display the ends of words properly. I suspect it is because somewhere Konsole is interpreting the words as a whole as if Inconsolata were a proportional font (incorrectly), but displays it as a monospace font in the Konsole (correctly). The solution to this has continually eluded me, so I’ve been using Courier as a stand-in until I get Inconsolata working 😦 . Ah well, a job for another day.

Fontmatrix 0.6.99

Fontmatrix 0.6.99 ready for action!

While I’m on the topic of fonts, I love Fontmatrix. As my day job, I do a lot of graphic design and typography, thus finding the “perfect” font is a big part of any project (as is remembering what fonts I used last time 😳 ). Fontmatrix lets you do lots of things that help you choose a font, compare fonts, use garbage text to get the look-and-feel of a typeface, even a “Playground” where you can do whatever.

I know this post isn’t strictly about programming or Python per se, but Inconsolata is a tool that I really like, use quite often, and helps me read monospace-formatted text much more quickly. What’s your favorite programming font?

UPDATE: I’ve been doing quite a lot of research and testing to see what it would take to get Inconsolata working in Konsole (and Kate suffers the same ill fate), and the answer is still evasive, though I think I understand what’s going on now.

All the fonts which aren’t working properly don’t have a proper and separate ‘Bold’ fontface, even though they show it as an option. Inconsolata and Inconsolata-dz are both only one font file that contains the ‘Medium’ version of the font, and other applications dynamically render the ‘Italic’, ‘Bold’, and ‘Bold Italic’ versions (i.e., they don’t really exist, but are generated on-the-fly when they are called for). Konsole and Kate obviously don’t generate dynamic fonts very well, but it may well be an underlying Qt problem with dynamic font rendering.

In fact, the worst part of this bug is that it renders every monospace font unusable in Konsole (or Kate, or wherever else it rears its ugly head) for all practical purposes, because dynamically bolding them makes only the bold characters wider — which totally defeats the reasons for using a monospace font at all!

The solution for now would seem to be to provide real italic/bold/bold italic versions of the font, so I may try my hand in FontForge just to have a working solution, but if the bug ignores separate fontfaces, too… I think I’ll have an aneurysm.

UPDATE #2: In case anyone wants to use Inconsolata/-dz in Konsole or Yakuake, you can make do with a setting that turns off the bolding of intense colors in the terminal. This means that Qt’s buggy dynamic bolding doesn’t get applied to Inconsolata at all. You of course lose the nice near-subliminal bold vs. normal text effect, but it’s pretty tolerable:

Inconsolata is fixable-ish!

Inconsolata is fixable-ish!

This doesn’t quite apply to Kate, but you can manually alter individual highlighting scenarios yourself to make a custom no-bold font/color scheme for Inconsolata:

Kate offers more granular options

Kate offers more granular options

While not true fixes, these can act as stand-in solutions until someone can make true ‘Bold’ Inconsolata/-dz variants or fix the buggy Qt font rendering.

UPDATE #3: By February 2013, KDE or Qt have managed to “fix” bolded console text by simply displaying the regular font face when there is no bold font face available. However, Google Web Fonts have made a fully hinted version of Inconsolata with a bold face! Simply download the current .ttf files and put them into ~/.fonts, and you are ready to go! (Run fc-cache -fv to rebuild your font cache in case it doesn’t show up right away. If that won’t work, restart your application to refresh its internal font selection.)

As was referenced in the comments, openSUSE hosts a version of Inconsolata that contains both bold and demi bold, but you’ll have to generate them from the .sfd files yourself.

Interesting to me as a Biblical languages major, there is also a version of Inconsolata with a Hellenic character set (no bold yet).

Finally, there is Inconsolata-g, a tweaked version of Inconsolata specifically for programmers’ needs. No bold face here either, but the modified glyphs and numbers make it much easier to tell at a glance which characters are which.

Advertisements

10 thoughts on “Inconsolata: The Programmer’s Friend

  1. SteveF

    Working in the Konsole seems so odd now not having that beautiful font anymore (I changed OS recently)…

    Any ideas on an inconsolata-like font that I could use as a substitute?

    Reply
    1. bgbraithwaite Post author

      I’ve looked in a number of places, but a non-bitmap font for programming is something of a rarity — and even then, it’s mostly a matter of personal preference. I recommend starting at the same places I did to find a good programming font:

      http://www.lowing.org/fonts/
      http://www.proggyfonts.com/
      http://www.codeproject.com/KB/work/FontSurvey.aspx
      http://www.codinghorror.com/blog/2004/12/progamming-fonts.html and http://www.codinghorror.com/blog/2007/10/revisiting-programming-fonts.html

      There were a couple of other pages I knew of, but I’ve lost track of them over time.

      [Sorry for the response being so long in coming — I thought I’d already responded, but I was browsing for errors, and found that I hadn’t. Hope this helps!]

      Reply
    1. bgbraithwaite Post author

      I tried your fixes out, and they didn’t work for me in Konsole, Yakuake, or Kate, even after two (!) restarts with the fixes applied. I’m not sure why it would work for you but not me; perhaps Kubuntu/Linux Mint KDE doesn’t use ~/.fonts.conf the same way as Ubuntu — but your guess is as good as mine. I’ll keep your solution in mind to try out on my other machines.

      Reply
      1. Pablo Carmona A.

        That’s weird. It’s supposed to use the ~/.fonts.conf if you have the link file /etc/fonts/conf.d/50-user.conf (which points to ../conf.avail/50-user.conf). In Ubuntu this the default option. I don’t know if KDE handles fontconfig in other way.

      2. bgbraithwaite Post author

        Well, I do have both /etc/fonts/conf.d/50-user.conf and /etc/fonts/conf.avail/50-user.conf, but I don’t know if they are actually being used. I’m going to have to look up how Kubuntu/Mint KDE use them, or if they do use them at all (they might be unused config files from the various GNOME programs I have installed).

    2. None

      It worked for me, thanks!
      I had to tweak the first value on the matrix (0,91 did it for me) AND disable hinting. Now bold and medium glyphs are the same width, albeit bold ones look thinner and more separated.

      Reply
  2. Pingback: 2010 In Review « Becoming A Glider

  3. Pingback: You’d Be Better Off With Inconsolata | Tuxrocket

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s