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 |
PrintDefineFont ( printjobnumber, fontnumber, facename, height, weight, fontpitch, fontfamily, italic, underline ) |
|
Argument |
Description |
|---|---|
|
printjobnumber |
The number the PrintOpen function assigned to the print |
|
fontnumber |
The number (1 to 8) you want to assign to the font. |
|
facename |
A string whose value is the name of a typeface supported |
|
height |
An integer whose value is the height of the type in |
|
weight |
The stroke weight of the type. Normal weight is 400 and |
|
fontpitch |
A value of the FontPitch enumerated datatype indicating Default! Fixed! Variable! |
|
fontfamily |
A value of the FontFamily enumerated datatype indicating AnyFont! Decorative! Modern! Roman! Script! Swiss! |
|
italic |
A boolean value indicating whether the font is italic. The |
|
underline |
A boolean value indicating whether the font is underlined. |
Return value
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.
Fonts in Microsoft Windows
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.
Font names and sizes
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 2 3 4 |
long Job Job = PrintOpen() PrintDefineFont(Job, 1, "Courier 10Cpi", & -18, 400, Default!, Decorative!, FALSE, FALSE) |
See also