chiark / gitweb /
Check OS/2.achVendID in compatcheck
authorBen Harris <bjh21@bjh21.me.uk>
Mon, 23 Dec 2024 23:39:20 +0000 (23:39 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 29 Dec 2024 18:50:52 +0000 (18:50 +0000)
My GNU Emacs configuration ended up using this to select its default
font, so it should remain constant within a major version.

compatcheck

index 5b28cce5e64eca91066457cf07a16a8f7f91f563..aa96dada140b09de8851792fd167081b96455815 100755 (executable)
 # Names.  Applications use a font's name to refer to it.  This script
 # checks that the subset of names for which this seems reasonable
 # match between the old and new fonts.
+#
+# Vendor ID.  At least some versions of GNU Emacs like to use the
+# OS/2.achVendID field to select fonts.  So if that changes, Emacs
+# might not find your favourite font.
 
 from argparse import ArgumentParser
 from fontTools import ttLib
@@ -84,5 +88,9 @@ for oldname in ttold['name'].names:
                  f"nameID={oldname.nameID}, platformID={oldname.platformID}, "
                  f"platEncID={oldname.platEncID}, langID={oldname.langID}")
 
+
+if ttold['OS/2'].achVendID != ttnew['OS/2'].achVendID:
+    fail("Vendor ID mismatch")
+
 if failed:
     exit(1)