我用
Printer.BeginDoc;
Printer.Canvas.Font := Self.Font;
Printer.Canvas.Font.Name := 'Verdana';
Printer.Canvas.Font.Size := 10;
Printer.Canvas.TextOut(10,0,'Nom : Prenom Nom');
Printer.Canvas.TextOut(10,100,'Nom2 : Prenom2 Nom2');
Printer.EndDoc;
现在我想做一些预览,所以决定制作一个预览表格。 但是,我必须将字体大小设置得更大。
Form2.Canvas.Font := Self.Font;
Form2.Canvas.Font.Name := 'Verdana';
Form2.Canvas.Font.Size := 25; //<=======Have to set this a lot higher to resemble what is on the print.
Form2.Canvas.TextOut(10,0,'Nom : Prenom Nom');
Form2.Canvas.TextOut(10,100,'Nom2 : Prenom2 Nom2');
为什么print.canvas和form.canvas上的字体大小不一样?