From 60df8ac6a678de8870e9d345a864b77b835f0c62 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 19 Nov 2024 22:31:57 +0000 Subject: [PATCH] Support cntrmask and hintmask operators in editor --- editor | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) -- 2.30.2