Use Google to generate the CSS for the font, then include it using wp_register_style() and/or wp_enqueue_style() WordPress functions. This should probably be generalized to accept font name parameters, as well as probably moved out into a plugin.
Once a decade or so I get to review my Vim configuration, which also usually brings my attention to all the things surrounding – bash, terminal, etc. This time around I wasn’t looking for anything in particular, but somehow I stumbled across the Top 10 Programming Fonts. Of course, this one of those lists that will vary from person to person, but given that I am not particularly into fonts, I thought I’d just try the ones recommended and maybe switch my day-to-day font to something better.
Gladly, these days, trying TrueType Fonts on Linux is really easy. Many are available directly through package management. The ones that not, can be simply downloaded into the fonts folder (/usr/share/fonts or ~/.fonts or whatever your distribution supports). Trying out the fonts from that article, I arrived to these conclusions:
- Inconsolata is going to be my font of choice for now. It’s quite different from everything I’ve been using until now, in particular, it’s much thinner. But I love how easy it makes distinguishing zeros from upper O’s and ones from lowercase L’s. Bonus points for being available through yum install levien-inconsolata-fonts.noarch .
- If Inconsolata weren’t easily available, I’d go with Droid Mono. Which is available through yum install google-droid-* . It’s very easy on the eyes, even if it doesn’t differentiate 0/O and 1/l so well.
- I would have never chosen Monaco – even though it’s easy to try. I find this surprising, as I though Apple were very picking about their fonts. Maybe they are. But Monaco is hard on the eyes. I’ve opened a couple of screen of ugly code and my eyes nearly bled from lack of space and the amount of curvy edges. To each his own though.
- Microsoft’s Consolas is a good font and I remember trying it out before. But given that it’s not that easy to find around and install, I decided to completely ignore it this time.
What’s your favorite font for programming?
Type Fight started as a project to distract Drew Roper, Ryan Pauleand Bryan Butler from their day-to-day grind. Each week they ask two designers to create the same letter and pin them against each other in the typographic ring to battle it out for best looking character.