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
IRC channel
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
Letters chopped off in hi...
by
jamie
[
Today
at 01:24:44 am]
Hole punching - Step by S...
by
Warfley
[
Today
at 12:48:16 am]
Installing GDB on MAC OS ...
by
cahlucas
[
Today
at 12:43:14 am]
Is Meta programming possi...
by
Joanna
[May 31, 2023, 11:57:27 pm]
[Solved] Dark mode in app...
by
d7_2_laz
[May 31, 2023, 11:28:56 pm]
SQLite Unique
by
paweld
[May 31, 2023, 11:02:27 pm]
SQLite check if record ex...
by
paweld
[May 31, 2023, 10:38:45 pm]
How to download a file fr...
by
c4p
[May 31, 2023, 10:09:56 pm]
Magic, non referenced var...
by
PascalDragon
[May 31, 2023, 09:55:09 pm]
How to use the Event Log?
by
Martin_fr
[May 31, 2023, 09:55:07 pm]
BoxChart cannot be color ...
by
kiyo
[May 31, 2023, 08:35:05 pm]
Default and speed effect
by
Martin_fr
[May 31, 2023, 06:51:41 pm]
LazPaint (alpha-blending,...
by
circular
[May 31, 2023, 06:38:33 pm]
Anonymous Unions-Middle R...
by
jamie
[May 31, 2023, 06:08:15 pm]
Initializing an array
by
jamie
[May 31, 2023, 05:35:14 pm]
PostgreSQL: typeinfo erro...
by
Чебурашка
[May 31, 2023, 04:50:52 pm]
Sevenzip. Pas with multiv...
by
datilas
[May 31, 2023, 04:33:37 pm]
Error in Sway
by
AmatCoder
[May 31, 2023, 04:02:28 pm]
Google Snappy bindings fo...
by
Okoba
[May 31, 2023, 03:39:37 pm]
CEF4Delphi under Ubuntu C...
by
myisjwj
[May 31, 2023, 02:51:10 pm]
how to download fulling f...
by
af0815
[May 31, 2023, 02:36:40 pm]
Why is the rectangle the ...
by
zeljko
[May 31, 2023, 02:35:37 pm]
lhelp not working on Linu...
by
zeljko
[May 31, 2023, 02:33:47 pm]
min() function behavior i...
by
tetrastes
[May 31, 2023, 10:17:25 am]
Help for downloand file
by
rvk
[May 31, 2023, 09:29:43 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Richmemo add text with font (Read 562 times)
eldonfsr
Sr. Member
Posts: 372
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: 673
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: 2763
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
Sr. Member
Posts: 372
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