Monday, January 5, 2015

Enabling bitmap fonts on Linux

The patched Terminus Fonts for Powerline (renamed to Terminess) comes as bitmap fonts (pcf).  After installing those fonts, you might still not see them appear as an option when choosing fonts.  It could be because bitmap fonts support might be turned off on your system.

To enable:

rm /etc/fonts/conf.d/70-no-bitmaps.conf
sudo fc-cache -fv

or if you don't have admin/root access then

cp /etc/fonts/conf.avail/70-force-bitmaps.conf to ~/.fonts.conf.d
fc-cache -vf ~/.fonts

Saturday, January 3, 2015

Powerline compatible Terminus Font for OSX

My preferred programming font (and what I set for my terminals whether it's on Linux or OSX) is Terminus.  While it's not on most Linux distribution by default, it's usually available through the distribution's package management system (yum, apt-get, etc.).

On OSX, it's a little more troublesome.  A search on Google will turn up three different versions in the first three results.  In the past, I've used the one here. However, if you use something like powerline or vim-airline it doesn't have all the symbols so for some things it will just use the characters like '>>' and '>'.

To have those nice symbols, you generally need a 'patched' version of the font that has those symbols (this just means they added the characters to the font collection).  You can find versions of many popular programming fonts here.

You'll notice that Terminus is part of the collection except that the format that is included isn't compatible with OSX.  Thus, I have always had to live with the characters above.  The latest version of Terminus TTF from here now includes the powerline symbols and so I was able to install it and now my status bar looks like all those other pretty ones out there!

Thursday, January 1, 2015

OSX load order of your bashrc

If you run bash, OSX doesn't loading your .bashrc file.  The first looks for /etc/profile and then it looks in the following for the first available one:

  1. ~/.bash_profile
  2. ~/.bash_login
  3. ~/.profile
If you keep your file in a .bashrc file then probably the best way is to source it from .bash_profile.