From f7290084a38ba3a0cc83f444cfd6c7f195e03b53 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sat, 12 Aug 2017 09:41:01 +0100 Subject: [PATCH] strokefont: Set StdHW and StdVW appropriately to pen. --- strokefont.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 = { -- 2.30.2