From: Ben Harris Date: Sat, 12 Aug 2017 08:41:01 +0000 (+0100) Subject: strokefont: Set StdHW and StdVW appropriately to pen. X-Git-Tag: bedstead-002.000~67 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=f7290084a38ba3a0cc83f444cfd6c7f195e03b53;p=bedstead.git strokefont: Set StdHW and StdVW appropriately to pen. --- diff --git a/strokefont.py b/strokefont.py index e659510..d0a39d4 100644 --- a/strokefont.py +++ b/strokefont.py @@ -15,15 +15,17 @@ class Stroker(object): g.stroke(*self.nib) g.removeOverlap() g.addExtrema() - g.transform(translate(0, self.vshift)) + g.transform(translate(0, self.nibheight/2.0)) f.fontname = self.fontname + f.private['StdHW'] = self.nibheight + f.private['StdVW'] = self.nibwidth return f class Plotter(Stroker): def __init__(self, penwidth, weight): self.nib = ['circular', penwidth, 'round', 'round'] - self.vshift = penwidth / 2.0 + self.nibwidth = self.nibheight = penwidth super(Plotter, self).__init__("BedsteadPlotter-" + weight) class Chiseltip(Stroker): @@ -35,7 +37,8 @@ class Chiseltip(Stroker): chisel.lineTo(-28, -45) chisel.closed = True self.nib = ['polygonal', chisel] - self.vshift = 45 + self.nibwidth = 100 + self.nibheight = 90 super(Chiseltip, self).__init__(fontname) modes = {