trichview.com

trichview.support




Re: Change font of RichView document


Return to index


Author

Message

Sergey Tkachenko

Posted: 04/08/2003 10:37:14


Hi,


TRichView does not support operations for changing formatting of selection

(they are all in TRichViewEdit).

But your problem is very simple:


for i := 0 to RVStyle.TextStyles.Count-1 do

  RVStyle.TextStyles[i].FontName := NEWFONTNAME;

RichView.Format;


where RVStyle is a TRVStyle component linked to this RichView.

Warning: this code will affect all richviews linked to this RVStyle. So, if

you want to change font only in one RichView, link it to unique TRVStyle

component.




> Hi,

>

> My app creates a new document by rearranging text from other documents.

> In order to create a consistent output, I would like to change the font

> name of the created document because the imported text snippets may

> contain various font names. But font style like bold or italic should be

> preserved.

>

> I am looking for a method like

>

> RichView.SelectAll;

> RichView.ApplyFont()

>

> or something like that.

>

> How can I accomplish that?

>

> Thanks,

> Martin

>





Powered by ABC Amber Outlook Express Converter