Modify pylrs to write strings using the text tag rather than raw text.

This commit is contained in:
Kovid Goyal 2007-09-17 03:28:08 +00:00
parent 51458628ab
commit 2ee9ec1f4e
2 changed files with 5 additions and 2 deletions

View file

@ -316,7 +316,7 @@ def writeRuledLine(f, lineInfo):
Box = (0xF5C6, LINE_TYPE_ENCODING, writeWord),
BoxEnd = (0xF5C7,),
Space = (0xF5CA, writeSignedWord),
textstring = (0xF5CC, writeUnicode), # when is this used?
textstring = (0xF5CC, writeUnicode),
Plot = (0xF5D1, "<HHII"),
CR = (0xF5D2,),
RegisterFont = (0xF5D8, writeDWord),

View file

@ -1654,7 +1654,10 @@ def __init__(self, text):
def toLrfContainer(self, lrfWriter, parent):
if self.text:
parent.appendLrfTag(LrfTag("rawtext", self.text))
if isinstance(self.text, str):
parent.appendLrfTag(LrfTag("rawtext", self.text))
else:
parent.appendLrfTag(LrfTag("textstring", self.text))
class CR(LrsSimpleChar1, LrsContainer):