Example: Specifying a font
This example uses Data description specifications (DDS) keywords and RPG to specify TrueType and Advanced Function Presentation (AFP) fonts.
The document is followed by the DDS keywords used.
Figure 1. Document
with several fonts

The fonts in the example have been specified using these
DDS keywords. The line numbers below correspond to the numbering in
the sample document.
Figure 2. DDS
keywords used to create the sample document
Line 1: FONT(2305 (*POINTSIZE 18)) COLOR(RED)
Line 2: FONTNAME('Courier New' (*POINTSIZE 20)(*CODEPAGE T1V10037)) COLOR(GRN)
Line 3: FNTCHRSET(C0S0BRTR T1V10037) COLOR(BLU)
Line 4: FONT(2311 (*POINTSIZE 18)) COLOR(PNK)
Line 5: FNTCHRSET(C0N500H0 T1V10500) COLOR(*RGB 50 50 75)
Line 6: FNTCHRSET(CZN500 T1V10284 (*POINTSIZE 18)) COLOR(*RGB 75 20 40)
Line 7: CDEFNT(X0N51EHC) COLOR(*CMYK 0 50 50 0)
Line 8: FONT(2304 (*POINTSIZE 24 10)) COLOR(*CMYK 50 0 0 50)
Line 9: FNTCHRSET(CZH200 T1V10274 (*POINTSIZE 48 10)) COLOR(TRQ)
Line 10: FONT(19) COLOR(BRN)
Line 11: FONT(420 (*POINTSIZE 18 50)) COLOR(RED) TXTRTT(270)
Line 12: FONT(420 (*POINTSIZE 18 50)) COLOR(RED) TXTRTT(90)
Notes:
- To determine the names of the font character sets and coded fonts that are available on your system, use the WRKFNTRSC command.
- The TXTRTT keyword only works with fields, not constants.
- The print data for lines 1 through 10 is constant text and was specified in the DDS source.
- The print data for lines 11 and 12 is a data field that contains the printed text.
- By using the code examples, you agree to the terms of the Code license and disclaimer information.