LoadRTF without font but with bold, underline, italic format

General TRichView support forum. Please post your questions here
Post Reply
BernhardRoos
Posts: 104
Joined: Mon Nov 26, 2007 1:49 pm

LoadRTF without font but with bold, underline, italic format

Post by BernhardRoos »

Hello,

I want at runtime Import RTF Streams, but without the font and size. It should use the font and size of the item Position. But other formatting of the rtf should be used, for example bold, underline, italic.

Is there a way to do this :

I have the following code :

RVData.DeleteItems(i, 1);
Stream := TStringStream.Create(sText);
Stream.Position := 0;
RVData.LoadRTFFromStream(Stream);
Stream.Free;

RVData is TCustomRVFormattedData

With my code it works, but is using the font and size of the RTF.

Best wishes
Bernhard
Sergey Tkachenko
Site Admin
Posts: 17499
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Unfortunately, it is not possible: you can either ignore all text/paragraph attributes from RTF, or apply all of them.

A solution is loading RTF in a hidden TRichView, changing its font and size to the required font and size, save the modified document to RVF or RTF stream, and insert this stream to the main editor.
Post Reply