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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How make the GUI as one p...
by
Hartmut
[
Today
at 02:09:59 pm]
Interesting article about...
by
VisualLab
[
Today
at 02:03:14 pm]
Button opens terminal (Li...
by
Hartmut
[
Today
at 02:01:52 pm]
Common File Dialogs Have ...
by
msintle
[
Today
at 01:55:28 pm]
[SOLVED] Classic objects ...
by
Warfley
[
Today
at 01:46:08 pm]
Starting a program with h...
by
Hartmut
[
Today
at 01:41:23 pm]
Specializing a generic of...
by
Okoba
[
Today
at 01:05:48 pm]
DBGrid editing control
by
silvercoder70
[
Today
at 12:43:29 pm]
TSynCompletion filtering ...
by
Martin_fr
[
Today
at 12:08:45 pm]
IFS Fractals: Iterating t...
by
Joanna from IRC
[
Today
at 11:41:26 am]
Unwanted additional line ...
by
CM630
[
Today
at 08:55:13 am]
How to copy file to web
by
TRon
[
Today
at 07:56:04 am]
Animated GIF's and Lazaru...
by
Aruna
[
Today
at 05:44:42 am]
TCheckGroup Child Alignme...
by
dsiders
[
Today
at 05:34:14 am]
MainMenu: How to use the ...
by
rich2014
[
Today
at 02:45:31 am]
Lazarus for Windows on aa...
by
msintle
[
Today
at 02:33:01 am]
Q: Debug a plugin DLL - c...
by
440bx
[
Today
at 02:23:27 am]
[Solved] Dumb SQLite ques...
by
dsiders
[
Today
at 12:44:26 am]
SDL2 Fit image rotation b...
by
bobihot
[December 13, 2024, 10:31:27 pm]
[Solved] Crosshair error ...
by
Marq01
[December 13, 2024, 09:55:14 pm]
What is the history of di...
by
mika
[December 13, 2024, 09:49:59 pm]
fpweb documentation do no...
by
Sniper
[December 13, 2024, 09:02:16 pm]
Managed pointers
by
jksmithiii
[December 13, 2024, 08:42:29 pm]
[Solved] Debug a plugin D...
by
d7_2_laz
[December 13, 2024, 05:27:48 pm]
SAVE StringGrid to PDF
by
seghele0
[December 13, 2024, 05:19:19 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Richmemo add text with font (Read 2437 times)
eldonfsr
Hero Member
Posts: 526
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: 1268
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: 526
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