From: Ben Harris Date: Tue, 19 Nov 2024 22:31:57 +0000 (+0000) Subject: Support cntrmask and hintmask operators in editor X-Git-Tag: bedstead-3.246~15 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=60df8ac6a678de8870e9d345a864b77b835f0c62;p=bedstead.git Support cntrmask and hintmask operators in editor --- diff --git a/editor b/editor index df2ca61..86c43ea 100755 --- a/editor +++ b/editor @@ -100,6 +100,7 @@ class EditorGui: self.path = None self.stack = [] self.cursor = [0, 0] + self.skip = False def rmoveto(self): self.path = [] self.paths.append(self.path) @@ -112,11 +113,14 @@ class EditorGui: self.path.append(self.cursor[:]) def op(self, word): try: - self.stack.append(float(word)) + if not self.skip: + self.stack.append(float(word)) + self.skip = False except: if word == "rmoveto": self.rmoveto() elif word == "rlineto": self.rlineto() elif word in ("hstem", "vstem"): self.stack = [] + elif word in ("cntrmask", "hintmask"): self.skip = True elif word == "endchar": pass else: print("unknown charstring component " + repr(word))