WPCubed Product Support

WPTools V5 default font

WP V4 had a default font property. Can you tell me where the equivalent is in V5? I want to use a WPRichText for displaying/editing some plain text but I want to specify what font is to be used.

The reason I want to use it for plain text is live spelling with Addict.

#1 ♥ 0
5k Views 3 users read 1 min

Try this:

WP.DefaultAttr.SetFontName(fontname);
WP.DefaultAttr.SetFontSize(fontsize);

#2 ♥ 0

I was hoping for designtime but that should be a good workround. Thanks.

#3 ♥ 0

I stumbled about default properties in the manual under notes for upgraders:

To set the default font for an editor use the OnClear event:

procedure TForm1.DBWPRichText1Clear(Sender: TObject);
begin
DBWPRichText1.WritingAttr.Clear;
DBWPRichText1.WritingAttr.SetFontName('Arial');
DBWPRichText1.WritingAttr.SetFontSize(11);
end;
#4 ♥ 0
This category is archived. No new posts are possible.