class Stroker(object):
def __init__(self, fontname):
self.fontname = fontname
+ self.dotwidth = max(0, 100 - self.nibwidth)
+ self.dotheight = max(0, 100 - self.nibheight)
def modify_font(self, f):
f.strokedfont = False
for g in f.glyphs():
+ for c in g.layers[1]:
+ self.adjust_contour(c)
g.stroke(*self.nib)
g.removeOverlap()
g.addExtrema()
f.os2_weight = self.ttfweight
f.weight = self.weight
return f
-
+ def adjust_contour(self, c):
+ # This function just expands dots.
+ if len(c) != 1: return
+ if self.dotwidth == 0 and self.dotheight == 0: return
+ # insert actual modifying code here.
+
class Plotter(Stroker):
familyname = "Bedstead Plotter"
def __init__(self, penwidth, weight, ttfweight):