Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
RichMemo
»
Richmemo add text with font
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Debian removes FPC/Lazaru...
by
dbannon
[
Today
at 08:35:48 am]
Free Pascal for a small e...
by
cdbc
[
Today
at 07:06:42 am]
Transparent Form: Some Th...
by
Xenno
[
Today
at 04:50:53 am]
FPC and Lazarus coding st...
by
Wallaby
[
Today
at 04:39:45 am]
FPC error when using O3
by
Seenkao
[
Today
at 04:21:14 am]
FPCUnit returns 2 error l...
by
n7800
[
Today
at 02:43:55 am]
Help with diabetes projec...
by
Boleeman
[
Today
at 02:30:50 am]
it2play - IT/S3M module r...
by
hukka
[
Today
at 02:24:02 am]
Defaults for features
by
Martin_fr
[
Today
at 02:07:48 am]
Status of FPC 3.4.0 or FP...
by
creaothceann
[
Today
at 12:50:08 am]
TLazSerial : serial port ...
by
CM630
[February 06, 2026, 11:02:03 pm]
function intersect in laz...
by
wp
[February 06, 2026, 08:30:39 pm]
LCL Web Native with D2Bri...
by
xinyiman
[February 06, 2026, 04:52:10 pm]
Log in to web Data with U...
by
rvk
[February 06, 2026, 03:23:29 pm]
Notetask 1.1.0 - Free cro...
by
AlexanderT
[February 06, 2026, 02:33:56 pm]
Rolling releases Lazarus[...
by
marcov
[February 06, 2026, 02:07:36 pm]
lazarus IDE anchordock ba...
by
szlbz
[February 06, 2026, 12:53:12 pm]
Upload multipart POST req...
by
OH1KH
[February 06, 2026, 11:53:17 am]
Ininside ProjectSession, ...
by
d2010
[February 06, 2026, 10:34:50 am]
Recommendations for wasm3...
by
temp0
[February 06, 2026, 03:47:38 am]
Lazarus for Windows on aa...
by
msintle
[February 06, 2026, 01:02:01 am]
ListBox MeasureItem
by
jamie
[February 05, 2026, 11:02:02 pm]
Feature announcement: Fun...
by
PascalDragon
[February 05, 2026, 09:29:34 pm]
Improved FPC JSON-RPC sup...
by
PascalDragon
[February 05, 2026, 09:15:07 pm]
C-specific record functio...
by
440bx
[February 05, 2026, 08:38:23 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Richmemo add text with font (Read 2924 times)
eldonfsr
Hero Member
Posts: 557
Richmemo add text with font
«
on:
September 29, 2022, 08:44:23 pm »
Hi i have a question how i can add text or line richmemo with font or textstyle
Logged
paweld
Hero Member
Posts: 1567
Re: Richmemo add text with font
«
Reply #1 on:
September 29, 2022, 09:19:33 pm »
Code: Pascal
[Select]
[+]
[-]
uses
LazUTF8
;
procedure
TForm1
.
Button1Click
(
Sender
:
TObject
)
;
const
colorarr
:
array
[
0
..
4
]
of
TColor
=
(
clBlack
,
clRed
,
clGreen
,
clGray
,
clBlue
)
;
fontstylearr
:
array
[
0
..
3
]
of
TFontStyle
=
(
fsBold
,
fsItalic
,
fsUnderLine
,
fsStrikeOut
)
;
fontsizearr
:
array
[
0
..
5
]
of
Integer
=
(
10
,
14
,
16
,
24
,
32
,
48
)
;
fontnamearr
:
array
[
0
..
2
]
of
String
=
(
'Arial'
,
'Courier'
,
'Times New Roman'
)
;
var
m
,
l
:
Integer
;
s
:
String
;
begin
s
:
=
'zażółć gęślą jaźń'
;
s
:
=
UTF8Copy
(
s
,
1
,
Random
(
UTF8Length
(
s
)
)
+
1
)
;
m
:
=
UTF8Length
(
RichMemo1
.
Lines
.
Text
)
;
l
:
=
UTF8Length
(
s
)
;
RichMemo1
.
Lines
.
Add
(
s
)
;
//Add line
RichMemo1
.
SetRangeParams
(
m
,
l
,
[
tmm_Color
,
tmm_Styles
,
tmm_Name
,
tmm_Size
]
,
//tmm_Color - set font color, tmm_Styles - set font style, tmm_Size - set font size, tmm_Name - set font name
fontnamearr
[
l
mod
3
]
,
fontsizearr
[
l
mod
6
]
,
colorarr
[
l
mod
5
]
,
[
fontstylearr
[
l
mod
4
]
]
,
[
]
)
;
end
;
Logged
Best regards / Pozdrawiam
paweld
skalogryz
Global Moderator
Hero Member
Posts: 2770
Re: Richmemo add text with font
«
Reply #2 on:
September 29, 2022, 09:27:55 pm »
https://wiki.freepascal.org/RichMemo/FAQ#Add_text_with_font
Logged
eldonfsr
Hero Member
Posts: 557
Re: Richmemo add text with font
«
Reply #3 on:
September 29, 2022, 10:51:32 pm »
Ok Thanks....
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
RichMemo
»
Richmemo add text with font
TinyPortal
© 2005-2018