Some aspects of text styles lost during transition to RVF

General TRichView support forum. Please post your questions here
Post Reply
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Some aspects of text styles lost during transition to RVF

Post by martindholmes »

I'm streaming out the contents of one TRichViewEdit into another one, and then saving the results as RTF. This seems to work OK, except for one problem: some aspects of some text styles disappear. For instance, I have some text styles that simply set a background colour for the text (light red, light grey, or light green). Those background colours never show up in the RTF document. Similarly, I have text styles which are superscript, underlined, italicised, and have a small font size: all of those properties show up except the font size change.

Can anyone suggest why some aspects of text styles would be lost during this transition? I'm not sure whether it's happening during the transition from one RVE to another through streaming RVF, or whether it's during the save operation to RTF. The second RVE control is created on the fly, offscreen, so I can't look at its contents.

All help appreciated,
Martin
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Make sure that [rvfoSaveTextStyles, rvfoSaveParaStyles] is included in RVFOptions of TRichView that saves RVF.
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

Yes, those options are included, so that's not the problem. Can you think of anything else that might cause this?

Cheers,
Martin
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

I've just updated to the latest release of TRichView, and now the superscript sizes are correct, but the background colours are still not appearing.

Cheers,
Martin
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Try to save the resulting file as RVF instead of RTF (make sure that these RVFOptions are included in the second TRichView too).
If this RVF file will have the same problems as RTF, the problem was in the first step.
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

No, the RVF output looks fine. There seems to be a problem saving the background colour in text styles to RTF. This is not limited to my application, because when I open the RVF file in the Action Test Demo, then save it out as RTF, the background colours are missing.

MyApp -> save to RTF: background colours missing

MyApp -> save to RVF, open in Action Test Demo: OK

Action Test Demo -> save to RTF: background colours missing

Could you try this for yourself? Create a couple of text styles with light red and light green background colours, then try saving to RTF.

Cheers,
Martin
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I cannot reproduce this problem. Please send me an example of RVF file
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post by martindholmes »

My mistake! I was looking at the RTF file in WordPad! It looks as though WordPad doesn't support background colours in RTF. When I look at the file in a word-processor, the background colours show up.

Sorry about that -- I didn't think background colours were a particularly advanced feature!

Cheers,
Martin
Sergey Tkachenko
Site Admin
Posts: 17565
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Wordpad does not understand text background, it understands text highlighting. Word understands the both of them. TRichView imports highlighting as text background, but saves only text background.

Highlighting is not a character attribute (unlike text size or color) but some special thing. And no more than 15 highlighting colors are possible in single document. Text background color does not have this limitation.
Post Reply