From: Ben Harris Date: Sat, 14 Dec 2024 16:41:51 +0000 (+0000) Subject: compatcheck: detect vanished code points from fonts X-Git-Tag: bedstead-3.251~72 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=5b758ec94c773183ce87289f7c4db46081b3e1e7;p=bedstead.git compatcheck: detect vanished code points from fonts --- diff --git a/compatcheck b/compatcheck index e96e766..a11478f 100755 --- a/compatcheck +++ b/compatcheck @@ -24,5 +24,15 @@ if not (set(ttold.getGlyphOrder()) <= set(ttnew.getGlyphOrder())): fail("Glyphs vanished: " f"{set(ttold.getGlyphOrder()) - set(ttnew.getGlyphOrder())!r}") +for cmapold in ttold['cmap'].tables: + cmapnew = ttnew['cmap'].getcmap(cmapold.platformID, cmapold.platEncID) + if cmapnew == None: + fail("No cmap in new font for " + f"{(cmapold.platformID,cmapold.platEncID)}") + elif not (set(cmapold.cmap.keys()) <= set(cmapnew.cmap.keys())): + fail("Code points vanished from " + f"{(cmapold.platformID,cmapold.platEncID)}: " + f"{set(cmapold.cmap.keys()) - set(cmapnew.cmap.keys())!r}") + if failed: exit(1)