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>hpsetfont()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
hpSetFont()

Select the desired font


Syntax

hpSetFont([<cFont> [,<cCartridge> [, <cSymbolSet> [,<nPointSize>]]]])


Parameters

<cFont>
The name of the desired font to print with.  Font names
for <cFont> which are supported by Escape! can be
found in "Appendix A - Font Selection."  If <cFont> is
omitted, the font type will default to COURIER 10.  If
<cFont> is a soft font, the extension must be included.

<cCartridge>
The letter of the cartridge which contains the font
specified by <cCartridge>.  For example, 'M' or 'S1'.
Cartridge names for <cCartridge> which are supported
by Escape! can be found in "Appendix A - Font
Selection."  If using an internal font, specify 'I' for
"internal".  If a soft font is being used, specify a null
string "", or even better, "SF" for readibility..  If omitted,
<cCartridge> will default to 'I'.
Note: When specifying <cCartridge>, you are actually
specifying to Escape! which .FNT file to load to find the
necessary font information. Do not include the .FNT
extension.

<cSymbolSet>
The name of the requested symbol set.  Symbol Set
names for <cSymbolSet> which are supported by
Escape! can be found in "Appendix A - Font Selection."
<cSymbolSet> may be omitted by specifying a null
character.

<nPointSize>
The point size of the requested font.  This parameter is
only required for scalable fonts which are supported by
the HP LaserJet series III, IIIP, IIID, and the IIISI.


Returns

0
Successful.

-1
Orientation of soft font and the page orientation don't match.

-2
Escape! .FNT file not found.


-3
Error reading Escape! .FNT file.

-5
Soft font not found.

-6
Soft font open error.

-7
Couldn't read soft font format.

-8
Invalid # of lines per inch. Function was still executed.

-12
Wrong number of parameters passed.

-17
Invalid parameter type was passed.

-18
Font not found in symbol table.

-21
Old Escape! .FNT file is being accessed.


Remarks

Any internal, HP cartridge font, or soft font can be selected.  Fonts can
also be selected by symbol set.

hpSetFont() (as well as hpConfig()) must be called at the beginning of
your printing applications any time one of the other Escape! library
functions is used. Besides selecting the desired font, hpSetFont() also
initializes variables which are critical in order for the other Escape!
library functions to perform properly.

Use hpSetFont() in the beginning of your printout to establish the font
that your text will be printed in.  Then use hpSetFont() any time after that
to switch to another font.  Also, hpSetFont() can be used to select
particular symbol sets.  This is very useful when printing with special
character sets, such as international or math sets.

Note:  When selecting soft fonts, it is important to include the extension
when specifying the soft font file name.  The period (".") tells Escape!
that a soft font is being requested.  It will then search the hard drive for
the specified soft font, and read in the appropriate information needed
for printing.


Support By

All HP Laserjet Printers


Example

hpPrintOn()
hpConfig()
hpSetFont('HELV 10','Z')
.
.     // Report printed with Helvetica 10 point
.     // from the 'Z' cartridge.

hpSetFont('TMSRMN 10','Z')
.
.     // Now switch to Times Roman 10 point
.

hpReset()
hpPrintOff()

To select a soft font specify the name of the soft font file name including
the extension.  Be sure that the font has previously been downloaded
with hpDownload().
hpSetFont('HUMANIST.SFP', 'SF')

To select a symbol set, for instance, the Math 8 font from the J
cartridge, simple specify the symbol set.
hpSetFont('PELITE 12','J', 'MATH 8')

To select a scalable font, the point size must be specified.  For
example, to select the 24 point scalable UNIVERS font which resides
internally in all HP series III printers, specify the following:
hpSetFont('UNIVERS', 'I', , 24)

See Also: hpConfig()

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