Recent

Author Topic: Memo component font  (Read 3229 times)

ginoo

  • Full Member
  • ***
  • Posts: 108
Memo component font
« on: August 12, 2023, 11:23:19 am »
Is it possible to put part of the plain text and part bold on the same Tmemo?

kjteng

  • Sr. Member
  • ****
  • Posts: 261
Re: Memo component font
« Reply #1 on: August 13, 2023, 09:54:19 am »
Perhaps you can use TRichMeo available from  https://github.com/skalogryz/richmemo/tree/master

wp

  • Hero Member
  • *****
  • Posts: 12522
Re: Memo component font
« Reply #2 on: August 13, 2023, 11:42:35 am »
If you want to be able to edit the text you should use one of the rich-edit controls, such as TRichMemo, or KMemo (in KControls), all available in the Online-Package-Manager.

If you only want to display the text, without being able to edit it, you could also use the TIpHtmlPanel which is installed by default in Lazarus and can be dropped from the "Ipro" component palette:

Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. const
  3.   TXT = 'This is <b>bold</b>, <i>italic</i>, <u>underlined</u> and <font color="red">red</font> text';
  4. begin
  5.   IpHtmlPanel1.SetHtmlFromStr('<html>' + TXT + '</html>');
  6. end;
« Last Edit: August 13, 2023, 11:51:05 am by wp »

GAN

  • Sr. Member
  • ****
  • Posts: 376
Re: Memo component font
« Reply #3 on: August 14, 2023, 12:18:47 am »
Gino0 is referring to the LazReport component.
I think it's not possible but I'm not 100% sure.
Lazarus 2.0.8 FPC 3.0.4 Linux Mint Mate 19.3
Zeos 7̶.̶2̶.̶6̶ 7.1.3a-stable - Sqlite 3.32.3 - LazReport

wp

  • Hero Member
  • *****
  • Posts: 12522
Re: Memo component font
« Reply #4 on: August 14, 2023, 12:20:14 am »
Gino0 is referring to the LazReport component.
I think it's not possible but I'm not 100% sure.
Oh - I always miss the board to which a post is submitted...

ginoo

  • Full Member
  • ***
  • Posts: 108
Re: Memo component font
« Reply #5 on: August 14, 2023, 09:39:24 am »
Gino0 is referring to the LazReport component.
I think it's not possible but I'm not 100% sure.

I figured, when I have time I try to create a component to do it, if I'll be able to do it and then I'll publish it (for whoever wants it).
I forgot, I'll try if it's possible with fpreport.

and thanks to @wp and @kjteng for replying
« Last Edit: August 14, 2023, 10:42:30 am by ginoo »

paweld

  • Hero Member
  • *****
  • Posts: 1278
Re: Memo component font
« Reply #6 on: August 14, 2023, 11:02:06 am »
@Nicola Gorlandi share a patch to lr_class unit, that may solve your problem: https://forum.lazarus.freepascal.org/index.php/topic,60024.msg452203.html#msg452203
Best regards / Pozdrawiam
paweld

ginoo

  • Full Member
  • ***
  • Posts: 108
Re: Memo component font
« Reply #7 on: August 14, 2023, 11:33:05 am »
Thanks @paweld and @Nicola Gorlandi.
Now I try.

If it works, is it worth integrating it with lazreport?

 

TinyPortal © 2005-2018