[futurebasic] RE: [FB] styled Edit field to disk and printer

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 1999 : Group Archive : Group : All Groups

From: Chris.Young@...
Date: Mon, 15 Nov 1999 08:59:49 -0600

On Sunday, November 14, 1999 11:13 AM, rbrown@... 
[SMTP:rbrown@...] wrote:
> "Rich Text Format" (RTF) is an attempt to get around this problem; 
it's supposed
> to be a way to store text and formatting information in a way that is
> sufficiently standardized that a number of different WP programs will 
be able to
> interpret it.  Having said that:
> * To create RTF output, you would have to write a pretty 
sophisticated program.
> Maybe this Text ED. Fltr thing does a lot of that work for you.
> * I don't think SimpleText can read nor write RTF.
> * The last RTF spec I read from MicroSoft was pretty poorly written 
> ambigous.  This may explain why I have never seen two WP programs 
that interpret
> RTF in quite the same way.

I had to do an RTF output capability for a couple of my FBII programs. 
As Rick has stated, it isn't easy. RTF files begin with a header block 
that contains all the style information (style sheet, the individual 
styles used, etc.). The body text has to be preceeded by the style tag 
info (every paragraph, etc.). It is capable of doing tables, etc., but 
might wind up being Microsoft-centric for more advanced formatting 
capabilities (not a good thing).

Since the output I was using was strictly structured, I saved a 
formatted Word doc with the styles I wanted as an RTF file, then using 
BBEdit, opened the raw output and copied the RTF header info. I put 
this in the resource file as a TEXT resource. The program could then 
begin a file output with this header. I then broke the output up into 
individual lines (that was the level of style name granularity I 
needed... YMMV), and began each line with the appropriate RTF style 
tag. Works great, but is very specific for a particular need. I don't 
think I would want to attempt to build the RTF header info on the fly, 
though I am sure it can be done.

Chris Young