Revivo el post para añadir un metodo sencillo de insertar caracteres con formato:
Para añadir lineas con formato no se puede utilizar
Código Delphi
[-]
RichEdit.lines.add(`linea de texto 1`);
ya que añade texto plano.
Se debe hacer del siguiente modo (y se puede crear un procedimiento para hacerlo mas sencillo):
Código Delphi
[-]
with richEdit1 do
begin
SelStart := GetTextLen;
SelText := 'Primera linea' + #13#10;
SelText := 'texto con formato en richedit' + #13#10;
SelAttributes.Size := 13;
SelAttributes.Style := [fsBold];
SelAttributes.Color := clRed;
SelText := 'Buena';
SelAttributes.Color := clWindowText;
SelText := ' Programación ';
SelAttributes.Style := [fsItalic];
SelAttributes.Color := clBlue;
SelText := 'en Delphi';
SelText := #13#10;
SelAttributes.Size := 8;
SelAttributes.Color := clGreen;
SelText := 'Ahora podes hacer un procedimiento...';
end;