IBM Support

Using OCR A and OCR B Fonts For ASCII Printers

Troubleshooting


Problem

This document discusses using the OCR A and OCR B font when printing to ASCII printers.

Resolving The Problem

Using OCR A and OCR B Fonts For ASCII Printers

The method used to print the OCR A and OCR B fonts to ASCII printers depends upon the capabilities of the printer and whether the printer has the fonts installed in it or not. To determine if the fonts are installed, print out the font list from the printer and look in the Font Name or Typeface field to see if it is listed. Usually, these fonts are not installed in the printer and must be downloaded to the printer from the IBM® OS/400® or IBM® i5/OS®. If the font is installed on the printer, note the escape sequence or data string value for the font for use in the next section of this document. If the font is not installed in the printer, and it is not downloaded to the printer, then font substitution is performed. The font identifier for OCR A is 19 and for OCR B is 3. These are usually mapped to a Courier font.

If the Printer Has the Font Installed

To use the font that is resident on the printer, a Workstation Customization Object (WSCST) is needed. This WSCST maps the font identifier used in the spooled file to the escape sequence or data string value for the font on the printer. The parameter in the WSCST that maps these values is the :INDFNTE tag. Generally, the font identifier (FGID) used for the OCR A font is FGID 19 and for the OCR B font is FGID 3, but different numbers can also be used.

Refer to the following Rochester Support Center knowledgebase documents for creating the WSCST object:

N1010140: Instructions for Modifying a Workstation Customizing Object (WSCST)
N1010138: Breakdown of HP PCL5 Font Strings
N1010124: Creating a Specific Font (INDFNTE Tag)

Refer to the following Rochester Support Center knowledgebase documents for using the WSCST object:

N1010288: Using Host Print Transform (HPT) with a *LAN Device Description
N1019713: Using Host Print Transform (HPT) with a Remote Output Queue (RMTOUTQ)
N1019712: Using Host Print Transform (HPT) with a *LCL or *RMT Device Description
N1019470: Using Host Print Transform (HPT) with a PC5250 Printer Session
N1019670: Using Host Print Transform (HPT) with a Third Party Emulation Package

The Font Identifier (FGID) that was set up for the font in the WSCST needs to be sent in the datastream for the spooled file. This can be done in the printer file by using the Change Printer File (CHGPRTF) command or by using the Override Printer File (OVRPRTF) command. It could also be specified in an application or CL program, or by using the DDS keyword FONT. The method that you choose might have different requirements for the type of datastream used (for example, *SCS or *AFPDS).

If the Printer Does Not Have the Font Installed

If the font is not installed on the printer, it will need to be downloaded from the OS/400 or i5/OS to the printer. The printer must be capable of accepting downloaded fonts. These fonts are provided free of charge with the system as part of the IBM AFP Compatibility Fonts (OS/400 or i5/OS Product Option 8), but they must be installed first. The fonts will be placed in the QFNTCPL library.

Note: These fonts only include uppercase letters and numbers. Lowercase letters can be obtained by purchasing the AFP Font Collection (5648-B45) and then installing it on the OS/400 or i5/OS.

The spooled file needs to have a Printer Device Type of *AFPDS. The font can be specified in the printer file, by an application or CL program, or by using one of the DDS keywords. The printer file can be changed by using the Change Printer File (CHGPRTF) command or overridden by an application or CL program or by the Override Printer File (OVRPRTF) command. The parameter in the printer file to specify the font is Coded Font. By specifying the font in the printer file, it will use the font for the entire spooled file.

If only certain fields are intended to use the OCR A or OCR B fonts, then use the DDS keyword CDEFNT to specify the font. Another DDS keyword that can also be used is FNTCHRSET. When using this keyword, both the font character set and code page need to be specified. The font character set names will start with a C, and the code pages start with a T. The DDS keyword CDEFNT is usually preferred because the coded font name specifies both the font character set and the code page, so it is a little easier to use.

The coded font names for OCR A are X0AOD, X0AOA and X0AON. The coded font names for OCR B are X0BOA and X0BON. (The letter X followed by the number zero, then the letter A or B followed by the letter O, followed by letter D or A or N.) The font characters sets for OCR A are: C0L00aoa, and C0L00aon, and C0ocra10. The font character sets for OCR B are: C0L00boa, C0L00bon, C0L00oab, and C0ocra10. An example that uses the coded font DDS keyword for an OCR A font is: CDEFNT(QFNTCPL/X0AOA).

The printer needs to be configured with Host Print Transform set to *yes with the appropriate manufacturer type and model for the printer. If the output is not printing correctly, a Workstation Customization Object (WSCST) to turn on the raster mode may be necessary. Since the font will be rasterized, make sure that the pel density of the font object specified matches the pel density of the printer.

The Display Font Resource Attr (DSPFNTRSCA) command, or Option 5 (Display attributes) from the Work with Font Resources (WRKFNTRSC) command, will show the pel density of a font character set (FNTCHRSET). There is no pel density associated with a code page (CDEPAG). To find the pel density for a coded font (CDEFNT), first look at the text description for that coded font to see which font character set is associated with that coded font, then display the attributes of that font character set to see the pel density. Note that outline, or scalable, font character sets will have "OUTLINE" listed for the pel density.

Note: This option will not print as fast as if the font were resident on the printer.

For additional information, refer to the following Rochester Support Center knowledgebase documents and see also the documents in the previous section for modifying a WSCST and using HPT:

N1010127: Raster Imaging for Host Print Transform (HPT)
N1019670: Using Host Print Transform (HPT) with a Third Party Emulation Package

    • - Using OCR Fonts with Transform Services



      Transform Services is a license-free product that can be used to generate Adobe Acrobat PDF format on an IBM i or i5/OS system.

      First available in 6.1 i5/OS, the Transform Services product (5761TS1) can be used to directly generate PDF as streams files in the Integrated File System (IFS). For more information on Transform Services, refer to the following document:

      N1018568: Using Transform Services to Generate PDF Stream Files instead of Spooled Files

      6.1 Transform Services (product 5761TS1) does not have the ability to embed fonts, and therefore is limited describing the characteristics of a typeface. It is therefore limited to the 14 Standard Type 1 fonts:

      oTimes Roman
      oTimes Bold
      oTimes Italic
      oTimes Bold/Italic
      oHelvetica
      oHelvetica Bold
      oHelvetica Oblique
      oHelvetica Bold/Oblique
      oCourier
      oCourier Bold
      oCourier Oblique
      oCourier BoldOblique
      oSymbol
      oZapfDingbats

      The Adobe Standard Type 1 fonts do not include the OCR A and OCR B fonts, and 6.1 Transform Services can only map to the Standard Type 1 fonts, so PDF files created using 6.1 Transform Services cannot include OCR fonts.

      7.1 Transform Services (product 5770TS1) added the ability to embed fonts, including host-resident font character sets and coded fonts. This provides better font support, including support for reverse image fonts, but can increase the size of the resulting PDF file since each referenced font must be embedded in the PDF file itself.

      7.1 Transform Services does have built-in support for generating PDF stream files with embedded OCR fonts by using the Font (FONT) DDS keyword, for example FONT(19) for OCR A or FONT(3) for OCR B, but only if the printer file is created with the Character identifier (CHRID) parameter set to CHRID(968 892).

      7.1 Transform Services can also use an OCR A or OCR B font that is installed on the IBM i system without specifying CHRID(968 892) on the printer file, just as Host Print Transform (HPT) can do when printing on an ASCII laser printer that does not have printer-resident or "built-in" OCR font. For example, if the AFP Compatibility Fonts (product 57xxSS1 Option 8) are installed, then you can use the Coded Font (CDEFNT) DDS keyword with the QFNTCPL/X0AOD, QFNTCPL/X0AOA or QFNTCPL/X0AON coded fonts for OCR A, or the QFNTCPLF/X0BOA or QFNTCPL/X0BON coded fonts for OCR B.


      [{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"6.1.0"}]

      Historical Number

      24540950

      Document Information

      Modified date:
      18 December 2019

      UID

      nas8N1019437