chiark / gitweb /
When stroking a font, adjust the BlueValues accordingly.
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 26 Nov 2017 22:53:00 +0000 (22:53 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Sun, 26 Nov 2017 22:53:00 +0000 (22:53 +0000)
strokefont.py

index 4b257d6f57cf7055eec9136914d7c1d048c075aa..49494e883e0ebf7f72e279941a2a2be32c8eac11 100644 (file)
@@ -22,6 +22,10 @@ class Stroker(object):
         f.fullname = self.fullname
         f.private['StdHW'] = self.nibheight
         f.private['StdVW'] = self.nibwidth
+        def adjustblue(y): return y - 100 + self.nibheight
+        bv = list(f.private['BlueValues'])
+        bv[1:] = map(adjustblue, bv[1:])
+        f.private['BlueValues'] = tuple(bv)
         f.uwidth = self.nibheight
         f.os2_weight = self.ttfweight
         f.weight = self.weight