googlefonts / nam-files

Unicode ranges used to subset fonts in the Google Fonts CSS API
Apache License 2.0
3 stars 0 forks source link

gfsubsets

This is the collection of nam files (codepoint subsets) that are used to subset fonts before serving on the Google Fonts CSS API.

The subset files

The subset definitions are contained in two forms; the "editable" definitions are found in the subsets-input directory, and the machine readable defitions can be found in Lib/gfsubsets/data.

The machine readable files consist of text files with one Unicode codepoint (a hexadecimal number beginning with 0x) on each line; everything after the codepoint is a comment. Blank lines and comment lines beginning # are ignored.

The editable definitions are similar, but for convenience allow the following "directives":

These editable definitions are turned into their machine-readable equivalents using the script scripts/preprocess_namfile.py.

Python interface

This repository also includes the Python module gfsubsets which provides an interface to these subset definitions. It exports the following functions: