[haiku-bugs] [Haiku] #16498: RTFTranslator doesn't handle Styled Text

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 25 Aug 2020 00:10:47 -0000

#16498: RTFTranslator doesn't handle Styled Text
-----------------------+--------------------------
 Reporter:  Pete       |       Owner:  nobody
     Type:  bug        |      Status:  new
 Priority:  normal     |   Milestone:  Unscheduled
Component:  - General  |     Version:  R1/beta2
 Keywords:             |  Blocked By:
 Blocking:             |    Platform:  All
-----------------------+--------------------------
 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(?).
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/16498>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: