1from fontTools.misc.py23 import strjoin, tobytes, tostr 2from . import asciiTable 3 4class table_T_S_I_V_(asciiTable.asciiTable): 5 6 def toXML(self, writer, ttFont): 7 data = tostr(self.data) 8 # removing null bytes. XXX needed?? 9 data = data.split('\0') 10 data = strjoin(data) 11 writer.begintag("source") 12 writer.newline() 13 writer.write_noindent(data.replace("\r", "\n")) 14 writer.newline() 15 writer.endtag("source") 16 writer.newline() 17 18 def fromXML(self, name, attrs, content, ttFont): 19 lines = strjoin(content).split("\n") 20 self.data = tobytes("\r".join(lines[1:-1])) 21