You've already forked lazarus-ccr
richmemo: clarification of rules on line spacing
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3767 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -333,7 +333,7 @@ begin
|
||||
AMetric.FirstLine:=attr^.indent*PixToPt;
|
||||
AMetric.HeadIndent:=attr^.left_margin*PixToPt;
|
||||
AMetric.TailIndent:=attr^.right_margin*PixToPt;
|
||||
AMetric.LineSpacing:=(attr^.pixels_inside_wrap*PixToPt+fp.Size*1.2)/(fp.Size*1.2);
|
||||
AMetric.LineSpacing:=(attr^.pixels_inside_wrap*PixToPt+fp.Size)/(fp.Size);
|
||||
gtk_text_attributes_unref(attr);
|
||||
end;
|
||||
end;
|
||||
@ -384,7 +384,7 @@ begin
|
||||
'right-margin-set', gboolean(gTRUE),
|
||||
'indent', gint(round(fl*DPIFactor)),
|
||||
'indent-set', gboolean(gTRUE),
|
||||
'pixels-inside-wrap', gint(round(fp.Size*1.2*(AMetric.LineSpacing-1)*DPIFactor)),
|
||||
'pixels-inside-wrap', gint(round(fp.Size*(AMetric.LineSpacing-1)*DPIFactor)),
|
||||
'pixels-inside_wrap-set', gboolean(gTRUE),
|
||||
nil]);
|
||||
ApplyTag(buffer, tag, TextStart, TextLen, true);
|
||||
|
@ -41,8 +41,14 @@ type
|
||||
HeadIndent : Double; // in points
|
||||
SpaceBefore : Double; // in points
|
||||
SpaceAfter : Double; // in points
|
||||
LineSpacing : Double; // multi
|
||||
LineSpacing : Double; // multiplier - matching CSS line-height by percentage/em
|
||||
// note, that normal LineSpacing is 1.2, not 1.0
|
||||
end;
|
||||
|
||||
const
|
||||
DefLineSpacing = 1.2;
|
||||
|
||||
type
|
||||
TParaNumStyle = (pnNone, pnBullet, pnNumber, pnLowLetter
|
||||
, pnLowRoman, pnUpLetter, pnUpRoman, pnCustomChar);
|
||||
|
||||
@ -54,6 +60,8 @@ type
|
||||
|
||||
TTextModifyMask = set of (tmm_Color, tmm_Name, tmm_Size, tmm_Styles);
|
||||
|
||||
|
||||
type
|
||||
TRichMemoObject = class(TObject);
|
||||
|
||||
{ TCustomRichMemo }
|
||||
@ -205,7 +213,7 @@ end;
|
||||
procedure InitParaMetric(var m: TParaMetric);
|
||||
begin
|
||||
FillChar(m, sizeof(m), 0);
|
||||
m.LineSpacing:=1.0;
|
||||
m.LineSpacing:=DefLineSpacing;
|
||||
end;
|
||||
|
||||
procedure InitParaNumbering(var n: TParaNumbering);
|
||||
|
Reference in New Issue
Block a user