请问canvas.textout输出打印时如何控制字距?(50)

W

willxue

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TFrmPrint.PrintRecord_ct;
//套打constPaperWidth=2760;
//页面长度PaperLength=1640;
//页面宽度var Device : array[0..cchDeviceName - 1] of Char;
Driver : array[0..(MAX_PATH - 1)] of Char;
Port : array[0..32]of Char;
hDMode : THandle;
pDMode : PDevMode;
begin
Printer.GetPrinter(Device,Driver,Port,hDMode);
if hDMode<>0 then
pDMode:=GLobalLock(hDMode);
if pDMode<>nil then
begin
pDMode^.dmPaperSize:=256;
// 将当前打印机纸张变为自定义 pDMode^.dmPaperLength:=PaperWidth;
pDMode^.dmPaperWidth:=PaperLength;
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERSIZE;
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERLENGTH;
pDMode^.dmFields:=pDMode^.dmFields or DM_PAPERWIDTH;
end;
ResetDC(Printer.Handle,pDMode^);
GLobalUnLock(hDMode);
//打印当前记录 With Printerdo
begin
Orientation:=poLandscape;
//横向打印 begin
Doc;
Canvas.Font.Name := '宋体';
Canvas.Font.Style := [fsBold];
Canvas.Font.Size := 18;
Canvas.TextOut(PosX(240),PosY(250),'100010');
//邮编 EndDoc;
end由于信封上的邮编空格很大,所以想扩大字距,请问用要设置什么属性?谢谢。
 
E

echococo

Unregistered / Unconfirmed
GUEST, unregistred user!
直接设置属性的方法好像没有,你可以直接采用单个字符的TextOut,根据PosX的值,就可以扩大字距
 
Top Bottom