#1 2021-11-10 11:24:01

txgha
Member
Registered: 2021-11-10
Posts: 2

The spacing of some Chinese fonts is incorrectly displayed

var
  lPdf: TPdfDocumentGDI;
  lPage: TPdfPage;
begin
  lPdf := TPdfDocumentGDI.Create;
  lPage := lPdf.AddPage;
  try
    lPdf.VCLCanvas.Font.Name := '黑体'; //Display incorrect
    //lPDF.VCLCanvas.Font.Name := '宋体';  //Display correct
    lPdf.VCLCanvas.Font.Size := 20;
    lPdf.VCLCanvas.TextOut(100, 100, '测试内容');
    lPdf.SaveToFile('C:\Syntest.pdf');
  finally
    lPdf.Free;
  end;
end;

Display incorrect

Display correct

Offline

#2 2021-11-10 14:48:28

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,661
Website

Re: The spacing of some Chinese fonts is incorrectly displayed

With which compiler?

Offline

#3 2021-11-11 01:14:53

txgha
Member
Registered: 2021-11-10
Posts: 2

Re: The spacing of some Chinese fonts is incorrectly displayed

RAD Studio 10.2,  mORMot 1.18.4952

Offline

Board footer

Powered by FluxBB