mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:59:12 +02:00
improved ExtTxtOut: support for char dist array
git-svn-id: trunk@2025 -
This commit is contained in:
parent
9d03ecd608
commit
82a79bcc79
@ -2759,7 +2759,7 @@ var
|
|||||||
LineStart, LineEnd, StrEnd: PChar;
|
LineStart, LineEnd, StrEnd: PChar;
|
||||||
Width, Height: Integer;
|
Width, Height: Integer;
|
||||||
TopY, LineLen, LineHeight : Integer;
|
TopY, LineLen, LineHeight : Integer;
|
||||||
TXTPt : TPoint;
|
TxtPt : TPoint;
|
||||||
UseFont : PGDKFont;
|
UseFont : PGDKFont;
|
||||||
UnRef : Boolean;
|
UnRef : Boolean;
|
||||||
DCOrigin: TPoint;
|
DCOrigin: TPoint;
|
||||||
@ -2768,12 +2768,30 @@ var
|
|||||||
procedure DrawTextLine;
|
procedure DrawTextLine;
|
||||||
var
|
var
|
||||||
UnderLineLen, Y: integer;
|
UnderLineLen, Y: integer;
|
||||||
|
CurDistX: PInteger;
|
||||||
|
CharsWritten, CurX, i: integer;
|
||||||
|
LinePos: PChar;
|
||||||
begin
|
begin
|
||||||
with TDeviceContext(DC) do begin
|
with TDeviceContext(DC) do begin
|
||||||
gdk_draw_text(Drawable, UseFont, GC, TxtPt.X, TxtPt.Y,
|
if Dx=nil then begin
|
||||||
LineStart, LineLen);
|
// no dist array -> write as one block
|
||||||
gdk_draw_text(Drawable, UseFont, GC, 0,0,
|
gdk_draw_text(Drawable, UseFont, GC, TxtPt.X, TxtPt.Y,
|
||||||
'A'#0,2);
|
LineStart, LineLen);
|
||||||
|
end else begin
|
||||||
|
// dist array -> write each char separately
|
||||||
|
CharsWritten:=integer(LineStart-Str);
|
||||||
|
if DCTextMetric.IsDoubleByteChar then
|
||||||
|
CharsWritten:=CharsWritten div 2;
|
||||||
|
CurDistX:=Dx+CharsWritten*SizeOf(Integer);
|
||||||
|
CurX:=TxtPt.X;
|
||||||
|
LinePos:=LineStart;
|
||||||
|
for i:=1 to LineLen do begin
|
||||||
|
gdk_draw_text(Drawable, UseFont, GC, CurX, TxtPt.Y, LinePos, 1);
|
||||||
|
inc(LinePos);
|
||||||
|
inc(CurX,CurDistX^);
|
||||||
|
inc(CurDistX);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
if UnderLine then begin
|
if UnderLine then begin
|
||||||
UnderLineLen := Rect^.Right-Rect^.Left;
|
UnderLineLen := Rect^.Right-Rect^.Left;
|
||||||
Y := TxtPt.Y + 1;
|
Y := TxtPt.Y + 1;
|
||||||
@ -7536,6 +7554,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.193 2002/12/07 08:42:09 mattias
|
||||||
|
improved ExtTxtOut: support for char dist array
|
||||||
|
|
||||||
Revision 1.192 2002/12/05 22:16:33 mattias
|
Revision 1.192 2002/12/05 22:16:33 mattias
|
||||||
double byte char font started
|
double byte char font started
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user