IBM Support

Adding Pitch 12 Support to an IBM 4208 Printer

Question & Answer


Question

Adding Pitch 12 Support to an IBM 4208 Printer

Answer

In the AIX colon files, the IBM4208 is only supported at a pitch of 10 unless you have fonts to be downloaded in the font directory.

This document describes a way to add the support for a pitch 12 font and also describes how some of the attributes in the colon file interact.

The information in this document applies to AIX Versions 4.3 and later.

The problem
How to add the font name
How to add the font name: Steps to make the change
Examining the colon file
Summary

The problem

Only courier 10 is selectable from SMIT

From SMIT:
                 TYPESTYLE and PITCH          
   Move cursor to desired item and press Enter.
   courier  10   

Nothing prints

In this file created to print to a file, the file is empty

    echo "p2" | qprt -p12 -P4208jwt
    ls -l /dev/4208
    -rw-r--r--   1 root     system         0 Nov 08 09:31 /dev/4208
    

Message in /var/spool/lpd/pio/@local

    msg1.4208jwt:4208  
    -----------------------------------------------------------
    Fri Nov 08 09:36:23 1996 (root)
    -----------------------------------------------------------
    =====> MESSAGE FROM PRINT JOB 19 (STDIN.21944) <=====
    0782-598 The value 1 specified in the validate op V in the
    limits field for _p attribute indicates failure
    


How to add the font name

    The list of supported fonts is shown in the mU attribute.

    :416:mU::%`"{ print - 'courier[10]';
    /usr/bin/ls /usr/lib/lpd/pio/fonts/%Imt/*.*.* 2>/dev/null|
    /usr/bin/awk -F. '{printf(\\"%%s[%%s]\\n\\",$2,substr($3,1,2));}';
    }|sort -u|tr -d '\\012'"

    By default, this attribute allows the courier 10 pitch font and then looks for fonts in the /usr/lib/lpd/pio/fonts/ibm4208-2 directory. Based on the file names, it adds these to the list. Systems that do not have this directory installed may only display courier 10 in the pop-up list. If this is on the install tape, then this may be the easier supported solution.

    The font list must be added before creating a printer because much of the limits and SMIT data is stored in a SMIT database in /var/spool/lpd/pio/@local/custom. Thus we should make the changes in /usr/lib/lpd/pio/predef/ibm4208-2.asc.


How to add the font name: Steps to make the changes

  1. cd /usr/lib/lpd/pio/predef/

  2. cp ibm4208-2.asc /tmp/ibm4208-2.asc
    Save this for recovery if it does not work.

  3. vi ibm4208-2.asc

  4. find :416:mU:

  5. Add prestige[12] to the attribute so it reads:
    :416:mU::%`"{ print - 'courier[10]prestige[12]';
    /usr/bin/ls /usr/lib/lpd/pio/fonts/%Imt/*.*.* 2>/dev/null|
    /usr/bin/awk -F. '{printf(\\"%%s[%%s]\\n\\",$2,substr($3,1,2));}';
    }|sort -u|tr -d '\\012'"
    

  6. Save the changes

  7. Create a new queue

Test from the command line and from SMIT

  1. qprt -p12 -Pqueue file

  2. smit chpq

  3. Select the print queue

  4. Choose option 2 Default Print Job Attributes

  5. Move cursor to TYPESTYLE and PITCH

  6. Hit F4 or the DO button

  7. Choices should now show:
       courier  10
       prestige 12
    


Examining the colon file

The SMIT entries for pitch and style are combined for most virtual printers at AIX . This allows easier selection which is important for the older printers that print certain fonts in certain sizes. Newer printers probably do not need this feature but it's there and will probably remain so for some time.

Flag attributes

First examine the two flag attributes used to set the pitch and the type style.
  • :700:_p:S[B035]I[1810552]DnE#V[%`W1]:10
    

    • Because the first field is blank, as indicated by the colon in column 1, the message catalog is the default pioattr1.cat
    • 700 designates the message number for lsvirprt and SMIT.
      • dspcat pioattr1.cat 1 700
      • PITCH (characters per inch)
    • _p is the attribute name.
    • S[B035] gives the SMIT panel and position if displayed.
    • I[1810552] is the help information message.
    • Dn means do not display in SMIT.
    • E# means the entry will be a number.
    • V[%`W1] means Validate by running the command given by the W1 attribute. The character after the percent sign is a grave character. If the setting is valid, W1 will return 0, if invalid it will return 1 and you will get an error message when you print or try to change the value. This is where the Op V message came from in our message file.
    • 10 is the current default value.

  • :701:_s:S[B040]I[1810553]DnEnV[%`W1]:%Imu
    

    • Message from pioattr1.cat
    • Message number 701 - TYPE STYLE (name)
    • Lower in SMIT than the pitch but on the same panel.
    • Informational number 1810553 for help
    • Dn - Do not display in SMIT
    • En - No typed entry allowed.
    • V[%`W1] - Also validated by running W1
    • Default value is determined by the mu attribute

Conglomerate attributes

This type of attribute is to combine the input for two flag attributes into a single SMIT selection. In this case the _s and _p attributes are combined in the Cs attribute. SMIT entry:

   :674:Cs:S[B005]I[1810500]EnC[_s,_p]R[%`W0]:-s%I_s\x27 \x27-p%I_p
  • B005 will be at the top of the B section of the menu.
  • En says no allowed entry from command line
  • C[_s,_p] says combine for s and p flags.
  • R[%`W0] means that a SMIT RING LIST will be generated by running (grave W0) the commands from the W0 attribute.

Work attributes

  • :090:mu::%?%G_p%{12}%=%tprestige%ecourier%;  
    

    • 90 = Type Style (name)
    • mu attribute
    • if pitch is 12 then prestige else courier

  • :676:W1::if [[ -n '%#mU"%I_s\\[%I_p@$"' ]];then 
             print "0\\c";else print "1\\c";fi
    
    • This basically looks for a the values from _s and _p in the mU attribute.
    • Returns 0 when found, returns 1 when not found.

  • :675:W0::
    

    The following clarifies the code a little:

    print '%ImU'|/usr/bin/awk -v sep="  " -v flags="sp" 
    'BEGIN{RS="]";}
    {if(m=match($0,"^[^\\\\[]*\\\\[[0-9]*"))s[cnt++]=substr($0,m,RLENGTH);}END
    {for(i=0;ir<cnt;i++){no=split(s[i],F,"\\\\[");
    for(j=1;j<=no;j++)
     {printf("%%s",F[j]);
      if(j+1<=no)printf("%%s",sep);
     }
     if(i+1<cnt)printf(",");
    }
    printf("=");
    for(i=0;i<cnt;i++)
      {no=split(s[i],F,"\\\\[");
      for(j=1;j<=no;j++)
        {printf("-%%s%%s",substr(flags,j,1),F[j]);
         if(j+1<=no)printf("%%s","\\047 \\047"); 
        }
      if(i+1<cnt)printf(",");
      }
    }'
    

    This goes through the mU attributes and separates out things that are separated by square brackets.

  • :416:mU::%`"{ print - 'courier[10]';
    /usr/bin/ls /usr/lib/lpd/pio/fonts/%Imt/*.*.* 2>/dev/null|
    /usr/bin/awk -F. '{printf(\\"%%s[%%s]\\n\\",$2,substr($3,1,2));}';
    }|sort -u|tr -d '\\012'"
    

    This says specifically that courier[10] font can be used as well as any found in /usr/lib/lpd/pio/fonts/ibm4208-2

  • :313:mt::ibm4208-2
    

    Used as the type of printer and for the font subdirectory.

  • :530:tY::%S_s%"courier"%=%G_p%{12}%=%!%*%S_s%"prestige"%=%G_p%{12}%=%*%+%Pr
    

  • :343:wH::%GmH%?%G_K%t%{10}%*%{171}%e%G_p%;%/%?%G_W%t%{2}%*%;%d
    

    Used to calculate the page width in pixels.

  • :148:cp::%Zs%?%G_K%t%{16}%Pp%Iai%e%G_p%{12}%=%t%{8}%Pp%Iec%e%Zp%Iat%;
    

    Command to generate part of the output to set the printer to the right size. This actually puts a calculated value depending on the values of _K and _p into a temporary p variable which is used later by attribute ec.


Summary

By changing the mU attribute we changed the list of allowed style and pitch options, but the change must be made to the predef file before building the new virtual printer queue.

[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Attached devices","Platform":[{"code":"PF002","label":"AIX"}],"Version":"5.3;6.1;7.1","Edition":"Advanced","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Historical Number

isg1pTechnote0281

Document Information

Modified date:
17 June 2018

UID

isg3T1000168