T_S_I_V_.py 655 B

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