要做个打印,怎么设置字体大小在打印阿
void CVoucheckPrintDlg::OnPrint()
{
char szprinter[80];
char *szDevice,*szDriver,*szOutput;
HDC hdcprint;//定义一个设备环境句柄
static DOCINFO di={sizeof(DOCINFO),"printer",NULL};
GetProfileString("windows","device",",,,",szprinter,80);//得到设备字符串
if(NULL!=(szDevice=strtok(szprinter,","))&&NULL!=(szDriver=strtok(NULL,","))&&NULL!=(szOutput=strtok(NULL,",")))
if((hdcprint=CreateDC(szDriver,szDevice,szOutput,NULL))!=0)//创建句柄
{
if(StartDoc(hdcprint,&di)>0)//开始打印
{
StartPage(hdcprint);
SaveDC(hdcprint);
TextOut(hdcprint,10,10,"打印",12);
RestoreDC(hdcprint,-1);
EndPage(hdcprint);
EndDoc(hdcprint);
}
DeleteDC(hdcprint);
}
else
{
MessageBox("没有默认打印机,或没有打印机");
}
}
这是照着敲得,请问怎么在打印前设置字体阿,令外就是打印完成后要释放什么啊?