Kerning Validator
Compares kerning defined in .glyphs source with kerning defined in binary font.
It reads all kerning pairs of all masters of a Variable Font from the .glyphs source
and shapes the pairs using the binary font with vharfbuzz, once with and once without
kerning enabled, then compares the two values.
To catch absolutely all kerning, it gathers all unicodes associated with a kerning class and cross-checks all possible combinations. This is necessary because members of a kerning class may be part of different writing scripts and may or may not be included in the font based on their script.
The shaped kerning is lazily read from the vharfbuzz buffer through the x value of buf.glyph_positions
by simply comparing the highest x value of each composition.
Invocation
From the command line:
kerningvalidator font.glyphs font.ttf
From within Python:
from kerningvalidator import missing_kerning
# Get missing kerning
missing_kerning = missing_kerning("font.glyphs", "font.ttf")
# Success means en ampty list
assert len(missing_kerning) == 0
Limitations
- This tool was written with Variable Fonts in mind that contain both
LTRandRTLkerning pairs - This tool currently only consumes
.glyphssources, no UFOs - The kerning comparisons are currently limited to encoded glyphs only
- The
vharfbuzzshaping has shown a difference of up to 1 font unit compared to the kerning defined in the.glyphssource. The tool therefore allows for 1 unit difference - There are currently no unit tests for this tool
- It takes forever for a large font
Package
To create a new package, install twine via pip install twine, then cd to Lib/ and then:
python3 setup.py sdisttwine upload dist/*
Metadata
Release files for kerningvalidator 0.1.1.post3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kerningvalidator-0.1.1.post3.tar.gz | 8.7 kB | Without provenance | Details for kerningvalidator-0.1.1.post3.tar.gz |
Release files / kerningvalidator-0.1.1.post3.tar.gz
| Download URL | kerningvalidator-0.1.1.post3.tar.gz |
|---|---|
| Size | 8.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f170fcf458237f000ef003978396b192ae9bcb2e03004bed0f2a5ce769d9b99c
|
|
BLAKE2b-256 checksum How to use checksums |
e91e3ea47a6a232df710075fc33842fcaae427d8dca0d935e5076945c6a0bf6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.28.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.1
|
Security for kerningvalidator 0.1.1.post3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.