From 8e82ff2e2527889e78794c03a60772d2912244f4 Mon Sep 17 00:00:00 2001 From: Fred Brennan Date: Tue, 16 Aug 2022 07:02:12 -0400 Subject: [PATCH] Write UFO .glif note as CDATA (#15) Allows round-tripping through FontForge. Closes #15. --- Lib/sfdLib/parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/sfdLib/parser.py b/Lib/sfdLib/parser.py index 090a2ef..a06e9c3 100644 --- a/Lib/sfdLib/parser.py +++ b/Lib/sfdLib/parser.py @@ -5,6 +5,7 @@ from datetime import datetime from fontTools.misc.fixedTools import otRound +from lxml.etree import CDATA import sfdutf7 SFDReadUTF7 = lambda s, force_valid_xml=True: sfdutf7.decode( @@ -738,7 +739,7 @@ def _parseChar(self, data): pass # XXX elif not self._minimal: if key == "Comment": - glyph.note = SFDReadUTF7(value) + glyph.note = CDATA(SFDReadUTF7(value)) elif key == "Colour": glyph.markColor = _parseColor(int(value, 16))