PowerPDF: fix showing UTF8 string in preview, issue 20485
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2101 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
65f091f5d3
commit
c6de45431d
@ -43,7 +43,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
{$IFDEF LAZ_POWERPDF}
|
{$IFDEF LAZ_POWERPDF}
|
||||||
LCLType, LMessages, LCLIntf, GraphType, FPCanvas,
|
LCLType, LMessages, LCLIntf, GraphType, FPCanvas, LCLProc,
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
Windows, Messages,
|
Windows, Messages,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -1628,6 +1628,26 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// InternalTextout
|
// InternalTextout
|
||||||
|
{$IFDEF LAZ_POWERPDF}
|
||||||
|
function TPRCustomLabel.InternalTextout(APdfCanvas: TPdfCanvas;
|
||||||
|
S: string; X, Y: integer): Single;
|
||||||
|
var
|
||||||
|
Pos: Double;
|
||||||
|
i: integer;
|
||||||
|
Word: string;
|
||||||
|
begin
|
||||||
|
Pos := X;
|
||||||
|
for i:=1 to UTF8Length(S) do begin
|
||||||
|
Word := UTF8Copy(s, i, 1);
|
||||||
|
Canvas.TextOut(Round(Pos), Y, Word);
|
||||||
|
with APdfCanvas do
|
||||||
|
Pos := Pos + TextWidth(Word) + Attribute.CharSpace;
|
||||||
|
if Word=' ' then
|
||||||
|
Pos := Pos + FWordSpace
|
||||||
|
end;
|
||||||
|
result := Pos;
|
||||||
|
end;
|
||||||
|
{$ELSE}
|
||||||
function TPRCustomLabel.InternalTextout(APdfCanvas: TPdfCanvas;
|
function TPRCustomLabel.InternalTextout(APdfCanvas: TPdfCanvas;
|
||||||
S: string; X, Y: integer): Single;
|
S: string; X, Y: integer): Single;
|
||||||
var
|
var
|
||||||
@ -1664,6 +1684,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
result := Pos;
|
result := Pos;
|
||||||
end;
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
// GetFontClassName
|
// GetFontClassName
|
||||||
function TPRCustomLabel.GetFontClassName: string;
|
function TPRCustomLabel.GetFontClassName: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user