You've already forked lazarus-ccr
PowerPDF, initial fix for output of text no converted from UTF8 to ansi encoding on linux (which do not do ansi convertion)
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@956 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -2003,10 +2003,14 @@ procedure TPdfCanvas.ShowText(s: string);
|
|||||||
var
|
var
|
||||||
FString: string;
|
FString: string;
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF LAZ_POWERPDF}
|
||||||
|
FString := '<' + _UTF8StrToUnicodeHex(s) + '>';
|
||||||
|
{$ELSE}
|
||||||
if _HasMultiByteString(s) then
|
if _HasMultiByteString(s) then
|
||||||
FString := '<' + _StrToHex(s) + '>'
|
FString := '<' + _StrToHex(s) + '>'
|
||||||
else
|
else
|
||||||
FString := '(' + _EscapeText(s) + ')';
|
FString := '(' + _EscapeText(s) + ')';
|
||||||
|
{$ENDIF}
|
||||||
WriteString(FString + ' Tj'#10);
|
WriteString(FString + ' Tj'#10);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -299,6 +299,7 @@ type
|
|||||||
function _GetCharCount(Text: string): integer;
|
function _GetCharCount(Text: string): integer;
|
||||||
|
|
||||||
{$IFDEF LAZ_POWERPDF}
|
{$IFDEF LAZ_POWERPDF}
|
||||||
|
function _UTF8StrToUnicodeHex(const Value:string): string;
|
||||||
procedure PdfLazRegisterClassAlias(aClass: TPersistentClass; Alias: string);
|
procedure PdfLazRegisterClassAlias(aClass: TPersistentClass; Alias: string);
|
||||||
function PdfLazFindClass(aClassName: string):TPersistentClass;
|
function PdfLazFindClass(aClassName: string):TPersistentClass;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -1143,6 +1144,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$IFDEF LAZ_POWERPDF}
|
{$IFDEF LAZ_POWERPDF}
|
||||||
|
|
||||||
|
function _UTF8StrToUnicodeHex(const Value: string): string;
|
||||||
|
var
|
||||||
|
W: Widestring;
|
||||||
|
i: Integer;
|
||||||
|
begin
|
||||||
|
result := '';
|
||||||
|
W := UTF8Decode(Value);
|
||||||
|
for i:=1 to Length(W) do begin
|
||||||
|
Result := Result + IntTohex(Word(W[i]), 4);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure PdfLazRegisterClassAlias(aClass: TPersistentClass; Alias: string);
|
procedure PdfLazRegisterClassAlias(aClass: TPersistentClass; Alias: string);
|
||||||
begin
|
begin
|
||||||
Classes.RegisterClass(aClass);
|
Classes.RegisterClass(aClass);
|
||||||
|
Reference in New Issue
Block a user