MCPcopy
hub / github.com/RUB-NDS/PRET / do_cross

Method do_cross

postscript.py:575–586  ·  view source on GitHub ↗
(self, arg)

Source from the content-addressed store, hash-verified

573
574 # ------------------------[ cross <text> <font> ]---------------------
575 def do_cross(self, arg):
576 arg = re.split("\s+", arg, 1)
577 if len(arg) > 1 and arg[0] in self.options_cross:
578 font, text = arg
579 text = text.strip('"')
580 data = file().read(self.fontdir + font + ".pfa") or ""
581 data += '\n/' + font + ' findfont 50 scalefont setfont\n'\
582 '80 185 translate 52.6 rotate 1.1 1 scale 275 -67 moveto\n'\
583 '(' + text + ') dup stringwidth pop 2 div neg 0 rmoveto show'
584 self.overlay(data)
585 else:
586 self.onecmd("help cross")
587
588 def help_cross(self):
589 print("Put printer graffiti on all hard copies: cross <font> <text>")

Callers

nothing calls this directly

Calls 4

overlayMethod · 0.95
fileClass · 0.90
readMethod · 0.80
onecmdMethod · 0.80

Tested by

no test coverage detected