Contributor Developer Setup - nb5p/nerd-fonts GitHub Wiki
- The basics of what you need to get up and running :)
- Git
- FontForge
- FontForge python bindings
- Python 2 and/or Python 3
- ShellCheck
- Pyflakes (PEP8 compliance)
- Pandoc
- What you need to contribute to the core of Nerd Fonts
todo
- Download and install Python if not already installed: http://docs.python-guide.org/en/latest/starting/install/linux/
- check
python --version
- latest 2.x or 3.x should be fine
- check
- Download and install FontForge: http://fontforge.github.io/en-US/downloads/gnulinux-dl/
- version should be at least
20141231
- verify version:
fontforge --version 2>&1 | grep libfontforge | awk '{print $NF}'
- version should be at least
- Download and install FontForge module (FontForge Python bindings)
- e.g. on Linux Debian or Ubuntu:
sudo apt install python-fontforge
orsudo apt install python3-fontforge
- e.g. on Linux Debian or Ubuntu:
- Download and install FontForge: http://fontforge.github.io/en-US/downloads/windows-dl/
For example:
cd "C:\Program Files (x86)\FontForgeBuilds"
fontforge-console.bat
ffpython -m pip install configparser
ffpython C:\Path\to\nerd-fonts\font-patcher
Output should yield similar to:
...
font-patcher: error: too few arguments
- Download and install Python (latest 2.x or 3.x should be fine): https://www.python.org/downloads/windows/
- Download and install FontForge: http://fontforge.github.io/en-US/downloads/windows-dl/
- Download and install Cygwin: https://cygwin.com/install.html or setup WSL ?
TODO
- What you need to contribute to the Hack specific portion of Nerd Fonts
todo
- Download and install ttfautohint: https://www.freetype.org/ttfautohint/
- FreeType
- Harfbuzz
- ttfautohint
- fonttools
- Pros: A lot easier and faster
- Cons: Not as much fine grained control
pip install fonttools
curl https://raw.githubusercontent.com/source-foundry/Hack/HEAD/tools/scripts/install/ttfautohint-build.sh --output ~/ttfautohint-build.sh
chmod 770 ~/ttfautohint-build.sh
cd ~
sudo ./ttfautohint-build.sh
# Add the bin to your path
- Pros: More control and better understanding of what is getting installed and setup
- Cons: more tedious
pip install fonttools
wget http://downloads.sourceforge.net/project/freetype/freetype2/2.7/freetype-2.7.tar.gz
tar -zxf freetype-2.7.tar.gz
cd freetype-2.7
./configure
make
sudo make install
wget http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.3.4.tar.bz2
tar -xjf harfbuzz-1.3.4.tar.bz2
cd harfbuzz-1.3.4
./configure
make
sudo make install
- if you ran into an issue where a compiler is needed you will probably have to start over with the config but first run:
make distclean
sudo apt install g++
wget http://download.savannah.gnu.org/releases/freetype/ttfautohint-1.6.tar.gz
tar -zxf ttfautohint-1.6.tar.gz
cd ttfautohint-1.6
./configure --with-qt=no --with-doc=no
make
sudo make install
- if you get an error during
make
for ttfautohint:configure: error: *** A compiler with support for C++11 language features is required.
Then install compiler such as g++
(shown above) then re-run configure & make, etc
ttfautohint --version
ttfautohint 1.6
# cd into Nerd Fonts root directory
ttfautohint -l 4 -r 80 -G 350 -x 0 -H 181 -D latn -f latn -w G -W -t -X "" -I -m "bin/scripts/Hack/Hack-Regular-TA.txt" src/unpatched-fonts/Hack/Regular/Hack-Regular.ttf temp/Hack-Nerd-Font-autohinted.ttf
# cd into Nerd Fonts root directory
./font-patcher temp/Hack-Nerd-Font-autohinted.ttf
# spot check font, open in FontForge, etc.
ttfautohint: unrecognized option '-H'
cause: Too old of a version of ttfautohint, works but doesn't have -H option
checking for HARFBUZZ... no
configure: error: Package requirements (harfbuzz >= 0.9.19) were not met:
No package 'harfbuzz' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables HARFBUZZ_CFLAGS
and HARFBUZZ_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
cause: harfbuzz not installed or not installed correctly
tashaper.h:29:19: fatal error: hb-ft.h: No such file or directory
#include <hb-ft.h>
^
compilation terminated.
cause: harfbuzz not installed or not installed correctly
ttfautohint: undefined symbol: hb_ft_font_create
cause: harfbuzz not installed or not installed correctly