PrintDefineFont PowerScript function
Description
Creates a numbered font definition that consists of a font
supported by your printer and a set of font properties. You can
use the font number in the PrintSetFont or PrintText functions.
You can define up to eight fonts at a time.
Syntax
1 |
<span>PrintDefineFont</span> ( <span>printjobnumber</span>, <span>fontnumber</span>, <span>facename</span>, <span>height</span>, <span>weight</span>,<br>   <span>fontpitch</span>, <span>fontfamily</span>, <span>italic</span>, <span>underline</span> ) |
Argument |
Description |
---|---|
printjobnumber |
The number the PrintOpen function |
fontnumber |
The number (1 to 8) you want to assign |
facename |
A string whose value is the name of a |
height |
An integer whose value is the height |
weight |
The stroke weight of the type. Normal |
fontpitch |
A value of the FontPitch enumerated datatype
|
fontfamily |
A value of the FontFamily enumerated
|
italic |
A boolean value indicating whether the |
underline |
A boolean value indicating whether the |
Return Values
Integer. Returns 1 if it succeeds and
-1 if an error occurs. If any argument’s value is null, PrintDefineFont returns null.
Usage
You can use as many as eight fonts in one print job. If you
require more than eight fonts in one job, you can call PrintDefineFont again
to change the settings for a font number.
Use PrintSetFont to
make a font number the current font for the open print job.

Although the fontfamily argument seems
to duplicate information in the font name, Windows uses it along
with the font name to identify the correct font or substitute a
similar font if the named font is unavailable.

Some font names include a size, especially monospaced fonts
which include characters per inch. This is the recommended size
for the font and does not affect the printed size, which you specify
with the height argument.
Examples
These statements define a new blank page, and then
define print font 1 for Job as Courier 10Cpi,
18 point, normal weight, default pitch, Decorative font, with no
italic or underline:
1 |
long Job |
1 |
Job = PrintOpen() |
1 |
<span>PrintDefineFont</span>(Job, 1, "Courier 10Cpi", & |
1 |
   -18, 400, Default!, Decorative!, FALSE, FALSE) |