Example: Specify 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 2. Document with several fonts
This document shows several different fonts being used. The fonts are different sizes, styles, rotations, and colors. They also illustrate the use of different code pages to make different characters appear.

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 3. 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:
  1. The TXTRTT keyword only works with fields, not constants.
  2. The print data for lines 1 through 10 is constant text and was specified in the DDS source.
  3. The print data for lines 11 and 12 is a data field that contains the printed text.
Related concepts

DDS keyword finder