PrintSetFont

Description

Designates a font to be used for text printed with the Print function. You specify the font by number. Use PrintDefineFont to associate a font number with the desired font, a size, and a set of properties.

Syntax

PrintSetFont ( printjobnumber, fontnumber )

Argument

Description

printjobnumber

The number the PrintOpen function assigned to the print job

fontnumber

The number (1 to 8) of a font defined for the job in PrintDefineFont or 0 (the default font for the printer)

Returns

Integer. Returns the character height of the current font if it succeeds and -1 if an error occurs. If any argument’s value is null, PrintSetFont returns null.

Examples

Example 1

This example starts a new print job and specifies that font number 2 is Courier, 18 point, bold, default pitch, in modern font, with no italic or underline. The PrintSetFont statement sets the current font to font 2. Then the Print statement prints the company name:

long Job


// Start a new print job and a new page.

Job = PrintOpen()


// Define the font for Job.

PrintDefineFont(Job, 2, "Courier 10Cps", &

   250, 700, Default!, Modern!, FALSE, FALSE)


// Set the font for Job.

PrintSetFont(Job, 2)


// Print the company name in the specified font.

Print(Job,"Sybase Corporation")

See also