I am using the following code to print text. The problem is the the text comes out properly spaced and all, but with a miniscule font size. It's as if it thinks the printer is a screen and is printing screen pixel sizes. Here's the code (the loop in the middle is pseudo code; the details aren't important, I don't think):
Any ideas why the text is tiny?
Code:
void gzPrint()
{
DOCINFO di;
PRINTDLG pd;
bool bSuccess = true,
done = false;
WORD iColCopy, iNoColCopy;
// Invoke Print common dialog box
PrepSysBuf (&pd, sizeof (pd)); // zero struct and set size
pd.Flags = PD_NOPAGENUMS | PD_NOSELECTION | PD_COLLATE | PD_RETURNDC;
pd.nCopies = 1;
if (PrintDlg (&pd)) {
SelectObject (pd.hDC, GetStockFont (ANSI_FIXED_FONT));
// Start the document
PrepSysBuf (&di, sizeof (di));
di.lpszDocName = "FTGU Print Job";
if (StartDoc (pd.hDC, &di) > 0) {
// per collated copy:
for (iColCopy = 0; iColCopy < ((WORD) pd.Flags & PD_COLLATE ? pd.nCopies : 1); iColCopy++) {
// per Page:
for (done = false; !done; ) {
// per non-collated copy:
for (iNoColCopy = 0; iNoColCopy < (pd.Flags & PD_COLLATE ? 1 : pd.nCopies); iNoColCopy++) {
// Start the Size
if (StartPage (pd.hDC) < 0) {
bSuccess = false;
break;
}
// For each page/copy, print the data
while not eof {
(Get a line of text in pt, increment i by char ht)
TextOut (pd.hDC, 100, i, pt, (int) strlen (pt));
if (page full) break;
}
if eof done = true;
if (EndPage (pd.hDC) < 0) {
bSuccess = false;
break;
}
} // per non-collated copy
if (!bSuccess) break;
} // per page
if (!bSuccess) break;
} // per collated copy
} else {
bSuccess = false;
XBox0 (MB_OK, "StartDoc error: %s", GetLastErrorText());
}
if (bSuccess) EndDoc (pd.hDC);
DeleteDC (pd.hDC);
}
}
Any ideas why the text is tiny?