Contents of the DLFONT.DOC file
DLFONT is a simple C function that is called from Clipper to download a
standard HP Laserjet II/III font.
It was written for Clipper S87.
When called, it opens up a file (Here called "DLFONTS.BAT"), and
parses through it, downloading each font that it finds. The batch
file form requirements are spelled out a little later, but its form
is the same as that for the "download" program from Glyphix, and
also a couple of public domain font downloaders.
The code is written to just set the font as permanent, although a
couple of minutes and a HP book can change all that to temporary,
if you like.
If you're not a Clipper kind of person: The PASCAL declaration of the
function should be changed to "int", as the program returns a 0/1
indicating success or failure of the download. Just remove all the
_retl's, and change the return statement to return(0/1).
I use the standard token functions to parse the batch/data file. It
is therefore sensitive to the makeup of the lines. The best form is:
<---------Beginning of file----------->
<----------End of the File------------->
Where is the full fontname. Example: TR14BLD.SFP
and is the number of the font with which it is
to be accessed later. Example: 27
Note that the separator between and is not
discretionary. It must match one of the token separators in the
function itself. Just use a comma and it'll be fine.
I used the blocksize of 1024, because that seems to be about the
fastest that I could push the laserjets I write for and not cause a
critical error (LPTX not ready: A/R/I or a write failure).
If you've written your own print_error handler in Clipper, you may
want to explicitly write to the handle of lptx (4 = LPT1, I seem to
recall) and then have a shot at print error recovery via the Clipper
handler. I had no such success on a constant basis, so I gave up
and reduced the print write buffer size.
If you find use for this, great. If you know of a better way,
fantastic: But please let me know. I truly enjoy playing around with
laser printers and learning new/better techniques for control.
810 Ruxshire Drive
Arnold, MD 21012-1355
The Programmer's Corner BBS - (301) 596-1180