FONT (Font) keyword in printer files

You use this record-level or field-level keyword to specify the font ID for printing named or constant fields within a record.

The format of the keyword is:

FONT(font-identifier | &font-identifier-field
    [(*POINTSIZE height-value | &height-value-field
    width-value | &width-value-field)])

The font-identifier is a required parameter and must be the first parameter following the keyword. Specify either a numeric font identifier or a graphic font name, or *VECTOR.

You can specify the font-identifier as a constant or program-to-system field as shown in the following examples:

  • font-identifier...
  • &field1...

When you specify the font-identifier as a program-to-system field, the field must exist in the same record format as the FONT keyword. It must be defined as length of 10, data type A (character), and usage P (program-to-system).

For scalable printer-resident fonts, you can use the optional point-size parameter to further define a numeric font that specifies a point size. Specify the point-size parameter as an expression of the following form:

(*POINTSIZE height-value width-value)

The height-value specifies the point size for the height of the font. The width-value specifies the point size for the width of the font. If the font is to be uniformly scaled (where the height and width are the same), then you can specify only the height-value. You cannot specify the width-value without the height-value. The valid values for this parameter are 0.1 through 999.9.

You can specify the point-size height and point-size width as constants, as program-to-system fields, or as a combination of both, as shown in the following examples:

  • [(*POINTSIZE height-value &field1)]
  • [(*POINTSIZE &field2 width-value)]

When you specify the point-size height-value or width-value as a program-to-system field, the fields must exist in the same record format as the FONT keyword. They must be defined as length 4 with 1 decimal position, data type S, and usage P (program-to-system).

For non-scalable printer-resident fonts, the point size parameter is ignored.

For DEVTYPE(*IPDS), the width parameter of the point size is ignored.

A warning message is issued at creation time if you specify the point-size parameter on the FONT keyword with a graphic font name, or *VECTOR. In that case, the point-size parameter is ignored.

If you do not specify this keyword, the font ID and point size are set by the font parameter on the CRTPRTF, CHGPRTF, or OVRPRTF command. If you specify this keyword at the record level, all fields in the record format use the same font ID and point size except those for which you specify the FONT keyword at the field level.

You can specify graphic fonts (alphanumeric characters) or hardware fonts (numeric font identifiers). For graphic fonts, use graphic symbol sets (GSS) available with the IBM® i operating system, GDDM, PGR, and BGU. Only vector symbols (where each character is built with a set of straight or curved lines) are supported. However, most of the vector symbol sets supplied by the operating system and GDDM are supported. Image symbols are not supported. In searching for the graphic symbol set, *LIBL is used for the qualified library name.

The name of a graphic font can consist of up to 10 alphanumeric characters.

The hardware font can consist of up to 10 digits and must be a registered font number. See the IBM Infoprint Fonts: Font SummaryLink to PDF book for a listing of font IDs.

You can specify *VECTOR on the FONT keyword to take advantage of vector fonts on the 4234 IPDS printer. Vector fonts print expanded characters faster than they can be printed using the PRTQLTY(*DRAFT) keyword. Use the CHRSIZ keyword to specify expanded characters.

Note: When you specify FONT(*VECTOR) with the CHRSIZ keyword, the 4234 printer uses a default code page.
Vector fonts are valid only for the following characters:
  • A through Z
  • 0 through 9
  • Special characters (. + $ * - / % and a blank)

If the data to be printed contains any characters other than these, all characters are printed using a default font on the printer.

FONT(*VECTOR) has no effect on characters that have not been expanded. If FONT(*VECTOR) is specified on a record or field for which CHRSIZ (1 1) applies or to which no CHRSIZ keyword applies, a warning message is issued.

Note: If you use FONT(*VECTOR) on a 4224 or 3812 printer, the printer uses a default font and code page.

The font name or number and the point size values are not checked during file creation. If the specified font-id and point size values are not valid, a diagnostic is issued while the record prints and the keyword are not used.

When FONT is specified at the field level, overlapping fields are not diagnosed.

When you use a graphics font on the CRTPRTF, CHGPRTF, or OVRPRTF command, the font ID has an implied page code associated with it. To get the code you want, you must use the proper font ID; the code page specified on the CHRID parameter is not used.

If you specify OCR-A font with the CHRID keyword, the fonts require code pages 892. If you specify OCR-B font with the CHRID keyword, the fonts require code pages 893.

A warning message is issued at creation time if a FONT DDS keyword is specified in a file created with DEVTYPE(*IPDS) and FONT(*DEVD). For SCS printer files, the FONT keyword is ignored when the record or field is printed. For IPDS printers, the FONT keyword can be changed at the record or field level.

When printing a file that uses the FONT keyword to an IPDS AFP(*YES) printer that does not support registered fonts, a font substitution is performed.

When you specify FONT(*CPI) with either the CRTPRTF, CHGPRTF, or OVRPRTF command to a device that uses font support, the host system selects a font with the pitch of the CPI for the current printer file.

FONT(graphic-font-name) and CHRID cannot apply to the same field. The CHRID keyword is ignored if:

  • You specify FONT(graphic-font-name) and CHRID on the same field.
  • You specify FONT(graphic-font-name) at the record level and a field in the record specifies CHRID but not a numeric FONT.

You cannot specify FONT at the same level as the CDEFNT and FNTCHRSET keywords.

You can specify this keyword only once for each record and once per field.

This keyword is valid for data types A, S, and F.

Option indicators are valid for this keyword.

Example

The following example shows how to specify the FONT keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD1
00020A  02 03                               FONT(222)
00030A            FLD1           6A    16 01
00040A  01                                  FONT(ADMMVSS)
00050A            FLD2           6S    20 01
00060A          R RECORD2
00070A  04                                  FONT(16951 (*POINTSIZE 10))
00080A            FLD3           6A    16 01
00090A  05                                  FONT(16951 (*POINTSIZE 12))
00100A            FLD4           6S    20 01FONT(4919)
00110A
00120A            FLD5          10A    30 01FONT(416 +
00130A  05                                  (*POINTSIZE 5.0 3.0))

FLD1 uses the multinational vector symbol set (FONT(ADMMVSS)) if indicator 01 is on, or Gothic 15 (FONT(222)) if indicator 01 is off and indicators 02 and 03 are on. Otherwise, the font specified on the CRTPRTF command is used.

FLD2 uses Gothic 15 if indicators 02 and 03 are on. Otherwise, the font specified on the CRTPRTF command is used.

FLD3 uses Century Schoolbook** with a point size of 12 (FONT(16951 (*POINTSIZE 12))) if indicator 05 is on, or Century Schoolbook with a point size of 10 if indicator 05 is off and indicator 04 is on. Otherwise, the font specified on the CRTPRTF command is used.

FLD4 uses Goudy old style (FONT(4919)).

FLD5 specifies font 416 with a vertical point size of 5.0 and a horizontal point size of 3.0.