Re:Printer doesn't print correct fonts
Hi,
(Sorry if this message appears 2 times in this newsgroup.
My ISP's newsserver is having some probs).
I'm trying to print some text using the Printer() collection.
But whatever I do, the font doesn't seem to be right on paper
The size of the font is very small and I can't seem to get it bigger.
Here's some code :
// Create pointer for the Printer Canvas
TCanvas *pDC = Printer()->Canvas;
// MapMode Twips is necessary for correct position-
// calculation of other stuff in my print-routine
SetMapMode(Printer()->Handle, MM_TWIPS);
int Kleur = 256; // Color is red
string Naam = "Arial";
int Grootte = 12 * 15; // The '* 15' part is necessary pixels to twips
conversion
// Calculation of the RECT goes here
RECT puntjes;
puntjes.left = 1500
puntjes.top = -195; // MapMode TWIPS is y-negative
puntjes.right= 4380;
puntjes.bottom = -525; // MapMode TWIPS is y-negative
// Some text to print
string Tekst = "This is an test";
// Setting up the font for the printer
pDC->Font->Color = Kleur;
pDC->Font->Name = Naam;
pDC->Font->Size = Grootte;
// Send the text to the printer
DrawText(Printer()->Handle, Tekst.c_str(),Tekst.length(),&puntjes,DT_CENTER
|| DT_VCENTER || DT_NOCLIP || DT_SINGLELINE);
Whenever my program executes these instructions, I get a very small font.
Does anybody know why this is happening ?
Even when I use the pDC->TextOut() I get a very small font.
Please help me with this problem.
Thanks in advance,
Erik van Pienbroek
Zapped Productions