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
Bug in string concatenati...
by
Fibonacci
[
Today
at 12:47:23 am]
fphttpclient https/tls on...
by
fireboxsoft
[
Today
at 12:38:12 am]
Q: Debug a plugin DLL: 'h...
by
Martin_fr
[
Today
at 12:32:43 am]
Interesting article about...
by
Joanna from IRC
[December 12, 2024, 11:59:01 pm]
The Silver Coder on YouTu...
by
silvercoder70
[December 12, 2024, 11:42:06 pm]
crash db navigator with L...
by
wp
[December 12, 2024, 11:07:46 pm]
Common File Dialogs Have ...
by
dsiders
[December 12, 2024, 11:02:19 pm]
[Solved] Crosshair error ...
by
wp
[December 12, 2024, 10:45:16 pm]
Datatypes Interoperabilit...
by
BSaidus
[December 12, 2024, 09:36:52 pm]
Component Installation
by
msch
[December 12, 2024, 09:31:43 pm]
Who catches the Linux sig...
by
PascalDragon
[December 12, 2024, 09:10:40 pm]
Bot moderator for large g...
by
Renat.Su
[December 12, 2024, 09:09:31 pm]
FPC port to 9front
by
PascalDragon
[December 12, 2024, 09:00:02 pm]
Adding interfaces to any ...
by
PascalDragon
[December 12, 2024, 08:58:19 pm]
Wiki, a dead link in page...
by
d7_2_laz
[December 12, 2024, 08:47:40 pm]
lazarus 4.0 RC1 error
by
Martin_fr
[December 12, 2024, 08:06:35 pm]
Help Needed With FPHTTPCl...
by
AaronCatolico1
[December 12, 2024, 06:46:06 pm]
Draw Transparent Fill Rec...
by
LBox
[December 12, 2024, 06:43:14 pm]
TvsComPort on MacOS Sierr...
by
ackarwow
[December 12, 2024, 06:33:15 pm]
Starting a program with h...
by
Hartmut
[December 12, 2024, 06:11:21 pm]
I have created dll in gol...
by
Packs
[December 12, 2024, 05:52:32 pm]
Interaction dbnavigator r...
by
calm_sea
[December 12, 2024, 03:08:52 pm]
Online tutor using remote...
by
marcov
[December 12, 2024, 10:21:25 am]
had a question and found ...
by
MarkMLl
[December 12, 2024, 09:14:59 am]
Adlib Player
by
Gigatron
[December 12, 2024, 01:57:12 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Richmemo add text with font (Read 2435 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