Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Escape! V3.0 - <b>hpdownload()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
hpDownload()

Downloads a soft font to printer as a permanent font


Syntax

hpDownload(<cFilename> [,<nId> [,<cDestination> [,<cEffect> ;
  [,<nWidth> [,<cCharacters>]]]]])


Parameters

<cFilename>
The filename of the desired soft font. When specifying
<cFilename>, the extension must also be included.  No
path can be included as part of the filename (see Note
below).

<nId>
The font id number you are assigning to the downloaded
font.  If <nId> is omitted, <nId> will default to 1.

<cDestination>
The destination the font is to be downloaded to.
<cDestination> can be a printer port such as lpt1, or a
file name such as font.dwn.  If omitted, <cDestination>
will default to 'PRN'.

<cEffect>
NOTE: The special effects of hpDownload() have been disabled in
Escape! v3.0b due to unresolved memory problems.  An update will be posted
on the Pinnacle BBS as soon as possible. Had the special effect been
working, you would have wanted to know the following information...

<cEffect> is the special effect to apply to the soft font.
hpDownload() can automatically download your
standard font as an outlined, shadowed, or reversed
font.  The following are valid values for <cEffect>:
"O"     Outlined font
"S"     Shadowed font
"R"     Reversed font

<nWidth>
Can mean one of two things depending on the special
effect <cEffect>.  If <cEffect> is 'O', then <nWidth>
specifies the width of the outline when downloading an
outlined font.  The width is specified in dots.  There are
300 dots per inch.  If <cEffect> is 'S', then <nWidth>
specifies the width of the shadow.  This width is also
specified in dots. Defaults to 7.

<cCharacters>
The characters you want downloaded to the printer.  If
<cCharacters> is passed, only those characters
specified by <cCharacters> is downloaded, rather than
the entire font file.  This is extremely useful to speed up
downloads and to reduce memory requirements of your
printer.


Returns

0
Successful.

-5
Soft font file could not be found.

-6
Soft font could not be opened.

-7
Soft font incompatible with Escape!.

-12
Wrong number of parameters passed.

-17
Incorrect parameter type was passed.

-31
Memory allocation error.

-32
Error opening output file.

-33
Error writing to output file.

-99
Internal error, contact technical support.


Remarks

hpDownload() can turn any softfont into a reversed, outlined or
shadowed soft font.  Partial downloads of only the characters desired
can also be performed to reduce printer memory requirements.

hpDownload() is used to download a soft font to the printer's memory,
so that it can be properly selected using hpSetFont().  Also, with the
special effects capabilities, the usefulness of your fonts can be greatly
increased.

Note:  Escape! must be able to find the soft font you are attempting to
download.  This means that it must either be in the current directory, or
in one of the directories specified in the environment variable EPATH.
See "Installing Escape!" in the chapter "Getting Started" for more
details.


Support By

All HP Laser Printers except the original HP Laserjet


Example

To perform a standard download you would perform the following:

hpPrintOn()
hpConfig()
hpDownload('TR10R8US.SFP')
hpSetFont('TR10R8US.SFP', 'SF'))
.
.  // print routine
.
hpReset()
hpClrFonts()
hpPrintOff()

To download a font as an outlined font with a 3 dot wide outline:

hpPrintOn()
hpConfig()
hpDownload('HELV24US.SFP', 1, 'LPT1', 'O', 3)
hpSetFont('HELV24US.SFP', 'SF'))
.
.  // print routine
.
hpReset()
hpClrFonts()
hpPrintOff()

Now, suppose you want to create an invoice which has the word
"INVOICE" printed at the top of the page in a reversed font.  If no other
text besides this is to be printed in reverse, then it would make sense
to only download the letters I,N,V,O,I,C and E:

hpPrintOn()
hpConfig()
hpDownload('HELV18US.SFP', 1, 'LPT1, 'R',,'INVOICE ')
hpSetFont('HELV18US.SFP', 'SF'))
.
.
.
hpCenter(' INVOICE ', 1, 4, 'I')
.
.
.
hpReset()
hpClrFonts()
hpPrintOff()

See Also: hpSetFont() hpClrFonts()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson