Use this file-level, record-level, or field-level keyword to specify the TrueType font name for printing a named or constant field within a record.
The format of the keyword is:
FONTNAME('font-name-string' | &font-name-field (*POINTSIZE height-value | &height-value-field width-value | &width-value-field) [(*ROTATION rotation-value | &rotation-value-field)] [(*CODEPAGE [library-name/ | &library-name-field/] code-page-name | &code-page-name-field)] [(*IGCCODEPAGE [library-name/ | &library-name-field/] IGC-code-page-name | &IGC-code-page-name-field)])
When a program-to-system field is described for a FONTNAME parameter, the program-to-system field is allowed only when the keyword is used at the record or field level.
The font-name parameter is required. It can be up to 125 characters long.
You can specify the font-name as a constant string or as a program-to-system field, as shown in the following examples:
When you specify the font-name as a program-to-system field, the field must exist in the same record format as the FONTNAME keyword. It must be defined as data type A (character), usage P (program-to-system), and its length must not exceed 125 characters.
Use the point-size parameter to further define a TrueType font, which requires a point size. Specify the point-size parameter as an expression of the 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 (height and width the same), then you only need to specify the height value. If you want to specify a width value, then you must also specify the height value. The valid values for the height and width parameters are 0.1 through 999.9.
If you omit the point-size parameter, unpredictable results will occur when the file is printed.
You can specify the height-value and width-value as constants, as program-to-system fields, or as a combination of both, as shown in the following examples:
When you specify the height-value or width-value as a program-to-system field, the fields must exist in the same record format as the FONTNAME keyword. They must be defined as length 4 with 1 decimal position, data type S (zoned decimal), and usage P (program-to-system).
Use the optional rotation parameter to specify the clockwise rotation, in degrees, for the printed characters. Specify the rotation parameter as an expression of the form
[(*ROTATION rotation-value | &rotation-value-field)]
Valid values are integers 0, 90, 180, and 270. To achieve vertical printing of a field, specify a rotation value of 270 and also specify the field-level TXTRTT keyword.
You can specify the rotation value as a constant or as a program-to-system field, as shown in the following examples:
When you specify the rotation value as a program-to-system field, the field must exist in the same record format as the FONTNAME keyword. It must be defined as length 3, data type S (zoned decimal), and usage P (program-to-system).
Use the optional code-page-name parameter to print single-byte EBCDIC data with a TrueType font. If you do not specify either the optional code-page-name parameter or the optional igccode-page-name parameter, the print data must be Unicode-encoded. The code-page-name parameter can be up to 8 characters in length. The single-byte code page must be a font resource (*FNTRSC) object with the code page (CDEPAG) attribute that reflects the encoding of the print data.
Use the optional library-name parameter to further qualify the code page. If library-name is not specified, *LIBL is used to search for the code page. If *LIBL is used, the system-supplied font libraries are added to the library list when searching for the requested code page.
The code page is validated at print time. An error message is issued if it is not valid.
You can specify the library name and code page name as constants or as program-to-system fields, as shown in the following examples:
When you specify the library name as a program-to-system field, the field must exist in the same record format as the FONTNAME keyword. It must be defined as length of 10, data type A (character), and usage P (program-to-system).
When you specify the code page name as a program-to-system field, the field must exist in the same record format as the FONTNAME keyword. It must be defined as length of 8, data type A (character), and usage P (program-to-system).
Use the optional igccode-page-name parameter to print double-byte EBCDIC data with a TrueType font. If you do not specify either the optional code-page-name parameter or the optional igccode-page-name parameter, the print data must be UCS-2 or UTF-16 encoded. The igccode-page-name parameter can be up to 8 characters in length. The double-byte code page must be a font resource (*FNTRSC) object with the code page (CDEPAG) attribute that reflects the encoding of the print data.
Use the optional library-name parameter to further qualify the double-byte code page. If library-name is not specified, *LIBL is used to search for the double-byte code page. If *LIBL is used, the system-supplied font libraries are added to the library list when searching for the requested double-byte code page.
The double-byte code page is validated at print time. An error message is issued if it is not valid. You can specify the library name and double-byte code page name as constants or as program-to-system fields, as shown in the following examples:
When you specify the library name as a program-to-system field, the field must exist in the same record format as the FONTNAME keyword. It must be defined as length of 10, data type A (character), and usage P (program-to-system).
When you specify the double-byte code page name as a program-to-system field, the field must exist in the same record format as the FONTNAME keyword. It must be defined as length of 8, data type A (character), and usage P (program-to- system).
Specify DEVTYPE(*AFPDS) on the CRTPRTF command when FONTNAME is specified in the file. If DEVTYPE is changed to anything other than *AFPDS, the keyword is ignored and a warning message is issued at print time.
FONTNAME with *CODEPAGE cannot be specified at the same level as the FONT, FNTCHRSET, or CDEFNT keyword, and it cannot be specified with the CCSID keyword.
FONTNAME with *IGCCODEPAGE cannot be specified at the same level as the IGCCDEFNT keyword and it cannot be specified with the CCSID keyword.
FONTNAME without *CODEPAGE or *IGCCODEPAGE cannot be specified at the same level as the FONT, FNTCHRSET, CDEFNT or IGCCDEFNT keyword.
FONTNAME without *CODEPAGE or *IGCCODEPAGE can only be specified with the CCSID keyword (with the *NOCONVERT parameter). Use this combination to print Unicode data, using a field with data type G. If FONTNAME without *CODEPAGE or *IGCCODEPAGE is specified at the file level or record level, it will be used to print the Unicode data, even if a FNTCHRSET keyword is used to specify an AFP™ Unicode migration font.
Option indicators are valid for this keyword.
The following example shows how to specify the FONTNAME keyword.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 A* A R REC1 FONTNAME('Monotype Sans Duospace WT' + A (*POINTSIZE 15.1) + A (*CODEPAGE USERLIB/CDP1)) A* A FLD1A 14G 3 8FONTNAME('Monotype Sans WT' + A (*POINTSIZE 10.0)) + A CCSID(13488 *NOCONVERT) A* A FLD2A 6A 4 8FONTNAME('Monotype Sans Duospace WT' + A (*POINTSIZE 99.9) + A (*CODEPAGE USERLIB/&DATA1)) A DATA1 8A P A* A FLD3A 10G 5 8FONTNAME('Times New Roman WT J' + A (*POINTSIZE 5.0 3.0) + A (*ROTATION 270) + A (*IGCCODEPAGE + A USERLIB/IGCCDP1)) A* A FLD4A 10O 7 8FONTNAME('Times New Roman WT J' + A (*POINTSIZE 7.0 5.0) + A (*ROTATION 270) + A (*CODEPAGE USERLIB/CDP2) + A (*IGCCODEPAGE + A USERLIB/IGCCDP2)) + A TXTRTT(90) A* A FLD5A 8A 8 8
FLD1A is printed using a TrueType font called Monotype Sans WT, with Unicode data, a CCSID of 13488, and a point size of 10.0.
FLD2A is printed using a TrueType font called Monotype Sans Duospace WT. It allows the application program to specify the code page name by setting the field &DATA1. The code page exists in library USERLIB. The point size is 99.9.
FLD3A is printed using a TrueType font called Times New Roman WT J, a double-byte code page IGCCDP1, which exists in library USERLIB, a vertical point size of 5.0 and a horizontal point size of 3.0. The individual characters is rotated 270 degrees in a clockwise direction.
FLD4A is printed using a TrueType font called Times New Roman WT J, code page CDP2, which exists in library USERLIB, double-byte code page IGCCDP2, which exists in library USERLIB, a vertical point size of 7.0 and a horizontal point size of 5.0. The individual characters is rotated 90 degrees in a clockwise direction. The text is also rotated 270 degrees, resulting in vertical printing.
FLD5A is printed using a TrueType font called Monotype Sans Duospace WT, code page CDP1, which exists in library USERLIB, and a point size of 15.1.