Page 1 of 1

HOWTO: replace font size globally

Posted: Wed Feb 08, 2006 2:58 pm
by bedla.czech
hi,

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

thx

Posted: Wed Feb 08, 2006 8:13 pm
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.

Inc, Dec

Posted: Fri Feb 10, 2006 10:03 pm
by Denoson
You may use

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

Decrease:
RVStyle1.TextStyles.Size := RVStyle1.TextStyles.Size - 1;

Posted: Sat Feb 11, 2006 9:36 am
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.

Posted: Sun Feb 12, 2006 3:24 pm
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)