mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-07-09 13:33:06 -04:00
Add a script to check backward compatibility
This commit is contained in:
parent
f16df5983c
commit
ba81f7454c
3
HACKING
3
HACKING
@ -77,6 +77,9 @@ Bedstead's history to their correct forms.
|
||||
|
||||
NOTES - Disorganised jottings about Bedstead and related matters.
|
||||
|
||||
compatcheck - A script to compare two versions of Bedstead OTF files
|
||||
and report backward incompatibilities.
|
||||
|
||||
editor - An interactive editor for Bedstead character shapes.
|
||||
Written by Simon Tatham and released under CC0.
|
||||
|
||||
|
||||
28
compatcheck
Executable file
28
compatcheck
Executable file
@ -0,0 +1,28 @@
|
||||
#! /usr/bin/python3
|
||||
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from fontTools import ttLib
|
||||
from sys import exit
|
||||
|
||||
parser = ArgumentParser()
|
||||
parser.add_argument("old")
|
||||
parser.add_argument("new")
|
||||
|
||||
cfg = parser.parse_args()
|
||||
|
||||
ttold = ttLib.TTFont(cfg.old)
|
||||
ttnew = ttLib.TTFont(cfg.new)
|
||||
|
||||
failed = False
|
||||
|
||||
def fail(msg):
|
||||
print(f"FAIL: {msg}")
|
||||
|
||||
if not (set(ttold.getGlyphOrder()) <= set(ttnew.getGlyphOrder())):
|
||||
fail("Glyphs vanished: "
|
||||
f"{set(ttold.getGlyphOrder()) - set(ttnew.getGlyphOrder())!r}")
|
||||
|
||||
if failed:
|
||||
exit(1)
|
||||
Loading…
x
Reference in New Issue
Block a user