🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1121

Printers in text mode

#1121
From: Alan Phillips
Date: Wed, 23 Jan 1991 10:29
25 lines
1892 bytes
I'm building an application that will print program listings with configurable
tab sizes, line numbering etc (it will be PD when done). It's working
well if I simply get a printer device context and TextOut the text, but
GDI runs the printer in graphics mode, so it's terribly _slow_ and the
spool files are ginormous.

What I think I ought to be able to do (it's hinted at in Petzold and in the
SDK Programming Guide) is to select a font that the driver knows is built in
to the device, and so output in text mode. The books imply that in this case
GDI writes simple text to the printer. I guess I need to EnumFonts and
look for the DEVICE_FONT(?) flag to choose a suitable one.

If I select DEFAULTDEVICE_FONT into the printer DC (this is working to
a DeskJet 500, by the way, using the new HP DJ500 scalable font driver) the
stuff prints in what appears to be the inbuilt Courier font. But the spool
file is still huge; and if I print to file instead I get a file containing
a few hundred null bytes, lots of (mostly repeated) escape sequences, and
nothing resembling the text I've printed. Copying _that_ to the printer
from DOS results in the page loading, but nothing else.

Can anyone give me some simple steps to get where I need to go? Am I asking
the impossible anyway?

Alan Phillips
Lancaster University Computer Centre, UK
Technical Details
Message-ID: <1167@dcl-vitus.comp.lancs.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!samsung!rex!ukma!seismo!uunet!mcsun!ukc!dcl-cs!alan
References: <23614@rouge.usl.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!samsung!rex!ukma!seismo!uunet!mcsun!ukc!dcl-cs!alan
From: alan@comp.lancs.ac.uk (Alan Phillips)
Newsgroups: comp.windows.ms.programmer
Subject: Printers in text mode
Message-ID: <1167@dcl-vitus.comp.lancs.ac.uk>
Date: 23 Jan 91 10:29:32 GMT
References: <23614@rouge.usl.edu>
Reply-To: alan@comp.lancs.ac.uk (Alan Phillips)
Organization: Department of Computing at Lancaster University, UK.
Lines: 25