mORMot and Open Source friends
Check-in [d5ddda8451]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fix unitary testing when compiled with a not Win-1252 system code page
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d5ddda8451e613de085f760a4b87645e4f794e86
User & Date: ab 2011-06-07 13:00:05
Context
2011-06-07
16:39
  • try to make logging work with Delphi 5 - not yet
  • avoid testing StandardFontsReplace if not running with ANSI code page
check-in: 0425cea128 user: ab tags: trunk
13:00
fix unitary testing when compiled with a not Win-1252 system code page check-in: d5ddda8451 user: ab tags: trunk
12:51
try to avoid any charset issue from source code check-in: 70f6d8dd91 user: ab tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to SynSelfTests.pas.

622
623
624
625
626
627
628

629
630
631
632
633
634
635
...
641
642
643
644
645
646
647
648


649
650
651
652
653
654
655
const
  Date = 40339.803675; // forced date to have the exact same PDF content (Hash32)

procedure TTestSynopsePDF._TPdfDocument;
var MS: THeapMemoryStream;
    i,y: integer;
    embed: boolean;

const
  Hash: array[boolean] of Cardinal =
    ($1780F68C,$A1201D84);
  Name: array[boolean] of PDFString =
    ('Arial','Helvetica');
begin
  MS := THeapMemoryStream.Create;
................................................................................
      StandardFontsReplace := embed;
      AddPage;
      Canvas.SetFont('arial',10,[]);
      Check(Canvas.Page.Font.Name=Name[embed]);
      y := 800;
      for i := 1 to 30 do begin
        Canvas.SetFont('Arial',9+i,[]);
        Canvas.TextOut(100,y,WinAnsiString('Texte accentu'+chr(233)+' n�'+IntToString(i)));


        dec(y,9+i);
      end;
      SaveToStream(MS,Date);
      // MS.SaveToFile(ChangeFileExt(paramstr(0),'.pdf'));
      Check(Hash32(MS.Memory,MS.Position)=Hash[embed]);
      if not embed then begin
        NewDoc;






>







 







|
>
>







622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
...
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
const
  Date = 40339.803675; // forced date to have the exact same PDF content (Hash32)

procedure TTestSynopsePDF._TPdfDocument;
var MS: THeapMemoryStream;
    i,y: integer;
    embed: boolean;
    WS: WideString;
const
  Hash: array[boolean] of Cardinal =
    ($1780F68C,$A1201D84);
  Name: array[boolean] of PDFString =
    ('Arial','Helvetica');
begin
  MS := THeapMemoryStream.Create;
................................................................................
      StandardFontsReplace := embed;
      AddPage;
      Canvas.SetFont('arial',10,[]);
      Check(Canvas.Page.Font.Name=Name[embed]);
      y := 800;
      for i := 1 to 30 do begin
        Canvas.SetFont('Arial',9+i,[]);
        WS := 'Texte accentue n�'+IntToString(i);
        PWordArray(WS)^[13] := 233;
        Canvas.TextOutW(100,y,pointer(WS));
        dec(y,9+i);
      end;
      SaveToStream(MS,Date);
      // MS.SaveToFile(ChangeFileExt(paramstr(0),'.pdf'));
      Check(Hash32(MS.Memory,MS.Position)=Hash[embed]);
      if not embed then begin
        NewDoc;