richmemo: improve line height support for gtk2

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3819 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2014-12-02 03:14:38 +00:00
parent f75c4cc370
commit 681614d3c4

View File

@ -276,6 +276,7 @@ var
buffer : PGtkTextBuffer; buffer : PGtkTextBuffer;
tag : Pointer; tag : Pointer;
gcolor : TGdkColor; gcolor : TGdkColor;
bgcolor : TGdkColor;
nm : string; nm : string;
const const
pu: array [Boolean] of gint = (PANGO_UNDERLINE_NONE, PANGO_UNDERLINE_SINGLE); pu: array [Boolean] of gint = (PANGO_UNDERLINE_NONE, PANGO_UNDERLINE_SINGLE);
@ -286,12 +287,16 @@ begin
if not Assigned(buffer) then Exit; if not Assigned(buffer) then Exit;
gcolor := TColortoTGDKColor(Params.Color); gcolor := TColortoTGDKColor(Params.Color);
bgcolor := TColortoTGDKColor(Params.BkColor);
nm := Params.Name; nm := Params.Name;
if nm = '' then nm := #0; if nm = '' then nm := #0;
tag := gtk_text_buffer_create_tag (buffer, nil, tag := gtk_text_buffer_create_tag (buffer, nil,
'family-set', [gboolean(gTRUE), 'family-set', [gboolean(gTRUE),
'family', @nm[1], 'family', @nm[1],
'foreground-gdk', @gcolor, 'foreground-gdk', @gcolor,
'foreground-set', gboolean(gTRUE),
'background-gdk', @bgcolor,
'background-set', gboolean(Params.HasBkClr),
'size-set', gboolean(gTRUE), 'size-set', gboolean(gTRUE),
'size-points', gdouble(Params.Size), 'size-points', gdouble(Params.Size),
'underline-set', gboolean(gTRUE), 'underline-set', gboolean(gTRUE),
@ -428,7 +433,7 @@ begin
'right-margin-set', gboolean(gTRUE), 'right-margin-set', gboolean(gTRUE),
'indent', gint(round(fl*DPIFactor)), 'indent', gint(round(fl*DPIFactor)),
'indent-set', gboolean(gTRUE), 'indent-set', gboolean(gTRUE),
'pixels-inside-wrap', gint(round(fp.Size*(AMetric.LineSpacing-1)*DPIFactor)), 'pixels-inside-wrap', gint((round(fp.Size*(AMetric.LineSpacing-DefLineSpacing)*DPIFactor))),
'pixels-inside_wrap-set', gboolean(gTRUE), 'pixels-inside_wrap-set', gboolean(gTRUE),
nil]); nil]);
ApplyTag(buffer, tag, TextStart, TextLen, true); ApplyTag(buffer, tag, TextStart, TextLen, true);