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
Battery Operations
by
msintle
[
Today
at 02:07:31 am]
BGRABitmap - showcase -
by
Mongkey
[
Today
at 01:48:13 am]
Automatize build system
by
Чебурашка
[
Today
at 01:15:45 am]
can't determine which ove...
by
jamie
[
Today
at 12:09:45 am]
how to change color of a ...
by
Joanna
[
Today
at 12:06:52 am]
Stringgrid check only one...
by
jamie
[December 08, 2023, 11:59:19 pm]
likely/unlikely — will it...
by
Laksen
[December 08, 2023, 11:47:34 pm]
Fpcupdeluxe
by
Gustavo 'Gus' Carreno
[December 08, 2023, 11:17:23 pm]
Unique Instance Terminate...
by
d7_2_laz
[December 08, 2023, 11:00:59 pm]
Possible bug with range c...
by
Чебурашка
[December 08, 2023, 11:00:53 pm]
Using tabs instead of spa...
by
Nadar
[December 08, 2023, 09:44:03 pm]
Writing three interrupts ...
by
pascalbythree
[December 08, 2023, 06:37:57 pm]
Online Package Manager
by
lainz
[December 08, 2023, 04:49:48 pm]
Compile loongarch64 appli...
by
myisjwj
[December 08, 2023, 04:47:58 pm]
[SOLVED] Watchlist, order...
by
Hansvb
[December 08, 2023, 02:12:37 pm]
Advance Record operators ...
by
ad1mt
[December 08, 2023, 01:08:55 pm]
TWSButton descendance
by
Martin_fr
[December 08, 2023, 12:58:46 pm]
New version of BGRABitmap
by
circular
[December 08, 2023, 12:05:38 pm]
regex/and
by
Martin_fr
[December 08, 2023, 10:54:49 am]
Interesting work on Unive...
by
MarkMLl
[December 08, 2023, 09:56:59 am]
AI cheetah
by
loaded
[December 08, 2023, 09:26:52 am]
[SOLVED] How to stay in t...
by
egsuh
[December 08, 2023, 03:52:10 am]
LCLVLCPlayer causes 'Exte...
by
Mongkey
[December 08, 2023, 02:39:13 am]
inserting text from clipb...
by
Martin_fr
[December 08, 2023, 01:46:40 am]
Chinese input in edit and...
by
myisjwj
[December 08, 2023, 01:28:21 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Richmemo add text with font (Read 1296 times)
eldonfsr
Sr. Member
Posts: 433
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: 851
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
Sr. Member
Posts: 433
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