From 2c652cfc9a3bfcec99d255ca1a6b860a29487179 Mon Sep 17 00:00:00 2001 From: Rasmus Andersson Date: Sun, 11 Jun 2023 16:18:40 -0700 Subject: [PATCH] fixes OS/2 table usWeightClass entry in static fonts by rounding to nearest 100th. Closes #583 --- misc/tools/postprocess_instance_ufo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/tools/postprocess_instance_ufo.py b/misc/tools/postprocess_instance_ufo.py index 7540b8d6d..1f54c2c05 100644 --- a/misc/tools/postprocess_instance_ufo.py +++ b/misc/tools/postprocess_instance_ufo.py @@ -40,6 +40,9 @@ def main(argv): # "postscriptFontName" maps to name ID 6 "postscriptName" ufo.info.postscriptFontName = rmspace(familyName) + '-' + rmspace(styleName) + # round OS/2 weight class values to even 100ths + ufo.info.openTypeOS2WeightClass = round(ufo.info.openTypeOS2WeightClass / 100) * 100 + ufo.save(ufo_file)