This is a work-in-progress repo to document some useful techniques, scripts, and workflows in quality assurance (QA) and variable-font upgrades for Google Fonts projects. It seeks to document and save lessons learned from projects including Inter, Fira Code, Merriweather, Encode Code, and Maven Pro, and more.
Scripts are written with the assumption of running on macOS.
- Move the
sources/build.sh
script into your project'ssource
folder - Update first line of OFL to fit your font project (you may already have this)
- Use build process (below) to setup dependencies & build fonts
- Duplicate the
googlefonts-qa
folder into your project. Update these scripts and run as needed.
The sources can be built with FontMake, but I've put together some specific build scripts to pass the fonts through some steps that fix metadata issues.
The build process requires you to open up a terminal and navigate to the current project's directory. Open a terminal, then navigate to the a directory (folder) for type projects, and git clone this repo.
cd path/to/your_type_repos_directory/current_project
# git clone the project if you don't already have it
You should use a Python virtual environment to build this project. If you've never set up a virtual environment before, read more about it in this guide.
You can set up a Python 3 virtual environment with:
python3 -m venv ./venv
Here, python3 -m venv
calls the virtual-environment-making module, then the ./venv
gives it a path to setup a virtual environment in (you could give a different path, but this is a conventional name).
Before you install dependencies or run the build, you need to activate the virtual environment with:
source venv/bin/activate
If you wish exit out of the virtual environment, you can use the command deactivate
(just remember to start it up again if you come back). You can also simply close the terminal session.
Once you've activated the venv, install requirements by pointing pip to the requirements.txt
file:
pip install -r requirements.txt
Note: right now, gftools may give you some installation issues. This most likely will require you to install some other specific requirements on your computer and/or in the virtual environment. I would provide more detail, but I don't fully understand it right now.
The first time you run the build, you will need to give run permissions to the build scripts.
On the command line, from the project folder, and then give permissions to the build script with:
chmod +x sources/build.sh
To use the other scripts, you must also give them permissions to run.
Using chmod +x
gives shell scripts execute permissions. In general, before you do this for shell scripts, you should probably take a look through their contents, to be sure they aren't doing anything you don't want them to do. The ones in this repo simply build from the GlyphsApp sources and apply various fixes to the results.
Update the variables in each of the scripts you wish to run.
Then, run the build script (or any of the others) by entering its relative path in your terminal:
sources/build.sh
Run googlefonts-qa/check.py
to product FontBakery checks.
- Download existing fonts from Google Fonts (or git clone the entire google/fonts repo)
- Follow the Installation and Usage instructions in googlefonts/diffenator.