DEV Community

Cover image for Add Powerline glyphs to IBM Plex fonts
Henry Wu
Henry Wu

Posted on

Add Powerline glyphs to IBM Plex fonts

IBM Plex is an interesting font that I'm looking forward to, and I would like to try it out. However, you may be in similar setup as I am, which relays on Powerline glyphs in order to display vim/statusline/prompt correctly.

Terminal prompt with missing glyphs

This walkthrough was performed on macOS and has patched IBM Plex OpenType fonts, but you should be able to patch your own fonts (any fonts) on any OS, as long as you have Python installed.

  1. Download IBM Plex:
    https://github.com/IBM/plex/releases

  2. Install fontforge:
    brew install fontforge

  3. Clone the font patch script from sgolovine on GitHub:
    git clone https://github.com/sgolovine/nerdfont-patcher

  4. Navigate to the directory:
    cd nerdfont-patcher

  5. Add Powerline glyphs to IBM Plex font:
    fontforge -script font-patcher --powerline ../OpenType/IBM-Plex-Mono/IBMPlexMono-Regular.otf
    (You may need to change the path-to-file, more info please refer to the README of nerdfont-patcher)

Terminal prompt with Powerline glyphs

Top comments (1)

Collapse
 
f0r3v3ran00b profile image
Sanju • Edited

Thanks for this!!! I got the following error when I first ran the script - TypeError: 'float' object cannot be interpreted as an integer, sourceFont[currentSourceFontGlyph].left_side_bearing = 0.0, line 716, in copy_glyphs etc.

Based on some googling and this, I tried changing the 0.0 to 0 in the font-patcher script, and it just worked :D !!!