mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-25 00:56:07 +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);
|
inc(DestPos);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
// ToDo: pass the eto with to fTextDrawer, instead of filling with spaces
|
||||||
|
if Fill > 0 then fTextDrawer.ForceNextTokenWithEto;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
@ -2905,8 +2907,10 @@ var
|
|||||||
Fill := CharWidths[CurLogIndex + SrcPos] - 1;
|
Fill := CharWidths[CurLogIndex + SrcPos] - 1;
|
||||||
if c = #9 then // tab char
|
if c = #9 then // tab char
|
||||||
Dest[DestPos] := ' '
|
Dest[DestPos] := ' '
|
||||||
else
|
else begin
|
||||||
Dest[DestPos] := p[SrcPos];
|
Dest[DestPos] := p[SrcPos];
|
||||||
|
if Fill > 0 then fTextDrawer.ForceNextTokenWithEto;
|
||||||
|
end;
|
||||||
inc(DestPos);
|
inc(DestPos);
|
||||||
inc(SrcPos);
|
inc(SrcPos);
|
||||||
for i := 1 to Fill do begin
|
for i := 1 to Fill do begin
|
||||||
|
@ -212,6 +212,7 @@ type
|
|||||||
|
|
||||||
// Begin/EndDrawing calling count
|
// Begin/EndDrawing calling count
|
||||||
FDrawingCount: Integer;
|
FDrawingCount: Integer;
|
||||||
|
ForceEto: Boolean;
|
||||||
protected
|
protected
|
||||||
procedure ReleaseETODist; virtual;
|
procedure ReleaseETODist; virtual;
|
||||||
procedure AfterStyleSet; virtual;
|
procedure AfterStyleSet; virtual;
|
||||||
@ -238,6 +239,7 @@ type
|
|||||||
procedure TextOut(X, Y: Integer; Text: PChar; Length: Integer); virtual;
|
procedure TextOut(X, Y: Integer; Text: PChar; Length: Integer); virtual;
|
||||||
procedure ExtTextOut(X, Y: Integer; fuOptions: UINT; const ARect: TRect;
|
procedure ExtTextOut(X, Y: Integer; fuOptions: UINT; const ARect: TRect;
|
||||||
Text: PChar; Length: Integer; FrameBottom: Integer = -1); virtual;
|
Text: PChar; Length: Integer; FrameBottom: Integer = -1); virtual;
|
||||||
|
procedure ForceNextTokenWithEto;
|
||||||
procedure DrawLine(X, Y, X2, Y2: Integer; AColor: TColor);
|
procedure DrawLine(X, Y, X2, Y2: Integer; AColor: TColor);
|
||||||
procedure SetBaseFont(Value: TFont); virtual;
|
procedure SetBaseFont(Value: TFont); virtual;
|
||||||
procedure SetBaseStyle(const Value: TFontStyles); virtual;
|
procedure SetBaseStyle(const Value: TFontStyles); virtual;
|
||||||
@ -1248,8 +1250,9 @@ begin
|
|||||||
fuOptions := 0;
|
fuOptions := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
NeedDistArray:= (FCharExtra > 0) or
|
NeedDistArray:= ForceEto or (FCharExtra > 0) or
|
||||||
(FBaseCharWidth <> FFontStock.CharAdvance) or FFontStock.NeedETO;
|
(FBaseCharWidth <> FFontStock.CharAdvance) or FFontStock.NeedETO;
|
||||||
|
ForceEto := False;
|
||||||
//DebugLn(['TheTextDrawer.ExtTextOut NeedDistArray=',NeedDistArray]);
|
//DebugLn(['TheTextDrawer.ExtTextOut NeedDistArray=',NeedDistArray]);
|
||||||
if NeedDistArray then begin
|
if NeedDistArray then begin
|
||||||
if (FETOSizeInChar < Length) then
|
if (FETOSizeInChar < Length) then
|
||||||
@ -1264,6 +1267,11 @@ begin
|
|||||||
LCLIntf.ExtTextOut(FDC, X, Y, fuOptions, @ARect, Text, Length, DistArray);
|
LCLIntf.ExtTextOut(FDC, X, Y, fuOptions, @ARect, Text, Length, DistArray);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TheTextDrawer.ForceNextTokenWithEto;
|
||||||
|
begin
|
||||||
|
ForceEto := True;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TheTextDrawer.DrawLine(X, Y, X2, Y2: Integer; AColor: TColor);
|
procedure TheTextDrawer.DrawLine(X, Y, X2, Y2: Integer; AColor: TColor);
|
||||||
var
|
var
|
||||||
Pen, OldPen: HPen;
|
Pen, OldPen: HPen;
|
||||||
|
Loading…
Reference in New Issue
Block a user