Powerline provides a font patcher for custom glyphs like the segment dividers (arrows), branch symbol, padlock symbol, etc. The font patcher requires FontForge with Python bindings to work.
Check out the powerline-fonts repository on GitHub for patched versions of some popular programming fonts.
Warning
The code points have changed in this version of Powerline! This means that you either have to patch your font again, or change the glyphs Powerline uses in your user configuration.
Note
Powerline no longer works with rxvt-unicode unless you either use rxvt-unicode compiled with --enable-unicode3, or you use fonts patched with the legacy font patcher and change the glyphs in your user configuration.
Powerline stores all special glyphs in the Unicode Private Use Area (U+E000-U+F8FF).
Code point | Glyph | Description |
---|---|---|
U+E0A0 | | Version control branch |
U+E0A1 | | LN (line) symbol |
U+E0A2 | | Closed padlock |
U+E0B0 | | Rightwards black arrowhead |
U+E0B1 | | Rightwards arrowhead |
U+E0B2 | | Leftwards black arrowhead |
U+E0B3 | | Leftwards arrowhead |
The font patcher is located at powerline/fontpatcher/fontpatcher.py. It requires Python 2.7 and FontForge compiled with Python bindings to work.
Patched fonts are renamed by default (” for Powerline” is added to the font name) so they don’t conflict with existing fonts. Use the --no-rename option to disable font renaming.
Note
Bitmap fonts are not supported, and will probably never be supported officially due to difficulty creating a font patcher that works for bitmap fonts. The recommended method of patching bitmap fonts is to draw the glyphs manually using a tool like gbdfed.
Install fontforge with Python bindings. For Ubuntu users the required package is python-fontforge, for Arch Linux users the required package is fontforge. It should be something similar for other distros.
Run the font patcher:
$ /path/to/fontpatcher.py MyFontFile.ttf
Copy the font file into ~/.fonts (or another X font directory):
$ cp "MyFontFile for Powerline.otf" ~/.fonts
Update your font cache:
$ fc-cache -vf ~/.fonts
If you’re using vim in a terminal you may need to close all open terminal windows after updating the font cache.
Gvim users: Update the GUI font in your vimrc file:
set guifont=MyFont\ for\ Powerline
Terminal users: Update your terminal configuration to use the patched font.
Open vim and enjoy your new statusline!
Check if you have a FontForge version with Python support by running fontforge -version. You should see something like this:
$ fontforge -version
Copyright (c) 2000-2011 by George Williams.
Executable based on sources from 13:48 GMT 22-Feb-2011-D.
Library based on sources from 13:48 GMT 22-Feb-2011.
fontforge 20110222
libfontforge 20110222
Make sure that the executable version number doesn’t have NoPython in it. If everything looks OK, skip ahead to step 4.
If you have FontForge but with NoPython in the version number, please try to update to a later version:
$ brew uninstall fontforge
$ brew update
$ brew install fontforge
Note: You may have to use --use-clang instead of --use-gcc when compiling FontForge.
If you don’t have FontForge, install it with Homebrew:
$ brew update
$ brew install fontforge
Patch your fonts by passing the fontpatcher script as a parameter to FontForge:
$ fontforge -script /path/to/fontpatcher.py MyFontFile.ttf
Install the font by double-clicking the font file in Finder and click “Install this font” from the preview window.
Gvim users: Update the GUI font in your vimrc file:
set guifont=MyFont\ for\ Powerline
Terminal users: Update your terminal configuration to use the patched font.
Open vim and enjoy your new statusline!