Opened 4 years ago

Last modified 4 years ago

#16498 new bug

RTFTranslator doesn't handle Styled Text

Reported by: Pete Owned by: axeld
Priority: normal Milestone: Unscheduled
Component: Add-Ons/Translators/RTF Version: R1/beta2
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

I have a README that I wrote with StyledEdit (with quite a lot of bolding and italics, etc.) that I wanted to convert to a more cross-platform format, so I tried:

  translate README readme.rtf text/rtf

The result is considerably garbled, with the errors getting worse later in the file.

I don't think the README is appropriate to attach, as it is heavily formatted. Instead, I've taken some automatically collected text (from monitoring Caroline Flashback's playlist for a few months...(:-)), cut it down to a much shorter length, and added some highlighting. I'm attaching the original as STXT (so the styling is data in the file, rather than attributes), and the RTF generated by the translator. StyledEdit will read both, so they can be compared.

One reason I cut it down is that the 108kB original doesn't seem to get the repeated text that I was seeing in the README. It appears that the repetition will disappear if I make it much shorter, as well.

The things I've noticed (illustrated by additions to the test file) are:

A segment of text from the middle can get repeated after the end of the original. See line 272 in the RTF.

Styling gets displaced from the text it belongs too. Early bold characters ar OK, but if you look at line 245 in the RTF, the bolding is a line too early.

RTF-special characters are just deleted -- compare lines 3 and 7 in the original and RTF.

The beginning of a line can be lost -- e.g. line 8 in the RTF (8 & 9 in the original). This is the one fault I've found the reason for. The '\line' control word is not terminated with a space! May be true of others, too(?).

Attachments (2)

styled_test (10.1 KB ) - added by Pete 4 years ago.
Test STXT file gelerated by STXTTranslator from StyledEdit original
styled_test.rtf (13.8 KB ) - added by Pete 4 years ago.
Output of RTFTranslator on STXT original

Download all attachments as: .zip

Change History (3)

by Pete, 4 years ago

Attachment: styled_test added

Test STXT file gelerated by STXTTranslator from StyledEdit original

by Pete, 4 years ago

Attachment: styled_test.rtf added

Output of RTFTranslator on STXT original

comment:1 by diver, 4 years ago

Component: - GeneralAdd-Ons/Translators/RTF
Owner: changed from nobody to axeld
Note: See TracTickets for help on using tickets.