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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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; |