richmemo: added constant for linespacing. corrected loading/saving of linespacing information

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3812 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz 2014-11-30 08:14:17 +00:00
parent 2e8c900170
commit 3764b37587
2 changed files with 9 additions and 3 deletions

View File

@ -48,7 +48,11 @@ type
end;
const
DefLineSpacing = 1.2;
DefLineSpacing = 1.2;
SingleLineSpacing = DefLineSpacing;
OneHalfLineSpacing = DefLineSpacing * 1.5;
DoubleLineSpacing = DefLineSpacing * 2.0;
type
TParaNumStyle = (pnNone, pnBullet, pnNumber, pnLowLetter

View File

@ -363,7 +363,9 @@ begin
rtfRightIndent: prm.pm.TailIndent := aparam / 20;
rtfSpaceBefore: prm.pm.SpaceBefore := aparam / 20;
rtfSpaceAfter: prm.pm.SpaceAfter := aparam / 20;
rtfSpaceBetween: prm.pm.LineSpacing := aparam / 240;
rtfSpaceBetween: prm.pm.LineSpacing := aparam / 200;
// \slN - surprise! the "line spacing" is actually a multiplier based on the FONT size, not linesize
// where linesize = fontsize * 1.2
rtfLanguage: begin
lang:=rtfParam;
langproc:=nil;
@ -547,7 +549,6 @@ function SaveStream(ARich: TcustomRichMemo; Dst: TStream): Boolean;
var
p : TSaveParams;
begin
writeln('saving stream!');
FillChar(p, sizeof(p), 0);
p.start:=-1;
p.len:=-1;
@ -802,6 +803,7 @@ begin
if pm.TailIndent<>0 then RtfOut('\ri'+IntToStr(round(pm.TailIndent*20)));
if pm.SpaceAfter<>0 then RtfOut('\sa'+IntToStr(round(pm.SpaceAfter*20)));
if pm.SpaceBefore<>0 then RtfOut('\sb'+IntToStr(round(pm.SpaceBefore*20)));
if pm.LineSpacing<>0 then RtfOut('\sl'+IntToStr(round(pm.LineSpacing*200))+'\slmult1');
RtfOut(' ');
end;
s:=GetRTFWriteText(u, i, isnewpara);