mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-23 06:06:22 +02:00
SynEdit: Fixed regression from revision 19907 #e747489eff/19908 #a24043f0e8, Chinese/Eastern DoubleWidth fonts where drawn with too much spacing. Bug #13764
git-svn-id: trunk@20052 -
This commit is contained in:
parent
47e7115c4d
commit
db010cf64c
@ -2896,6 +2896,8 @@ var
|
||||
inc(DestPos);
|
||||
end;
|
||||
end;
|
||||
// ToDo: pass the eto with to fTextDrawer, instead of filling with spaces
|
||||
if Fill > 0 then fTextDrawer.ForceNextTokenWithEto;
|
||||
end;
|
||||
end;
|
||||
end else begin
|
||||
@ -2905,8 +2907,10 @@ var
|
||||
Fill := CharWidths[CurLogIndex + SrcPos] - 1;
|
||||
if c = #9 then // tab char
|
||||
Dest[DestPos] := ' '
|
||||
else
|
||||
else begin
|
||||
Dest[DestPos] := p[SrcPos];
|
||||
if Fill > 0 then fTextDrawer.ForceNextTokenWithEto;
|
||||
end;
|
||||
inc(DestPos);
|
||||
inc(SrcPos);
|
||||
for i := 1 to Fill do begin
|
||||
|
@ -212,6 +212,7 @@ type
|
||||
|
||||
// Begin/EndDrawing calling count
|
||||
FDrawingCount: Integer;
|
||||
ForceEto: Boolean;
|
||||
protected
|
||||
procedure ReleaseETODist; virtual;
|
||||
procedure AfterStyleSet; virtual;
|
||||
@ -238,6 +239,7 @@ type
|
||||
procedure TextOut(X, Y: Integer; Text: PChar; Length: Integer); virtual;
|
||||
procedure ExtTextOut(X, Y: Integer; fuOptions: UINT; const ARect: TRect;
|
||||
Text: PChar; Length: Integer; FrameBottom: Integer = -1); virtual;
|
||||
procedure ForceNextTokenWithEto;
|
||||
procedure DrawLine(X, Y, X2, Y2: Integer; AColor: TColor);
|
||||
procedure SetBaseFont(Value: TFont); virtual;
|
||||
procedure SetBaseStyle(const Value: TFontStyles); virtual;
|
||||
@ -1248,8 +1250,9 @@ begin
|
||||
fuOptions := 0;
|
||||
end;
|
||||
|
||||
NeedDistArray:= (FCharExtra > 0) or
|
||||
NeedDistArray:= ForceEto or (FCharExtra > 0) or
|
||||
(FBaseCharWidth <> FFontStock.CharAdvance) or FFontStock.NeedETO;
|
||||
ForceEto := False;
|
||||
//DebugLn(['TheTextDrawer.ExtTextOut NeedDistArray=',NeedDistArray]);
|
||||
if NeedDistArray then begin
|
||||
if (FETOSizeInChar < Length) then
|
||||
@ -1264,6 +1267,11 @@ begin
|
||||
LCLIntf.ExtTextOut(FDC, X, Y, fuOptions, @ARect, Text, Length, DistArray);
|
||||
end;
|
||||
|
||||
procedure TheTextDrawer.ForceNextTokenWithEto;
|
||||
begin
|
||||
ForceEto := True;
|
||||
end;
|
||||
|
||||
procedure TheTextDrawer.DrawLine(X, Y, X2, Y2: Integer; AColor: TColor);
|
||||
var
|
||||
Pen, OldPen: HPen;
|
||||
|
Loading…
Reference in New Issue
Block a user