[20.04] Nerd Fonts patcher on Focal Fossa using Python 2.7

:ubuntu_mate: This is only for Focal Fossa. This guide is useless on all other Ubuntu version.

:ubuntu_mate: Introduction

Want to use Nerd Fonts on Ubuntu MATE with your own font families but can't get FontForge CLI tools working in Ubuntu 20.04? With a little bit of time, effort and the complete abandonment of Python 3 you should be able to perform the steps in this guide to get an older copy of FontForge running, so the Nerd Fonts patcher script cooperates.

Mind, this is subject to change. Once they add in Python 3 compatibilitty and there are special instructions for 20.04 onward, there is no reason for this guide to exist. But for the time being, if you want to patch your own fonts up rather than use the provided copies from Ryan's git repo then this is what I found to work using a live session of Ubuntu MATE 20.04.

:snake: You will have to completely give up Python 3 since the sofware relies on Python 2.7, which means if python-dev-is-python3 was ever installed — Well, sorry about that.

:jigsaw: Supporting software

For the font patcher to operate with Python 2.7 libraries, some older software from Ubuntu 19.10 needs to be acquired. As follows:

:fast_forward: For brevity it will be assumed the received files reside in $HOME/Downloads.

:arrow_down: Downgrading Python

If you had installed python-dev-is-python3, then to downgrade Python is relatively simple;

:heavy_dollar_sign: In x-terminal-emulator:

sudo apt-get install -y python-dev-is-python2

The above will remove most Python 3 entries, which will allow for the installation of older FontForge libraries the rest of this guide will cover.

:install: Installing the software

First install what you can by default:

:heavy_dollar_sign: In x-terminal-emulator:

sudo apt install -y python-configparser

Then install what you can't without external files :fast_forward::

:fast_forward: Assuming $HOME/Downloads; modify as necessary.

:scissors: Due to lack of wraparound for commands, multiple apt commands are shown. They can be combined into a single command if desired.

:heavy_dollar_sign: In x-terminal-emulator:

cd ~/Downloads
sudo apt install -y ./libspiro0_0.5.20150702-8_amd64.deb
sudo apt install -y ./libfontforge2_20170731_dfsg-1build1_amd64.deb
sudo apt install -y ./python-fontforge_20170731_dfsg-1build1_amd64.deb

:cog: Seeing if it works

Once installed, go into the Git repository where the Nerd Fonts patcher is, and attempt to execute it. You can test with the following command:

:file_folder: Assuming you're already at the Nerd Fonts directory.
:heavy_dollar_sign: In x-terminal-emulator:

./font-patcher --help

If the program outputs helpful text, then you can continue as desired for patching fonts Nerd Fonts doesn't provide by default. Have fun!

1 Like