replace operations in an RTF file
Posted on 2000-03-30
I have an RTF file containing five different fonts, intermixed, so that a word is sometimes written with two or three fonts...
What I need is to replace all characters of a given font (one after another) with characters of a different font (having another encoding)... and to do that many times, processing all the alphabet, so that finally I have an RTF file containing only one font (but its encoding differs from that of the original fonts).
I have tried to use the standard methods, like
RichEdit1.SelLength := ...;
if RichEdit1.SelAttributes.Name = ... then begin
RichEdit1.SelText := ...
RichEdit1.SelAttributes.Name := ...
yet all this does not seem to work!
1. EXTREMELY slow,
2. takes up so much resources that the machines nearly hangs if the file is "large" (50 Kb!!!).
I would be very grateful for a working piece of code. It's an absolutely urgent job.
A lot of thanks in advance,