Scan your whole stack
Are you using hinting-diff?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.2.0
hinting-diff was last scanned on 24 Nov 2026 at version 0.2.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.2.0 LATEST | 24 Nov 2026 | No rules fired |
| 0.1.1 | 23 Nov 2026 | No rules fired |
Findings for v0.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.2.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Compare the TrueType hinting of two versions of a font, or a family of fonts, in a browser.
hinting-diff writes an HTML page that shows every glyph of a font, encoded or
not, rendered with its hinting at a size in pixels per em (ppem), for the old
and the new version of the font. Click old/new to switch between them
and see what changed. For a family, it writes a page for each font, and an index
page that links to them.

Source Sans Pro without hinting (old) and hinted with ttfautohint (new), in Firefox on Windows 11, enlarged 3×.
Browsers only apply TrueType hinting on Windows, so open the page on Windows. It works in old browsers too, as far back as Internet Explorer 11, Chrome 49 and Firefox 52, for checking hinting on old versions of Windows.
pip install hinting-diff
It needs Python 3.10 or later, and installs fontTools too.
hinting-diff old/Family-Regular.ttf new/Family-Regular.ttf -o hinting-diff/
This writes hinting-diff/Family-Regular-hinting.html, with copies of both
fonts next to it, and prints the page's path. Open it in a browser on Windows.
To compare a family, give the folders of the old and the new fonts, or the fonts
with -fb/--fonts-before and -fa/--fonts-after, as in
diffenator2:
hinting-diff old/ new/
hinting-diff -fb old/*.ttf -fa new/*.ttf
Fonts are matched by their file names, and folders' subfolders are searched too.
A font that's only in the old or only in the new fonts is skipped, with a
warning. This writes a page for each font, and an index.html page that links
to them, and prints their paths, with the index page last. A single old font and
a single new font, given on their own, are compared whatever their names.
If a font can't be read, the other fonts' pages are still written, and the command exits with an error.
The output folder is optional, and is hinting-diff by default. All the
options:
usage:
hinting-diff [-h] [-o OUT] [--version] BEFORE AFTER
hinting-diff [-h] [-o OUT] [--version] -fb FONT [FONT ...] -fa FONT [FONT ...]
hinting-diff [-h] [-o OUT] [--version] AFTER [AFTER ...] --commit [REF]
Write pages to compare the TrueType hinting of two versions of fonts. Give the
old and new font, or folders of them, or several fonts with -fb and -fa: fonts
are matched by their file names. Or give the new fonts, or folders of them, in
a git repository, with --commit to compare them with the fonts at the same
paths in a commit. Browsers only apply TrueType hinting on Windows, so open
the pages on Windows.
positional arguments:
BEFORE AFTER the old and the new font (TTF), or folders of fonts.
With --commit, the new fonts or folders
options:
-h, --help show this help message and exit
-fb FONT [FONT ...], --fonts-before FONT [FONT ...]
the old fonts (TTF), or folders of fonts
-fa FONT [FONT ...], --fonts-after FONT [FONT ...]
the new fonts (TTF), or folders of fonts
--commit [REF] compare the new fonts with the fonts at the same paths
in this commit, e.g. HEAD~1 or a tag (default: HEAD,
the last commit)
-o OUT, --out OUT, --output OUT
folder for the pages and copies of the fonts (default:
hinting-diff)
--version show program's version number and exit
The page has:
The size, font, text, filter and selected glyph are kept for the browser tab's session, so they stay the same when you open another font's page in the same tab.
Sizes are in device pixels, so they stay the same with browser zoom or display scaling (e.g. 150% in Windows), which change how many device pixels a CSS pixel is.
In a git repository, give only the new fonts, or folders of them, with
--commit to compare them with the fonts at the same paths in a commit:
hinting-diff fonts/ttf/ --commit
hinting-diff fonts/ttf/*.ttf --commit HEAD~1
hinting-diff fonts/ttf/Family-Regular.ttf --commit v1.2.0
By default, the fonts are compared with the last commit (HEAD), e.g. to check
fonts you've just built before committing them. Give another commit, e.g.
HEAD~1, a branch, a tag or a commit hash, to compare with that. Put --commit
after the fonts, or give its commit, as in --commit HEAD fonts/ttf/: otherwise
the fonts' path is taken as the commit.
A font that wasn't in the commit, or one in a folder that was in the commit but
isn't now, is skipped, with a warning. The old fonts are read from the local
repository, so git needs to be installed, and the commit needs to be there,
e.g. git fetch first for origin/main. Fonts in
Git LFS work too, if git lfs is installed.
A page that shows the hinting page in a frame can pick a variable font's
instance by adding its name to the URL, e.g.
Family-Regular-hinting.html#style=Bold. This hides the page's own
Instance menu.
Everything the command does is available from Python too, e.g. to make hinting pages as part of a bigger report.
write_hinting_page() writes the page for one font:
from pathlib import Path
from hinting_diff import write_hinting_page
page_path = write_hinting_page(
Path("old/Family-Regular.ttf"),
Path("new/Family-Regular.ttf"),
Path("hinting-diff"),
)
print(page_path) # hinting-diff/Family-Regular-hinting.html
Its arguments are:
before_path: the old font (TTF).after_path: the new font (TTF).output_path: the folder for the page and the copies of the fonts. It's made if
it doesn't exist yet.page_name (optional): the page's file name. By default, it's the new font's
name with -hinting.html, e.g. Family-Regular-hinting.html.It returns the page's path. The copies of the fonts are saved next to the page as
hinting-old-<new font's file name> and hinting-new-<new font's file name>, so
pages for several fonts can share a folder.
It doesn't check that the fonts exist first: a missing or broken font raises
fontTools' or Python's own error (e.g. FileNotFoundError), and a font with too
many glyphs to map to Private Use Area codepoints raises a ValueError.
match_fonts() matches old and new fonts by their file names, as the command
does, and write_index_page() writes a page that links to hinting pages:
from pathlib import Path
from hinting_diff import match_fonts, write_hinting_page, write_index_page
font_match = match_fonts([Path("old")], [Path("new")])
for after_path in font_match.only_after:
print(f"{after_path.name} is new")
page_paths = [
write_hinting_page(before_path, after_path, Path("hinting-diff"))
for before_path, after_path in font_match.pairs
]
index_path = write_index_page(page_paths, Path("hinting-diff"))
print(index_path) # hinting-diff/index.html
match_fonts(before_paths, after_paths) takes the old and the new fonts, each
as fonts or folders of fonts, and returns a FontMatch named tuple:
pairs: a list of (old font, new font) with the same file name, in file
name order.only_before: old fonts without a new font with the same file name.only_after: new fonts without an old font with the same file name.A single old font and a single new font, given on their own, are paired
whatever their names. It raises a FileNotFoundError for a path that doesn't
exist, and a ValueError for a folder without TrueType fonts or for two old or
two new fonts with the same file name.
find_fonts(paths) returns the fonts in a list of paths, as match_fonts()
finds them: fonts as they are, and every TrueType font (.ttf, in any case) in
folders and their subfolders, in file name order.
write_index_page(page_paths, output_path, page_name="index.html") writes the
index page in output_path and returns its path. Its links are relative, so the
pages can be in other folders too.
save_fonts_at_commit(paths, commit, output_path) saves the fonts in paths, as
they were at commit, in output_path, and returns their paths there, to give
to match_fonts() as the old fonts:
import tempfile
from pathlib import Path
from hinting_diff import match_fonts, save_fonts_at_commit
fonts_path = Path("fonts/ttf")
with tempfile.TemporaryDirectory() as temp_folder:
before_paths = save_fonts_at_commit([fonts_path], "HEAD~1", Path(temp_folder))
font_match = match_fonts(before_paths, [fonts_path])
... # Write the pages before the temporary folder is deleted
Each path is a font or a folder of fonts in a git repository. For a folder, every
TrueType font that was in it, or its subfolders, at the commit is saved. A font
that wasn't in the commit isn't saved. It raises a ValueError if a path isn't in
a git repository or the commit doesn't exist, and a FileNotFoundError for a path
that doesn't exist.
The functions the page is made with can be used on their own:
add_glyph_codepoints(font_path, output_path) saves a copy of a font with each
glyph mapped to a Private Use Area codepoint (see
How it works), and returns a dict of each glyph's name and
codepoint. .notdef isn't mapped.get_sample_text(font) returns every character a TTFont encodes, in
codepoint order, without combining marks or characters that show nothing.get_named_instances(font) returns a variable TTFont's named instances as a
list of (name, coordinates), e.g. ("Bold", {"wght": 700.0}). It returns an
empty list for a static font.GLYPH_CODEPOINT_START is the codepoint the first glyph is mapped to
(0xF0000). A glyph's codepoint is this plus its glyph ID.from pathlib import Path
from fontTools.ttLib import TTFont
from hinting_diff import add_glyph_codepoints, get_named_instances
codepoints = add_glyph_codepoints(
Path("new/Family-Regular.ttf"), Path("Family-Regular-pua.ttf")
)
print(f"U+{codepoints['a']:X}") # e.g. U+F0024
with TTFont("new/Family-Regular.ttf", lazy=True) as font:
for name, coordinates in get_named_instances(font):
print(name, coordinates)
hinting_diff.__version__ is the package's version.
Browsers can only show characters, not glyphs, so the fonts on the page are
copies with each glyph mapped to a Private Use Area codepoint, from U+F0000.
Only their cmap table changes: the other tables, including glyf, fpgm,
prep and cvt, are saved as they are, so the hinting is kept. Glyphs that a
variable font swaps with feature variations (rvrn) at the selected instance
show the swapped glyph, as they would in use.
Bug reports, ideas and pull requests are welcome: see the contributing guide for how to set up the project and make a change. Please report security problems privately, as the security policy explains.
The page's look and its old/new toggle follow the HTML pages of diffenator2 (Copyright Google LLC, Apache License 2.0), so a hinting page fits in with them in a report. Its styles are adapted from diffenator2's.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.