RTFText, HTMLText, and Formatted Content in RR
Dan Shafer
dan at shafermedia.com
Thu Jul 17 16:32:01 EDT 2003
I have whiled away many hours in the past three days trying to find the
most efficient and effective way to go from a Microsoft Word .doc file
to a reasonably clean, standards-compliant (or at least not
standards-defiant) HTML format. I have discovered several ways to do
this, none of which approaches satisfactory.
But that point is only semi-relevant to my point. I provide it only as
background.
One of the approaches I tried was to save the Word file in RTF. While
not an industry standard, RTF is at least well-documented and supported
quite well by every major (and most minor) word processor on the
market. Since RR has an RTFText property for fields, I decided to give
it a go.
RTFText supports a tiny subset of the RTF file format. The docs list
the formatting controls in RTF that are supported by RR. Out of
something like 1300 control words in the RTF spec, RR supports
approximately 30. The support is so thin that even a fairly simple book
chapter -- which includes things like bulleted lists, code samples, and
four-level headings, renders quite poorly and unusably.
That's OK. The docs are quite clear, so you know what you're getting.
I'm hoping someday the RR team or some third party will get around to a
serious RTF control because, candidly, using nicely formatted text in
RR fields is virtually impossible at the moment, which makes it a poor
medium for me to use for my project.
The RTFText docs say, "To export and re-import field information
without losing any style information, use the htmlText property
instead."
So I tried that. I opened an RTF file and set the htmlText of a field
to the contents of that file. Imagine my surprise when I not only
didn't see a formatted version of my chapter text, but instead I saw
only RTF commands. And at that, only a small number of them from the
first few dozen lines of the RTF file.
On reflection, I should not have been surprised. After all, setting the
htmlText of a field should probably only work if I open a file
containing HTML and read it, right? That does work, at least marginally
well and within the constraints of htmlText property as spelled out in
the docs.
My reluctant conclusion is that applications that rely heavily on
richly formatted text are not a candidate for RR development. That's a
HUGE disappointment but the good news is those aren't the only kinds of
apps I'm interested in building.
Back to the drawing board.
More information about the use-livecode
mailing list