Codepoint definitions for the Google Fonts subsetter
Project description
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":
- Two codepoints separated by
..denote an (inclusive) range; all codepoints within the range are included. - The symbol
-before a codepoint or range excludes it from the output set. - The directive
@include(filename)includes the codepoints infilename. - The directive
@block(XYZ)includes the codepoints in the Unicode block namedXYZ. - The directive
@script(XYZ)includes all codepoints with either the UnicodeScriptproperty equal toXYZor theScriptExtensionsproperty equal to XYZ
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:
CodepointsInFont(filename): Lists the Unicode codepoints supported by the fontListSubsets(): Returns the name of all defined subsets.SubsetsForCodepoint(cp): Returns the names of all subsets including the codepoint.SubsetForCodepoint(cp): Returns the name of the "most relevant" subset including the codepoint.CodepointsInSubset(subset): Returns a set of codepoints included in the subset.SubsetsInFont(filename, min_pct, ext_min_pct): Returns the name of subsets "well" supported by a font.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gfsubsets-2025.11.4.tar.gz.
File metadata
- Download URL: gfsubsets-2025.11.4.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93a5256bda8aff54b2d9986e9ea15cc9aff48670d912fe27a6da2079fbed8a49
|
|
| MD5 |
e3084d328e9ad81a7e0d5e0506dd3643
|
|
| BLAKE2b-256 |
4143f6801e170662b5d97dfde0f9cd1c6e1896da3be04c16af1fc8b8292222fe
|
Provenance
The following attestation bundles were made for gfsubsets-2025.11.4.tar.gz:
Publisher:
publish-release.yml on googlefonts/nam-files
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gfsubsets-2025.11.4.tar.gz -
Subject digest:
93a5256bda8aff54b2d9986e9ea15cc9aff48670d912fe27a6da2079fbed8a49 - Sigstore transparency entry: 668069873
- Sigstore integration time:
-
Permalink:
googlefonts/nam-files@cd9c5afa08c8b7998dbe013d9246dc3ff743af2e -
Branch / Tag:
refs/tags/v2025.11.04 - Owner: https://github.com/googlefonts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yml@cd9c5afa08c8b7998dbe013d9246dc3ff743af2e -
Trigger Event:
push
-
Statement type:
File details
Details for the file gfsubsets-2025.11.4-py3-none-any.whl.
File metadata
- Download URL: gfsubsets-2025.11.4-py3-none-any.whl
- Upload date:
- Size: 438.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba6ae1a53d245824e2645a1200bb35362016576e0313328adfea25071139c965
|
|
| MD5 |
e0c743014c3f9c6eb88c8b2a536fafd1
|
|
| BLAKE2b-256 |
7dae75785728d59a96c004688b63d78d977f4d7a4a7b474cb640194e9268fe31
|
Provenance
The following attestation bundles were made for gfsubsets-2025.11.4-py3-none-any.whl:
Publisher:
publish-release.yml on googlefonts/nam-files
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gfsubsets-2025.11.4-py3-none-any.whl -
Subject digest:
ba6ae1a53d245824e2645a1200bb35362016576e0313328adfea25071139c965 - Sigstore transparency entry: 668069883
- Sigstore integration time:
-
Permalink:
googlefonts/nam-files@cd9c5afa08c8b7998dbe013d9246dc3ff743af2e -
Branch / Tag:
refs/tags/v2025.11.04 - Owner: https://github.com/googlefonts
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-release.yml@cd9c5afa08c8b7998dbe013d9246dc3ff743af2e -
Trigger Event:
push
-
Statement type: