mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Modify pylrs to write strings using the text tag rather than raw text.
This commit is contained in:
parent
51458628ab
commit
2ee9ec1f4e
@ -316,7 +316,7 @@ TAG_INFO = dict(
|
|||||||
Box = (0xF5C6, LINE_TYPE_ENCODING, writeWord),
|
Box = (0xF5C6, LINE_TYPE_ENCODING, writeWord),
|
||||||
BoxEnd = (0xF5C7,),
|
BoxEnd = (0xF5C7,),
|
||||||
Space = (0xF5CA, writeSignedWord),
|
Space = (0xF5CA, writeSignedWord),
|
||||||
textstring = (0xF5CC, writeUnicode), # when is this used?
|
textstring = (0xF5CC, writeUnicode),
|
||||||
Plot = (0xF5D1, "<HHII"),
|
Plot = (0xF5D1, "<HHII"),
|
||||||
CR = (0xF5D2,),
|
CR = (0xF5D2,),
|
||||||
RegisterFont = (0xF5D8, writeDWord),
|
RegisterFont = (0xF5D8, writeDWord),
|
||||||
|
@ -1654,7 +1654,10 @@ class Text(LrsContainer):
|
|||||||
|
|
||||||
def toLrfContainer(self, lrfWriter, parent):
|
def toLrfContainer(self, lrfWriter, parent):
|
||||||
if self.text:
|
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):
|
class CR(LrsSimpleChar1, LrsContainer):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user