About Fonts

Dominik Ritter edited this page Jul 31, 2018 · 6 revisions

General Information about Fonts

P9k, and many of the segments it contains, uses special characters not included in most fonts. Thus, rendering these special characters requires that you install & configure fonts that contain those characters (Installation Instructions).

There are three different ways to configure your terminal and P9k to use these fonts:

  1. Use a font that already contains all necessary characters. That is called using a "patched" font. The advantage of this method is that you just need to install one font. The disadvantage is that you are limited to the icons provided by that font.
  2. Use a method of falling back from one font to another - if the character you want to display is not in one font, then automatically check the next one, and so on. This requires the use of an additional program, fontconfig. The advantage of this method is that you can configure many fonts and use characters from all of them. The disadvantage is that the setup is more complicated.
  3. Some terminal emulators (like iTerm2) allow you to configure text and non-ASCII fonts separately. This provides yet another method for font configuration. This is something of a special case and is not covered in detail here.

P9k Configurations

The most basic form of a powerline prompt looks like this:

So, you can see there are only the segment separators (the triangles) and a git-branch icon present.

But there are fonts out there that contain a lot of icons, like Nerd-Fonts or Awesome-Terminal-Fonts. Here is a demonstration of Awesome-Terminal-Fonts in a prompt:

The different POWERLEVEL9K_MODEs are:

Configuration value Description
default For regular powerline fonts, or if you want a (mostly) icon less terminal.
awesome-fontconfig If you use Awesome Terminal Fonts with fontconfig, without the named icons.
awesome-mapped-fontconfig If you use Awesome Terminal Fonts with fontconfig, including named icons (e.g. $CODEPOINT_OF_AWESOME_CHECK).
awesome-patched If you use Awesome Terminal Fonts with a pre-patched font.
nerdfont-complete If you use Nerdfonts in complete variant.
nerdfont-fontconfig If you use Nerdfonts in a fontconfig setup.

To configure your system, you need to install the font or font-package of your choosing, tell your terminal to use that font, and set your POWERLEVEL9K_MODE appropriately. Remember to set the POWERLEVEL9K_MODE before you apply/specify the theme in your ~/.zshrc.

If in doubt, take a already patched font (awesome-patched or nerdfont-complete). These are far easier to setup, than a full fontconfig setup.

Installing Fonts

Pre-patched Font

Installing a pre-patched font is fairly easy. Just download the desired font and double click it. A dialog should pop up, guiding you through the installation process. After you installed the font, you need to configure your terminal emulator to use that font.

Setup fontconfig

Good installation instructions for fontconfig can be found in the Awesome-Terminal-Fonts README for Linux and in the wiki for OSX.

One note on Awesome-Terminal-Fonts: they do not come with the powerline icons (the segment-separator triangles) included. If you do not use a base font that has them already included, you have to include them yourself. One option for doing this is to copy the original powerline font into ~/.fonts (and to configure it in your fontconfig-configuration, of course).

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.