chiark / gitweb /
Skip XML comments when reading charstrings in editor
authorBen Harris <bjh21@bjh21.me.uk>
Tue, 19 Nov 2024 22:27:47 +0000 (22:27 +0000)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 19 Nov 2024 23:40:00 +0000 (23:40 +0000)
editor

diff --git a/editor b/editor
index 88db3b8a1e40026f5fce786324fcccc9add8870c..df2ca61e5bd7484021f06608d799d7680e045c02 100755 (executable)
--- a/editor
+++ b/editor
@@ -121,6 +121,7 @@ class EditorGui:
                     else:
                         print("unknown charstring component " + repr(word))
         interp = CharstringInterpreter()
+        data = re.sub(r"<!--(?:[^-]|-[^-])*-->", "", data)
         for word in data.split():
             interp.op(word)
         paths = [[[int((float(x)-LEFT)*pixel*0.01 + 2*gutter + XSIZE*pixel),