Assigning Attributes

TECH TIP: Assigning Font Attributes of RichText component

You can assign font attributes to a RichText component by using the SelStart, SelLength properties or the
the SelectAll method to select the text. Then assign the font to the RichText.SelAttributes property.

Example:

var
  lFont: TFont;

begin

  lFont := TFont.Create;
  lFont.Name  := 'Arial';
  lFont.Size  := 14;
  lFont.Color := clRed;
  lFont.Style := [fsItalic, fsBold];

  ppRichText1.SelectAll;
  ppRichText1.SelAttributes.Assign(lFont);

end;