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