Crates.io | google-fonts-subsets |
lib.rs | google-fonts-subsets |
version | |
source | src |
created_at | 2024-11-22 05:51:10.276354 |
updated_at | 2024-11-22 05:51:10.276354 |
description | Google Fonts subset definitions |
homepage | |
repository | https://github.com/googlefonts/nam-files |
max_upload_size | |
id | 1457098 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
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 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":
..
denote an (inclusive) range; all codepoints
within the range are included.-
before a codepoint or range excludes it from the output set.@include(filename)
includes the codepoints in filename
.@block(XYZ)
includes the codepoints in the Unicode block
named XYZ
.@script(XYZ)
includes all codepoints with either the
Unicode Script
property equal to XYZ
or the ScriptExtensions
property
equal to XYZThese editable definitions are turned into their machine-readable equivalents
using the script scripts/preprocess_namfile.py
.
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.