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
would multi threading hel...
by
Thaddy
[
Today
at 12:14:32 pm]
Bass.dll equalizer unit
by
Pe3s
[
Today
at 11:05:45 am]
Difference in formatting ...
by
Hartmut
[
Today
at 09:30:18 am]
Rolling releases Lazarus[...
by
Thaddy
[
Today
at 09:25:54 am]
Lazarus Bugfix Release 4...
by
CM630
[
Today
at 08:02:52 am]
Lazarus for Windows on aa...
by
Thaddy
[
Today
at 07:26:30 am]
OPC client with Lazarus
by
TheMouseAUS
[
Today
at 04:56:43 am]
[Windows] UTF8 encoding w...
by
PascalDragon
[January 22, 2026, 09:51:05 pm]
Developing FreePascal on ...
by
ccrause
[January 22, 2026, 06:14:41 pm]
Lazarus in Windows allowe...
by
vinntec
[January 22, 2026, 06:01:29 pm]
Perlin Map 3D
by
Boleeman
[January 22, 2026, 05:47:15 pm]
PasTemplates - a go-like ...
by
CynicRus
[January 22, 2026, 05:35:57 pm]
Strange Error when I use ...
by
TYDQ
[January 22, 2026, 03:14:50 pm]
FPCupDeluxe unable to bui...
by
Martin_fr
[January 22, 2026, 02:57:15 pm]
TRichMemo install shows "...
by
vinntec
[January 22, 2026, 01:36:50 pm]
Register global hotkey
by
Thaddy
[January 22, 2026, 06:28:54 am]
X11Libre, finally and for...
by
Fred vS
[January 21, 2026, 10:20:53 pm]
What's wrong with my appl...
by
bourbon
[January 21, 2026, 09:04:40 pm]
How to observe the value ...
by
nouzi
[January 21, 2026, 06:26:13 pm]
Anti "churning" in solita...
by
TBMan
[January 21, 2026, 04:30:05 pm]
Perlin Noise Map With BGR...
by
Boleeman
[January 21, 2026, 01:36:13 pm]
Strange Mail from memo.mi...
by
Thaddy
[January 21, 2026, 01:27:19 pm]
[Solved] Lazreport. Sorti...
by
Petrus Vorster
[January 21, 2026, 11:39:09 am]
Regarding the issue of de...
by
Martin_fr
[January 21, 2026, 11:16:29 am]
Pleas help, Synapse / Ind...
by
patyit
[January 21, 2026, 10:25:29 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Richmemo add text with font (Read 2901 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: 1561
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