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 Version 4.1.4 and later.
From SMIT: TYPESTYLE and PITCH Move cursor to desired item and press Enter. courier 10
echo "p2" | qprt -p12 -P4208jwt ls -l /dev/4208 -rw-r--r-- 1 root system 0 Nov 08 09:31 /dev/4208
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
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 /usr/lib/lpd/pio/fonts/ibm4208-2 directory and based on the file names adds these to the list. On my system I don't have this directory installed so I only get "courier 10" from my popup 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.
The SMIT entries for pitch and style are combined for most virtual printers at AIX 4. This allows easier selection as important for the older dumb printers that print certain fonts in certain sizes. Newer printers probably do not need this feature, but it's there and will probably remain for some time.
:700:_p:S[B035]I[1810552]DnE#V[%`W1]:10
:701:_s:S[B040]I[1810553]DnEnV[%`W1]:%Imu
This type of attribute is to combine the input for two flag attributes to 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
:090:mu::%?%G_p%{12}%=%tprestige%ecourier%;
:676:W1::if [[ -n '%#mU"%I_s\\[%I_p@$"' ]];then print "0\\c";else print "1\\c";fi
: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
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.