Q

Printing with different fonts and different CPIs

There is a requirement for the printing of three titles in three different fonts and different CPI in an external printer file. What are the different fonts available, and how can I associate specific fonts to the fields?
First, you MUST read the information on the DDS Printer file keywords FONT and CHRSIZ in the DDS Reference manual.

You can see that you can use different fonts for the same field in a printer file by specifying one font at the record level and another at the field level, conditioned by indicators. If neither font is activated (i.e. its conditioning indicators prevent them), the font specified in the CRTPRTF command is used -- so you can have three fonts for the same field, if you want. But you can't specify the FONT keyword more than once at field or record level.

You can change the point size of scaleable fonts using FONT(nnnn (*POINTSIZE(zz)), where nnnn is the font number of a scaleable font supported by your printer and zz is the point size. Or you can use the CHRSIZ keyword to scale most fonts.

From V5R2, you can use program-to-system fields as parameters for the FONT and POINTSIZE keywords. This allows your program greater control.

The CHRSIZ keyword works for printer files where the DEVTYPE is *IPDS or *AFPDS; the actual printer must be an IPDS device.

Now, there are so many variables involved in fonts that it is almost impossible to predict the spacing and effects you will get when you start mixing them together. You can only start with a guess, and refine the start positions and line spacing until you get what you want. So be prepared to recompile your PRTF over and over again, and print full-field test data in all fields to see what they will look like.

As to the available fonts, this depends so much on the actual hardware involved - i.e., which printer. You can get a list of the fonts in the system from the CL Reference manual appendix B, but not all of these fonts are scaleable, and not all are supported on all printers. Again, it's a matter of testing, unless you have access to all the relevant manuals and lots of time to read them.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Visit the ITKnowledge Exchange and get answers to your developing questions fast.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

This was first published in November 2004

Dig deeper on iSeries COBOL programming

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchEnterpriseLinux

SearchDataCenter

Close