HOWTO: replace font size globally

General TRichView support forum. Please post your questions here
Post Reply
bedla.czech
Posts: 2
Joined: Wed Feb 08, 2006 1:49 pm

HOWTO: replace font size globally

Post by bedla.czech »

hi,

i want to change font size globally in my BLOB field, but i havent found any solution.

thx
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If this operation should not be undone, load this document in TRichView via stream, change font in all styles:
for i := 0 to RVStyle1.TextStyles.Count-1 do
RVStyle1.TextStyles.Size := NEWSIZE;
and save it back.
Denoson
Posts: 71
Joined: Tue Jan 24, 2006 9:25 pm
Contact:

Inc, Dec

Post by Denoson »

You may use

Increase:
RVStyle1.TextStyles.Size := RVStyle1.TextStyles.Size + 1;

Decrease:
RVStyle1.TextStyles.Size := RVStyle1.TextStyles.Size - 1;
bedla.czech
Posts: 2
Joined: Wed Feb 08, 2006 1:49 pm

Post by bedla.czech »

Sergey Tkachenko wrote:If this operation should not be undone, load this document in TRichView via stream, change font in all styles:
for i := 0 to RVStyle1.TextStyles.Count-1 do
RVStyle1.TextStyles.Size := NEWSIZE;
and save it back.


yes, i am doing it this way. but this data is loaded via dbrichviewedit from blob stream, dataset is set to edit mode, than i have made changes and finally i post the changes. than it looks like richview rollback changes :-( and font size doesnt change.
Sergey Tkachenko
Site Admin
Posts: 17534
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Possible ways:

1) Loading in non-db TRichView, changing fonts and saving it back
(See Demos\Delphi\DB Demo\2 RichViewEdit\)

2) Loading in DBRichViewEdit (not DBRichView, it cannot save data), making changes, calling DBRichViewEdit.Change to inform the table that changes have been made, calling table.Post (See the "Example 1" in the help topic about TDBRichViewEdit)
Post Reply