Google Fonts

google/fonts repository explained

πŸ¦‰ google/fonts is the GitHub repository that is used as a staging area to upload font families to Google Fonts.

Once your project is ready, and you are sure it meets all the font and production requirements; as well as you have located your files in a GitHub repository that follows the required structure, then the definitive step to contributing your font to Google Fonts is to submit it as a Pull Request to google/fonts repository.

This section will help users understand which are the directories, files, and python modules included in the Google/Fonts repository and how they are related.
Background reading:
must→ Upstream repository structure

Table of contents

google/fonts repository explained

Repository structure

.
β”œβ”€β”€ AUTHORS
β”œβ”€β”€ CODE_OF_CONDUCT.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ CONTRIBUTORS
β”œβ”€β”€ README.md
β”œβ”€β”€ TRIVIA.md
β”œβ”€β”€ apache
β”œβ”€β”€ axisregistry
β”œβ”€β”€ catalog
β”œβ”€β”€ knowledge
β”œβ”€β”€ lang
β”œβ”€β”€ ofl
β”œβ”€β”€ ufl
β”œβ”€β”€ to_production.txt
└── to_sandbox.txt

Family directories

TheΒ ofl,Β uflΒ andΒ apacheΒ directories contain font families. There is a directory per family published by GF and each directory has the following structure:

.
β”œβ”€β”€ article/ARTICLE.en_us.html
β”œβ”€β”€ METADATA.pb
β”œβ”€β”€ License (OFL.txt, UFL.txt, License.txt)
β”œβ”€β”€ FontFamily-Regular.ttf
└── upstream.yaml

Each file has the following purpose:

If the family is a variable font family, another directory called static can be included to contain the static (non-variable) fonts for the family:

.
β”œβ”€β”€ DESCRIPTION.en_us.html
β”œβ”€β”€ METADATA.pb
β”œβ”€β”€ License (OFL.txt, UFL.txt, License.txt)
β”œβ”€β”€ FontFamily[axis].ttf
β”œβ”€β”€ static
β”‚   β”œβ”€β”€ FontFamily-Regular.ttf
β”‚       └── FontFamily-Bold.ttf
└── upstream.yaml

This static directory is mandatoryΒ if the static fonts are manually hinted; otherwise, it should not be added at all.

Designers catalog

.
β”œβ”€β”€ info.pb
β”œβ”€β”€ bio.html
└── image.png

Each credited entity on Google Fonts should have a registered profile in google/fonts/catalog/designers. This profile appears in the about section of the specimen page.

You can request the addition or modification of your name, bio, and image using this form.

Find more information about the requirements for these files in the designer profile chapter.

Axis registry

.
β”œβ”€β”€ axisregistry

Google Fonts supports all theΒ Microsoft registered axes for variable fonts, but it has its own Axis Registry, which defines the names, ranges, and defaults of additional axes supported by the API. This registry is used to generate the static instances of each variable family (which you can find in the downloadable zip file); the API will generate only those locations registered in the registry.

This directory is a git subtree that is automatically updated with changes in the googlefonts/axisregistry repository. The contents of this directory should not be changed in commits that are pushed to the google/fonts repository. Rather, make edits in a pull request on the googlefonts/axisregistry repository. google/fonts repository maintainers can then pull the git subtree changes in to the axisregistry directory by executing the following command from the root of google/fonts:

git subtree pull --prefix=axisregistry https://github.com/googlefonts/axisregistry.git main

Once the main branch from the submodule is pulled, you will need to push in a new branch upstream.

Important: When merging a pull request in the google/fonts repo which contains a subtree pull, merge it using the β€œCreate a merge commit” button and not the β€œSquash and merge” button. If we squash and merge, the subtree’s history is squashed into a single commit which will cause merge conflicts for the next person who has to do a subtree pull.

Lang directory

.
β”œβ”€β”€ lang

This Python module provides the API with data about languages/regions/scripts for use in the language-support categorization of the font families in the Google Fonts collection.

This directory is a git subtree that is automatically updated with changes in the googlefonts/lang repository. The contents of this directory should not be changed in commits that are pushed to the google/fonts repository. Rather, make edits in a pull request on the googlefonts/lang repository.

Once you have a set of changes that you want to be merged into google/fonts, the procedure is:

% cd gflanguages
% git tag -a v0.X.Y
(fill in the release notes in your editor)
% git push --tags
% cd ../fonts
% git checkout -b lang-v0.X.Y
% git subtree pull --prefix=lang https://github.com/googlefonts/lang.git main

Important: When merging the pull request in the google/fonts repo which contains a subtree pull, merge it using the β€œCreate a merge commit” button and not the β€œSquash and merge” button. If we squash and merge, the subtree’s history is squashed into a single commit which will cause merge conflicts for the next person who has to do a subtree pull.

Push lists

Further reading:
team  Description file
team  Designer profile
team  METADATA file