I've been reworking my code for drop caps. I'm using some code from the forum I found some time ago.
Code: Select all
Lii := TRVLabelItemInfo.Create(rv.RVData);
FI := TFontInfo.Create(nil);
try
FI.FontName := rv.Style.TextStyles[0].FontName;
FI.Size := (rv.Style.TextStyles[0].Size * 3);
FI.StyleName := 'InitCap';
FI.Standard := False;
Lii.VAlign := rvvaLeft ;
Lii.TextStyleNo := rv.Style.FindTextStyle(FI);
Lii.Text := rv.GetSelTextW; //Ch;
Lii.OuterVSpacing := -4;
Lii.SetExtraIntProperty( rvepOuterVSpacing , Lii.OuterVSpacing );
rv.InsertItem('', Lii);
For the regular rve, I do this:
Code: Select all
TRVLabelItemInfo(rv.RVData.GetItem(i)).OuterVSpacing := -4;
Code: Select all
TRVLabelItemInfo(rv.RVData.GetItem(i)).OuterVSpacing := 4;
I'll attach an example rvf file. Put it into the RichViewActionsTest demo and it should look like this:
Then, do a print preview and it looks like this:
I want the drop cap position in the print preview to match the regular rve. My current code is working but I have a feeling there may be a much better way.
Thanks Sergey
Stan