Newbie Font Color Questions

General TRichView support forum. Please post your questions here
Post Reply
GRGirl
Posts: 2
Joined: Sun Oct 26, 2008 1:33 pm

Newbie Font Color Questions

Post by GRGirl »

When I read in an existing RTF file font colors are changed. For instance a heading in black may become blue, or some italic text in black may become red. Since every file may be different I don't want to hard code in colors. How do I fix it so existing file text is not changed?

Also, I set up my own TextStyle. If I add some initial header text to a document with my own TextSyle font, the rest of the document headers also use this font. How do I fix this?

Sincere apologies for bothering you with newbie questions. I am obviously missing where this info is in the help file.

Thank you.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

There are several modes for reading formatting from RTF files.
As I understand, in your application "Use Closest" mode is used: no new styles are added when reading RTF, only existing styles are used.
For the best results, "Add if needed" mode must be used instead.
These modes are defined in rv.RTFReadProperties.TextStyleMode and rv.RTFReadProperties.ParaStyleMode properties. Set them both to rvrsAddIfNeeded.

For components placed on form at design time it must be by default. Right click TRichView/TRichViewEdit in Delphi, choose "Settings" in the popup menu, make sure that "Allow adding styles dynamically" is selected.
GRGirl
Posts: 2
Joined: Sun Oct 26, 2008 1:33 pm

Post by GRGirl »

That fixed my problem. Many thanks! And thank you for the very prompt help.
Post Reply