Link to home
Start Free TrialLog in
Avatar of wsm
wsm

asked on

Setting Printer Font for Dot Matrix printers

I would like to know how I can set the printer fonts prior to printing via the Dot Matrix printer.
What happen is when I have changed the fonts to Courier New and print via my HP Laser printer, the
document will be printed with Courier New font. But when I sent the same document to the Dot Matrix printer, it will be printed with the Dot Matrix default font and not Courier New.

The printing is done the Printer object. Any idea why? I know it is not because the printer Dot Matrix does not support Courier New font since I have tested printing a document using WordPad and the comes out as Courier New fonts.
Avatar of mrmick
mrmick

Try this,

Printer.FontName = "Arial"
Printer.Print " "
Printer.FontName = "Courier New"
' Note - you may have to repeat this for each new page.  This code can also be left as is for the HP printer.
ASKER CERTIFIED SOLUTION
Avatar of mrmick
mrmick

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wsm

ASKER

What I had set it this

gFontName = "Courier New"
TextLine = "Testing printing to local printer."

Printer.FontName = gFontName
Printer.NewPage
Printer.Print
Printer.Print TextLine
Printer.EndDoc

This codes works for Laser Printer as I would be able to see the
text being printed as Courier New. BUT if I print via the Dot
Matrix printer, it will not give me the font Courier New. instead
it prints out the text using the default font. However, if I use
WordPad application to print out the document and setting the
font to Courier New, it will come out nicely as Courier New at
the Dot Matrix.
Avatar of wsm

ASKER

What I had set it this

gFontName = "Courier New"
TextLine = "Testing printing to local printer."

Printer.FontName = gFontName
Printer.NewPage
Printer.Print
Printer.Print TextLine
Printer.EndDoc

This codes works for Laser Printer as I would be able to see the
text being printed as Courier New. BUT if I print via the Dot
Matrix printer, it will not give me the font Courier New. instead
it prints out the text using the default font. However, if I use
WordPad application to print out the document and setting the
font to Courier New, it will come out nicely as Courier New at
the Dot Matrix. Any reason why VB 4.0 (32-bit) is having this
problem with setting font before printing to Dot Matrix printer?
Yes, it's a bug.  Try what I suggested.

Printer.FontName = "Arial"
Printer.Print " "
Printer.FontName = "Courier New"
Printer.Print "This text should be in a Courier New font for both printers."