Path: utzoo!attcan!lsuc!ecicrl!clewis From: clewis@ecicrl.UUCP (Chris Lewis) Newsgroups: alt.sources Subject: Psroff 2.0 Part 11 of 16 Message-ID: <948@ecicrl.UUCP> Date: 17 Nov 90 04:59:43 GMT Reply-To: clewis@ecicrl.UUCP (Chris Lewis) Distribution: alt Organization: Me... Lines: 1725 Submitted-by: Chris Lewis Archive-name: psroff2.0/Part11 #! /bin/sh # This is a shell archive. Remove anything before this line, then feed it # into a shell via "sh file" or similar. To overwrite existing files, # type "sh file -c". # The tool that generated this appeared in the comp.sources.unix newsgroup; # send mail to comp-sources-unix@uunet.uu.net if you want that tool. # Contents: fonts.lj/I.10.pk.UU fonts.lj/S.12.pk.UU opt.c # utils/Makefile utils/fonts/cmss10.pk.UU utils/pk2ps.c # utils/showfont.S widths/Makefile # Wrapped by clewis@ecicrl on Fri Nov 16 23:36:54 1990 PATH=/bin:/usr/bin:/usr/ucb ; export PATH echo If this archive is complete, you will see the following message: echo ' "shar: End of archive 11 (of 16)."' if test -f 'fonts.lj/I.10.pk.UU' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'fonts.lj/I.10.pk.UU'\" else echo shar: Extracting \"'fonts.lj/I.10.pk.UU'\" \(7133 characters\) sed "s/^X//" >'fonts.lj/I.10.pk.UU' <<'END_OF_FILE' Xtable X !"#$%&'()*+,-./0123456789:;<=>? X@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ Xbegin 644 fonts.lj/I.10.pk XM]UD``*``````````!":N``0FKN`.J0```!4&"/<<8\<.&'#!X`^H````%0@' XM\QP.'APX<,"`X`^S````(@<'[QT_!UB;T4UXD7C XM-N,FXR?QV/-48F#@'2(````5#@S\'!@8\/?'S0T$!!`0@(("$!!`1@8@(+!1 XM(P```",?)?TSQTFLC$B@4%185%146%A,F%#\R830C44,S4;-!M2&YNJJYP17!,\%"46 XM%#,T%2-$%2,U%2,7%107%"46%!85%!@C$BMM/QO`;R4````C&R'Z'E33)",= XM$S)1PS)C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]8RXDUHX]9!XDU4,]1$/4-4TD8]%'30.3P[.3TC4]9]#`*E`````<&AS^ XM&TU<5TI*.4I.*$L^)TM'2SA*.4DY2$K0T.--CE383974S1#`6%$````@'"7\ XM'-!]4V/1.3P[.CT#@](V/3-4TT0]4S35,SUC+B36CCUD%-8R]-5#/41#U#5& XM-D8U$Q4W-!43.3(6$CLQ%DTD0W&Y<=4G'5)AUC0M:==]AMI'P$!2````'QT= XM_AM-335ST4E,2DM+._2TGTM*2SM*/$D]!'30T--'/22#T4A-!)/024OD24Q) XM1A1*115:-1''-!VE,,`Y4P```!<6'OX(\)$P5357574 XMG1O+R]&=1=5-;S3B'1-!T24L-#PE2B8B)C<5><`L5````!X<'/P;/<)'5D(I XM22(:21(J21+QM)$AI*$1M*'0XTVN5-KE3:3;74TYV"I5````'QL=^AO4I%M' XM32CC31CE31CE31CB31KSP;.QTY$!$H$!,T(!90$0R#]6````'QT=^QO(DVT$ XM=-(H32&4T1M-`;],'$L=!:'1])'2]('35AU48=5%'61"UD0==2'90AV?01VO XM7<\]WRU0R&57````*RD=^QO$M9-;6D=+6RA,2QE+6QE+6AI*$4H:2A%)*E@2 XM21Q($E@<]'%$<=#T851AT44611TE0611TT,74QU$,80QU/0AE"'502E!'601 XMI!'6:EV$M=A,/9/0/9/0+:\M$M/`1E@````?'QS_&UQ*AX7%D]))+36!U4<= XM9&'75!V4,ME2';01W%WDWO7=;;$DVA--D477)4UQ9=4834&5TAM-$K7"T$I; XM9J;#R#M9````'QT<^QO)@VT$=-(H71&DT!M;'02AT5D=%8'31QU%4=9%'64Q XMV$(=E!':;;]-P]SD3?W_"Y;*^4KY2OE*^ XM4KY"=V=PX!!>````%0H&]QP$`X&PQD"@$.`18`````P&#/H, XMP"MA````%1(2_1%7DU*$4G-C8G/2\ZAT0V-38G-34]'E/1/22Z@,`[9P```!46'``2 XMU3M"(B@C(1(W)207-3KC-CHU/"4M`S+0$DTAU_+7O,G1@P"9H````%Q0=_QQ6TTT^4]/B/4,UDQ)"A&-O1S;C.#7E.#4X-D=" XMDI#0%VD````,"AW_'(+W-R!,9D4Y.34Y XM.39(2$*3DY#0'FX````7%!+_$38UA!)"A&-O1S;C.#7E.#4X-D="DI#0)&\` XM```5$Q+^$8:R4W."4Y,SLC+"+B/&XL,BPC*S,Y-3,\D=`: XM<@```!`0$O\1-B-V$W0D5#-D,GXSSE/#U)I@T"=S````$`\2_Q%F(4)C,H(Q XMD3*1,X$UN(B(Q"&3+QHB*"(X$R$5)!-ET!UT````$`L:_!EN(9\H*#=%OS-^ XM4W..,U$O-!0C%D38'74````7$1+\$65B1T,X/E(X,N,X,_-T,V124116)L@I XM=@```!83$OP1A')(-3@F.!0```!87&@`12$=D@Y."HX&S!/XV/Z`XX`ZK````%0L$]QQ@WC_'L�$/X````@&QS^&M[" XMP#CJTL`XP%32````(!L<_A>GU2P```!4.*?T>I(.CLK[# XMLK.3A-/3PL[#PL/#U-@;?0```!4.*?T>33T\+.P\+#P]2#H[*^P[*SDX2L`W XMNP```"`9'?PA6:%" X/18%15T-1,SB$=8#U]O;V X` Xend END_OF_FILE if test 7133 -ne `wc -c <'fonts.lj/I.10.pk.UU'`; then echo shar: \"'fonts.lj/I.10.pk.UU'\" unpacked with wrong size! fi # end of 'fonts.lj/I.10.pk.UU' fi if test -f 'fonts.lj/S.12.pk.UU' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'fonts.lj/S.12.pk.UU'\" else echo shar: Extracting \"'fonts.lj/S.12.pk.UU'\" \(6583 characters\) sed "s/^X//" >'fonts.lj/S.12.pk.UU' <<'END_OF_FILE' Xtable X !"#$%&'()*+,-./0123456789:;<=>? X@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ Xbegin 644 fonts.lj/S.12.pk XM]UD``,``````````!":N``0FKK!3(0```"8E,?XDV!UR_6+6\M;RUN(M;RUO XM+6\M;RUO+6\M8L0L4L,\4L),0L(13#+`(DPBQDP2QDP"R$LLCTHLKT@LST8L XM[T0L]3+0]"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/?3?3>V;U@R"V[````)QX>_!K6O9WDWTWSWSWSWRWSW_+?/EWR XMWC_>+>/>+>/=/=/<3;1]F-:PL"^^````)QXG_!^\>\G03030/0/0/0 XM+0/0+0/FT"SSSRSSSRSSSCSCS4S$?)G'#?_1$*@,R````"$:#?T1V>J](,`8 XMS````!D2%/T59JI\71/],0@_'3/17'JF8+!GS0```#(K+_TCQ9U,'/65RTP4 XMR$Q4Q3R3PSRSP3S3L\\Y/1."TR<],V+5)3U30M8]Y!A"$D$!$4(22.(=X!4]YA<-`HSP```!8/+?TB<=Y#WB&! XM45$0(.-QWD/1`?'>0]XQ<"`145&.(=Y#T7#`.=4````5$R_](]$](3'0(CP2 XM2R)+(RSRT_/3XRT^0],M/F/3+3Y#T^,M/ST_+",K0BM"'#(M`3'2/1#04]@` XM```9$BK])=\J0B@D1R8G)S4H1"=4)R$C-R$R*"(B)S(B)R,A\W(V8S;B8D93 XM1O4E9#5N)"9C-F\RXC`^[>@(@,X0```"L.,>XEZQ:-L,`=X@```"L0,>XC XMT2Q+2TM+2TM:6O6O6FI:XFI:X!!JT"#C````*Q`S^"6N`1;Y:6I:6EEI6&H] XM;5QL7%Q;:_:^`1;8'>0````K$#'N)>`?:UOB:UMK]<]<7%Q-34U-34`0((@, XM\````"L.,?8CV^L88+`,\0```"L.,?8ECMX#X-@=\@```"L0,?@C(!!-34U- XM34Q<7/7/6VM;XFM;X!]@V"#S````*Q`S[B7@$6OVMK7%Q<;%UM.FA9:5I:6F XMGVG@$6K`'?0````K$#'X):X!!J6N)J6FKUKUI:6TM+2TM+3"T9@*]0```"L& XM,^XE#X"H"?8````R,0$`#-:P+_L````R*QS]&<3RW"W/+<+<+<++>UJU;/=+>+>+>\M[RS=@+_````!X7&/T7`"*@L"_]````,BL< XM_1G-\MXM[RWBWBWBO5K6WCWCW5W%V4V4VCVRC6G5VSW"W"W"W/+<\L20$OX` X4```G("+](*7J4J76ZCI2I=;U]O;% X` Xend END_OF_FILE if test 6583 -ne `wc -c <'fonts.lj/S.12.pk.UU'`; then echo shar: \"'fonts.lj/S.12.pk.UU'\" unpacked with wrong size! fi # end of 'fonts.lj/S.12.pk.UU' fi if test -f 'opt.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'opt.c'\" else echo shar: Extracting \"'opt.c'\" \(6352 characters\) sed "s/^X//" >'opt.c' <<'END_OF_FILE' X/* Copyright 1985, 1986, 1987, 1988 Chris Lewis X All Rights Reserved X X Permission to copy and further distribute is freely given provided X this copyright notice remains intact and that this software is not X sold for profit. X X Project: Generic Troff drivers X Module: opt.c X Author: Chris Lewis X Specs: Optimizer module X */ X X#include "defs.h" X Xint specXPos, specYPos; Xextern struct cattab tabN[], tabS[]; X X#ifdef OPT X#ifndef lint Xstatic char SCCSid[] = X "@(#)opt.c: 2.2 Copyright 90/08/10 15:16:19 Chris Lewis"; X#endif X Xstruct insbuf { X char font, points, nc; X short xpos, ypos; X}; X X#define INSBUFSIZ 200 X#define OPTSIZ 100 Xstruct insbuf insbuf[INSBUFSIZ]; Xstatic struct insbuf *insptr = insbuf; Xstatic int insypos = -1; X Xcanoninsert(xpos, ypos, font, points, nc) Xregister int xpos, ypos; Xregister int font, points, nc; { X DBP((D_CAT, "canoninsert: %d %d %d %d %d\n", xpos, ypos, font, points, X nc)); X X if (insypos != ypos || (insptr - insbuf >= INSBUFSIZ - 2)) { X canonflush(); X insypos = ypos; X } X insptr->font = font; X insptr->points = points; X insptr->nc = nc; X insptr->xpos = xpos; X insptr++; X} X X#ifdef SORT Xint xsortorder; X Xxsort(a, b) Xregister struct insbuf *a, *b; { X int ret; X if (a->xpos < b->xpos) X ret = -1; X else if (a->xpos > b->xpos) X ret = 1; X else X ret = 0; X return(xsortorder * ret); X} X#endif X Xcanonflush() { X register struct insbuf *ip; X insptr--; X DBP((D_CAT, "canonflush: start: %d chars\n", insptr - insbuf + 1)); X X if (insptr < insbuf) { X insptr = insbuf; X return; X } X X if (insptr->xpos < insbuf[0].xpos) { X DBP((D_CAT, "canonflush: BACK (%d chars)\n", insptr - insbuf + 1)); X#ifdef SORT X xsortorder = -1; X insdump(insbuf, insptr); X qsort(insbuf, insptr - insbuf + 1, sizeof(struct insbuf), xsort); X insdump(insbuf, insptr); X#endif X for(ip = insptr;ip >= insbuf; ip--) X canonchar(ip->xpos, insypos, ip->font, ip->points, ip->nc); X } else { X DBP((D_CAT, "canonflush: FORW (%d chars)\n", insptr - insbuf + 1)); X#ifdef SORT X xsortorder = 1; Xinsdump(insbuf, insptr); X qsort(insbuf, insptr - insbuf + 1, sizeof(struct insbuf), xsort); Xinsdump(insbuf, insptr); X#endif X for(ip = insbuf;ip <= insptr; ip++) X canonchar(ip->xpos, insypos, ip->font, ip->points, ip->nc); X } X insptr = insbuf; X optflush(); X} X Xcanonchar(xpos, ypos, font, points, nc) Xregister int xpos, ypos; Xregister int font, points, nc; { X static struct insbuf lastchar; X static short lastypos; X static sstate = 0; X static char sbuf[512]; X register char *p; X#ifdef INSPECIAL X /* Inline special directives, not supported yet */ X switch(sstate) { X case 0: X if (font == 3 && nc == 34) { X sstate = 1; X lastchar.xpos = specXPos = xpos; X lastchar.font = font; X lastchar.points = points; X lastchar.nc = nc; X lastypos = specYPos = ypos; X optflush(); X return; X } X break; X case 1: X if (font == 3 && nc == 34) { X if (xpos == lastchar.xpos && ypos == lastypos) { X sstate++; X sbuf[0] = '\0'; X return; X } else { X lastchar.xpos = xpos; X lastypos = ypos; X /* stay in this state */ X } X } else X sstate = 0; X X if (be->beputchar) X (*be->beputchar)(lastchar.xpos, lastypos, lastchar.font, X lastchar.points, lastchar.nc, (char *) NULL); X break; X case 2: X if (nc == 34 && font == 3) { X DBP((D_CAT, "Special inline sequence: %s\n", sbuf)); X dospecial(sbuf); X sstate = 0; X return; X } X if (strlen(sbuf) > sizeof(sbuf) - 1) { X fprintf(stderr, X "%s: unterminated/too long \\(bs\\(bstr\\(bs\n", X progname); X sstate = 0; X return; X } X if (font == 3) X p = tabS[nc].ch_name; X else X p = tabN[nc].ch_name; X if (strlen(p) >= 2) { X if (strcmp(p, "hy") == 0 || X strcmp(p, "mi") == 0 || X strcmp(p, "\\-") == 0) X p = "-"; X else if (strcmp(p, "ff") == 0 || X strcmp(p, "fi") == 0 || X strcmp(p, "fl") == 0) X ; X else if (strcmp(p, "Fi") == 0) X p = "ffi"; X else if (strcmp(p, "Fl") == 0) X p = "ffl"; X else X p = " "; X } X strcat(sbuf, p); X return; X } X#endif X optinsert(xpos, ypos, font, points, nc); X} X Xint optxpos, optypos; Xint optfont, optpoints, optnc, origxpos; Xchar optbuffer[OPTSIZ]; Xchar *optp = optbuffer; X Xoptflush() { X X if (!optimize) X return; X X if (optbuffer[0] && be->beputchar) X (*be->beputchar)(origxpos, optypos, optfont, optpoints, optnc, X optbuffer); X optbuffer[0] = '\0'; X optp = optbuffer; X} X Xoptinsert(xpos, ypos, font, points, nc) Xint font, points, nc; Xint xpos, ypos; { X struct troff2befont *bp; X static char *wp; X extern struct cattab tabN[], tabS[]; X struct cattab *ct; X register char *from; X int cantcache; X X if (!optimize) { X if (be->beputchar) X (*be->beputchar)(xpos, ypos, font, points, nc, (char *) NULL); X return; X } X X DBP((D_CHAR, "OLD: x,y,f,p,c = %d,%d,%d,%d,%d\n", X optxpos, optypos, optfont, optpoints, optnc)); X DBP((D_CHAR, "NEW: x,y,f,p,c = %d,%d,%d,%d,%d\n", X xpos, ypos, font, points, nc)); X X /* the 10 is to ensure that there's enough room for moderately X long multiple-character sequences */ X X if (ypos != optypos || optfont != font || optpoints != points || X wp != xlatetable[font]->widthtable || X optp > optbuffer + OPTSIZ - 10) X optflush(); X X wp = xlatetable[font]->widthtable; X X if (font == 3) { X bp = &be->besymfont[nc]; X ct = &tabS[nc]; X } else { X bp = &be->bestdfont[nc]; X ct = &tabN[nc]; X } X X cantcache = !wp || (int) wp == 1 || (font == 3 ? bp->t2b_font != S: X bp->t2b_font != N); X X if (bp->t2b_xc || bp->t2b_yc || bp->t2b_scale || cantcache) X optflush(); X X if (optxpos != xpos) /* handle spaces one day... */ X optflush(); X X if (!optbuffer[0]) { X optypos = ypos; X optxpos = xpos; X origxpos = xpos; X optfont = font; X optnc = nc; X optpoints = points; X } X X if (cantcache) { X if (be->beputchar) X (*be->beputchar)(xpos, ypos, font, points, nc, (char *) NULL); X return; X } X X optxpos += ((wp[ct->ch_wididx]) * points + 3) / 6; X DBP((D_CAT, "optxpos: %d\n", optxpos)); X X for (from = bp->t2b_charseq; *from;) X *optp++ = *from++; X *optp = '\0'; X} X#endif X X#ifdef SORT Xinsdump(b, p) Xregister struct insbuf *b, *p; { X if (!(debug&D_VERB)) X return; X DBP((D_VERB, "insdump:\n")); X for(; b <= p; b++) X DBP((D_VERB, "%d %d\n", b->xpos, b->nc)); X} X#endif END_OF_FILE if test 6352 -ne `wc -c <'opt.c'`; then echo shar: \"'opt.c'\" unpacked with wrong size! fi # end of 'opt.c' fi if test -f 'utils/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'utils/Makefile'\" else echo shar: Extracting \"'utils/Makefile'\" \(6805 characters\) sed "s/^X//" >'utils/Makefile' <<'END_OF_FILE' X# Copyright 14:22:49 Chris Lewis XSCRIPTS = psdtwd showfont mkenctab calcfonts catconv XPROGRAMS = hpinterp psxlate pk2sfp pk2ditwid pktype dumpft pk2ps lj2ps XMAPS = maps/S.cmtrf \ X maps/alnum.ROMAN8 \ X maps/cmmi.MATH8 \ X maps/cmr.MATH8 \ X maps/cmr.ROMAN8 \ X maps/cmss.ROMAN8 \ X maps/cmsy.MATH8 \ X maps/cmsy.ROMAN8 \ X maps/cmti.MATH8 \ X maps/cmti.ROMAN8 \ X maps/cmtrf.MATH8 \ X maps/cmtrf.ROMAN8 \ X maps/cmtt.ROMAN8 X Xinclude ../makeincl X Xall: subst.done $(SCRIPTS) $(PROGRAMS) X Xsubst.done: ../makeincl ../sedscript X rm -f $(SCRIPTS) X touch subst.done X Xljtab.c: ../troff2ps mkenctab ../lib/lj.fonts X cd ../ ; ./troff2ps -Tlj -z > utils/T X ./mkenctab T ljtab.c X rm -f T X X# This isn't perfect, but close X../debug.o ../pk.o ../cattab.o: ../defs.h ../pk.h X @echo "Some troff2ps objects are out of date" X @echo "Make troff2ps at the top level first" X exit X Xtmaps: $(MAPS) X X$(MAPS): X cd maps ; get s.$(@F) X Xljtab.o pk2sfp.o pk2ditwid.o pktype.o dumpft.o: ../defs.h ../pk.h X Xpktype: ../pk.o ../debug.o pktype.o X $(CC) $(CFLAGS) -o pktype pktype.o ../debug.o ../pk.o $(LIBFLAGS) X Xpk2ps: ../pk.o ../debug.o pk2ps.o X $(CC) $(CFLAGS) -o pk2ps pk2ps.o ../debug.o ../pk.o $(LIBFLAGS) X Xhpinterp: hpinterp.o X $(CC) $(CFLAGS) -o hpinterp hpinterp.o $(LIBFLAGS) X Xpsxlate: psxlate.o X $(CC) $(CFLAGS) -o psxlate psxlate.o $(LIBFLAGS) X Xpk2ditwid: ../pk.o ../debug.o pk2ditwid.o ljtab.o X $(CC) $(CFLAGS) -o pk2ditwid pk2ditwid.o ../debug.o ../pk.o ljtab.o \ X $(LIBFLAGS) X Xpk2sfp: ../pk.o ../debug.o pk2sfp.o ljtab.o X $(CC) $(CFLAGS) -o pk2sfp pk2sfp.o ../debug.o ../pk.o ljtab.o \ X $(LIBFLAGS) X Xdumpft: dumpft.o ../cattab.o X $(CC) -o dumpft dumpft.o ../cattab.o $(LIBFLAGS) X Xclean: X rm -f *.o $(SCRIPTS) $(PROGRAMS) ljtab.c *.D *.sfp diagnostics X rm -f fonts/*.LOG fonts/[A-Z].* fonts/[A-Z][A-Z].* fonts/*.D X rm -f fonts/cmtrf*.sfp buildcmtrf X rm -fr testdir X Xinstall: X cd $(LIBDIR)/lib ; rm -f $(SCRIPTS) X $(IGNORESH) cp $(SCRIPTS) $(LIBDIR)/lib X for i in $(PROGRAMS) ; \ X do \ X if [ -f $(LIBDIR)/$$i ] ; \ X then \ X rm -f $(LIBDIR)/$$i.old ; \ X cp $(LIBDIR)/$$i $(LIBDIR)/$$i.old 2> /dev/null ; \ X fi ; \ X cp $$i $(LIBDIR)/$$i ; \ X done X X# Try to convert a vendor supplied ft into dit2catwid input X# and back again. If the number of differences is 0 or 1, X# everything's working (we permit one difference due to space X# handling) Xtestdumpft: dumpft X ./dumpft -d < $(FONTDIR)/ftR > fonts/R.ftout 2> fonts/R.dfterr X ../widths/dit2catwid fonts/R.ftout fonts/R.ftout fonts/R.d2out X -cmp -l /usr/lib/font/ftR fonts/R.d2out > fonts/R.errors X $(IGNORESH) test `wc -l fonts/R.errors | \ X sed -e 's/^[ ]*\([0-9][0-9]*\).*/\1/'` -lt 2 X Xbuildcmtrf: pk2sfp $(MAPS) X for i in ../fonts.lj/S.*.pk ; \ X do \ X ps=`echo $$i | sed -e 's/^.*S.\([0-9]*\).pk/\1/'` ; \ X echo "Building cmtrf$$ps.sfp" ; \ X ./pk2sfp -m maps/S.cmtrf $$i > fonts/cmtrf$$ps.sfp ; \ X done X touch buildcmtrf X Xfonts/cmtrf10.sfp: buildcmtrf X Xbuildfonts: $(NEWFONTS) calcfonts buildcmtrf pk2sfp X $(IGNORESH) test -z "$(PKFONTS)" || \ X perl ./calcfonts -f$(NEWFONTS) -s$(SFP2PK) $(PKFONTS) X X# Use real cmtrf from $(PKFONTS) rather than fonts/cmtrf*.sfp XbuildSfonts: calcfonts pk2sfp X rm -f buildcmtrf fonts/cmtrf*.sfp X $(IGNORESH) test -z "$(PKFONTS)" || \ X perl ./calcfonts -S -f../fonts.lj -s$(SFP2PK) $(PKFONTS) X X# This code is for demonstration purposes w.r.t. PK/SFP merging. X# sfp2pk comes from Rick Richardson's jetroff, and the hyphens X# allow this makefile to continue if you don't have sfp2pk. X Xtestmerge: pk2sfp fonts/cmtrf10.sfp $(MAPS) X ./pk2sfp -m -v \ X maps/cmtrf.MATH8 \ X fonts/cmtrf10.sfp \ X maps/cmr.MATH8 \ X fonts/cmr10.pk \ X maps/cmsy.MATH8 \ X fonts/cmsy10.pk \ X maps/cmmi.MATH8 \ X fonts/cmmi10.pk \ X > fonts/S.10.sfp 2> fonts/S.10.LOG X -$(SFP2PK) < fonts/S.10.sfp > fonts/S.10.pk X ./pk2sfp -m -v \ X maps/cmr.ROMAN8 \ X fonts/cmr10.pk \ X maps/cmsy.ROMAN8 \ X fonts/cmsy10.pk \ X maps/cmtrf.ROMAN8 \ X fonts/cmtrf10.sfp \ X maps/cmti.ROMAN8 \ X fonts/cmti10.pk \ X maps/cmss.ROMAN8 \ X fonts/cmss10.pk \ X > fonts/R.10.sfp 2> fonts/R.10.LOG X -$(SFP2PK) < fonts/R.10.sfp > fonts/R.10.pk X ./pk2sfp -m -v \ X maps/cmr.ROMAN8 \ X fonts/cmsl10.pk \ X maps/cmsy.ROMAN8 \ X fonts/cmsy10.pk \ X maps/cmtrf.ROMAN8 \ X fonts/cmtrf10.sfp \ X maps/cmti.ROMAN8 \ X fonts/cmti10.pk \ X maps/cmss.ROMAN8 \ X fonts/cmss10.pk \ X > fonts/I.10.sfp 2> fonts/I.10.LOG X -$(SFP2PK) < fonts/I.10.sfp > fonts/I.10.pk X ./pk2sfp -m -v \ X maps/cmr.ROMAN8 \ X fonts/cmbx10.pk \ X maps/cmsy.ROMAN8 \ X fonts/cmsy10.pk \ X maps/cmtrf.ROMAN8 \ X fonts/cmtrf10.sfp \ X maps/cmti.ROMAN8 \ X fonts/cmti10.pk \ X maps/cmss.ROMAN8 \ X fonts/cmss10.pk \ X > fonts/B.10.sfp 2> fonts/B.10.LOG X -$(SFP2PK) < fonts/B.10.sfp > fonts/B.10.pk X ./pk2sfp -m -v \ X maps/cmr.ROMAN8 \ X fonts/cmssi10.pk \ X maps/cmsy.ROMAN8 \ X fonts/cmsy10.pk \ X maps/cmtrf.ROMAN8 \ X fonts/cmtrf10.sfp \ X maps/cmti.ROMAN8 \ X fonts/cmti10.pk \ X maps/cmss.ROMAN8 \ X fonts/cmss10.pk \ X > fonts/HI.10.sfp 2> fonts/HI.10.LOG X -$(SFP2PK) < fonts/HI.10.sfp > fonts/HI.10.pk X ./pk2sfp -m -v \ X maps/cmtt.ROMAN8 \ X fonts/cmtt10.pk \ X maps/cmsy.ROMAN8 \ X fonts/cmsy10.pk \ X maps/cmtrf.ROMAN8 \ X fonts/cmtrf10.sfp \ X maps/cmti.ROMAN8 \ X fonts/cmti10.pk \ X maps/cmss.ROMAN8 \ X fonts/cmss10.pk \ X > fonts/C.10.sfp 2> fonts/C.10.LOG X -$(SFP2PK) < fonts/C.10.sfp > fonts/C.10.pk X ./pk2sfp -m -v \ X maps/cmr.ROMAN8 \ X fonts/cmss10.pk \ X maps/cmsy.ROMAN8 \ X fonts/cmsy10.pk \ X maps/cmtrf.ROMAN8 \ X fonts/cmtrf10.sfp \ X maps/cmti.ROMAN8 \ X fonts/cmti10.pk \ X maps/cmss.ROMAN8 \ X fonts/cmss10.pk \ X > fonts/H.10.sfp 2> fonts/H.10.LOG X -$(SFP2PK) < fonts/H.10.sfp > fonts/H.10.pk X Xkeepbuiltfonts: testmerge X cp fonts/[RIBHC]*.pk ../fonts.lj X Xtestpk2ditwid: pk2ditwid testdir X ./pk2ditwid -Ss $(LJF)/S.10.pk X mv S testdir/S.10 X ./pk2ditwid -Ss $(LJF)/S.12.pk X mv S testdir/S.12 X diff testdir/S.10 testdir/S.12 > testdir/S.diff X X$(NEWFONTS): X mkdir $(NEWFONTS) X Xtestdir: X mkdir testdir X Xtestpart: pk2sfp testdir X ./pk2sfp $(LJF)/R.10.pk > testdir/R.10.pk X ./pk2sfp -p $(LJF)/R.10.pk > testdir/R.10.pkp X ./pk2sfp $(LJF)/S.10.pk > testdir/S.10.pk X ./pk2sfp -S $(LJF)/S.10.pk > testdir/S.10.pkS X ./pk2sfp -p $(LJF)/S.10.pk > testdir/S.10.pkp X ./pk2sfp -pS $(LJF)/S.10.pk > testdir/S.10.pkpS X Xcmpfont: pk2sfp testdir X @for i in fonts/[A-Z]*.10.pk ; \ X do \ X f=`basename $$i .10.pk` ; \ X ./pk2sfp $(LJF)/$$f.10.pk > testdir/$$f.10.old ; \ X ./pktype -v testdir/$$f.10.old ; \ X mv $$f.10.old.D testdir/$$f.10.old.D ; \ X ./pk2sfp fonts/$$f.10.pk > testdir/$$f.10.new ; \ X ./pktype -v testdir/$$f.10.new ; \ X mv $$f.10.new.D testdir/$$f.10.new.D ; \ X set +e ; \ X cmp -l testdir/$$f.10.new testdir/$$f.10.old > testdir/$$f.fDIF; \ X diff testdir/$$f.10.new.D testdir/$$f.10.old.D > testdir/$$f.dDIF; \ X set -e ; \ X done END_OF_FILE if test 6805 -ne `wc -c <'utils/Makefile'`; then echo shar: \"'utils/Makefile'\" unpacked with wrong size! fi # end of 'utils/Makefile' fi if test -f 'utils/fonts/cmss10.pk.UU' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'utils/fonts/cmss10.pk.UU'\" else echo shar: Extracting \"'utils/fonts/cmss10.pk.UU'\" \(6526 characters\) sed "s/^X//" >'utils/fonts/cmss10.pk.UU' <<'END_OF_FILE' Xtable X !"#$%&'()*+,-./0123456789:;<=>? X@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ Xbegin 644 utils/fonts/cmss10.pk XM]UD11T9T;U!+(#$N,B!O=71P=70`H```;2.]4@`$)JX`!":NP#M!"JJN'!D= XM_QRSV/77$3UO(CU#)-,C33)#TC1-$E31)CT/-DOSA**4DZ2/U'\\1BT$7ST4 XM,])2\]-!/53(,$(*JJX<%1W\'-"--4A42D-+0N1,04M"25/432;41&@TI22U XM%,0>1-",04M"25/431?`)T,*..8;%1_]':B\=&1DDE3333]-/B33Z$U>)-7T XMU4U4P52B9'2,MT#(,$0+CCT>%QW\'-&=-TA62E1+4TQ#300DT3+TT4%-(QYT XMTHXM%!300O3$-*5$AETWT9"X$44)CCL9$AW\'-SJPOQ1ZTPM@-@01@D<=1@1 XM'?P<`HZM\!(>U-#`+D<*JJT<%1_]':>]!T95231+(TT_33XDT^5-3TG-$^(4 XMT#\DPS2S1*-4DV1E?0MTV`Y("U5:'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^9#DXT?5T/M)#DX,-@2(@@``A4+"/\P@``A44`P`,TE@)?!```RHI XM`P`,U?`/:61E;G1I9FEE'3P X5#&9O;G1F86-E8GET9?0`Z@``]?;V X` Xend END_OF_FILE if test 6526 -ne `wc -c <'utils/fonts/cmss10.pk.UU'`; then echo shar: \"'utils/fonts/cmss10.pk.UU'\" unpacked with wrong size! fi # end of 'utils/fonts/cmss10.pk.UU' fi if test -f 'utils/pk2ps.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'utils/pk2ps.c'\" else echo shar: Extracting \"'utils/pk2ps.c'\" \(6667 characters\) sed "s/^X//" >'utils/pk2ps.c' <<'END_OF_FILE' X/* Copyright 1985, 1986, 1987, 1988 90/07/18 Chris Lewis X All Rights Reserved X X Permission to copy and further distribute is freely given provided X this copyright notice remains intact and that this software is not X sold for profit. X X Project: Generic Troff drivers X Module: sfp2ps.c X Author: Chris Lewis X Specs: Displays SFP font information in Postscript. X (analogous to showfont, but it reads PK/SFP X files and generates postscript, rather than X executing on the printer using the built-in X fonts) X */ X X#ifndef lint Xstatic char SCCSID[] = X "@(#)pk2ps.c 2.1 Copyright 90/07/18 16:49:58 Chris Lewis"; X#endif X#include "defs.h" X#include "pk.h" X Xint verbose = 0; Xchar *progname; Xextern char *mustmalloc(); Xlong pks_malloc; Xlong highest = 0; Xint fontonly = 0; X X/* Dummied out for pk.c */ Xneedchar(a, b) Xint a, b; { X return(1); X} X Xmain(argc, argv) Xint argc; Xchar **argv; { X int c; X extern int optind, getopt(); X extern char *optarg; X register struct pkc *pc; X register struct pkp *p; X extern struct ras *pkrast(); X struct pkp *pk_read(); X register int i, len; X int chcount; X X progname = argv[0]; X while((c = getopt(argc, argv, "fD:v")) != EOF) X switch(c) { X case 'D': X#ifdef DEBUG X setdebug(optarg, "diagnostics"); X break; X#else X fprintf(stderr, "%s: debug not supported recompile with DEBUG\n", X progname); X exit(1); X#endif X case 'v': X verbose = 1; X break; X case 'f': X fontonly = 1; X break; X default: X fprintf(stderr, "Usage: %s pk_files\n", progname); X exit(1); X } X for (; optind < argc; optind++) { X char *filebuf = mustmalloc(strlen(argv[optind]) + 10); X register char *cp; X X printf("%%FILE: %s\n", argv[optind]); X X highest = 0; X X cp = strrchr(argv[optind], '/'); X X if (cp) X strcpy(filebuf, cp+1); X else X strcpy(filebuf, argv[optind]); X cp = strchr(filebuf, '.'); X if (cp) X *cp = '\0'; X X if (!fontonly) { X printf("/saveobj save def\n"); X } X X printf("10 dict dup begin\n"); X printf("/FontType 3 def\n"); X printf("/FontMatrix [1 0 0 1 0 0] def\n"); X printf("/FontBBox [1.28 1.2 -0.16 -.024] def\n"); X printf("/FontInfo 5 dict def\n"); X printf("FontInfo begin\n"); X printf(" /isFixedPitch false def\n"); X printf("end\n"); X printf("/Encoding 256 array def\n"); X printf("0 1 255 {Encoding exch /.notdef put} for\n"); X printf("Encoding\n"); X X p = pk_read(argv[optind]); X X chcount = 0; X for (pc = p->pkp_chars; pc; pc = pc->pkc_next) { X if (pc->pkc_next) X printf("dup "); X printf("%d /ch%d put\n", pc->pkc_char, pc->pkc_char); X highest = max(highest, pc->pkc_char); X chcount++; X } X X if (verbose) { X fprintf(stderr, "Emitting %s, %d codes\n", filebuf, chcount); X } X X if (highest <= 127) X highest = 128; X else X highest = 256; X X printf("/BuildChar\n"); X printf(" { 0 begin\n"); X printf(" /char exch def\n"); X printf(" /fontdict exch def\n"); X printf(" /charname fontdict /Encoding get char get def\n"); X printf(" /charinfo fontdict /CharData get charname\n"); X printf(" get def\n"); X printf(" /wx charinfo 0 get def\n"); X printf(" /charbbox charinfo 1 4 getinterval def\n"); X printf(" wx 0 charbbox aload pop setcachedevice\n"); X printf(" charinfo 5 get charinfo 6 get true\n"); X printf(" fontdict /imagemaskmatrix get\n"); X printf(" dup 4 charinfo 7 get put\n"); X printf(" dup 5 charinfo 8 get put\n"); X printf(" charinfo 9 1 getinterval cvx\n"); X printf(" imagemask\n"); X printf(" end\n"); X printf("} def\n"); X printf("\n"); X printf("/BuildChar load 0 6 dict put\n"); X X#define DOTS2UNITS(x) ((x) / ((p->pkp_npts / POINT) * 300)) X X printf("/imagemaskmatrix [%.2f 0 0 -%.2f 0 0] def\n", X 1 / DOTS2UNITS((double) 1), X 1 / DOTS2UNITS((double) 1) X ); X printf("/CharData %d dict def\n", chcount+1); X printf("CharData begin\n"); X X for (pc = p->pkp_chars; pc; pc = pc->pkc_next) { X register struct ras *r; X r = pkrast(pc); X if (!r) { X fprintf(stderr, "%0: no raster image for %02x\n", X progname, pc->pkc_char); X continue; X } X printf( X " /ch%d [ %.2f %.2f %.2f %.2f %.2f %d %d %.2f %.2f\n\t<", X pc->pkc_char, X X DOTS2UNITS((double) pc->pkc_dx / pow2(16)), /* width */ X X DOTS2UNITS((double) -pc->pkc_x_off), /* bblx */ X DOTS2UNITS((double) pc->pkc_y_off - X pc->pkc_height + 1), /* bbly */ X DOTS2UNITS((double) -pc->pkc_x_off + pc->pkc_width),/* bbux */ X DOTS2UNITS((double) pc->pkc_height + pc->pkc_y_off),/* bbuy */ X X r->ras_width, X r->ras_height, X (double) pc->pkc_x_off - .5, /* shift x */ X (double) pc->pkc_y_off - .5 /* shift y */ X ); X len = r->ras_height * r->ras_bline; X for (i = 0; i < len; i++) { X printf("%02x", r->ras_raster[i]); X if (i % 30 == 29) X putchar('\n'); X } X printf(">]\n def\n"); X free(r->ras_raster); X free(r); X } X printf(" /.notdef [ .24 0 0 0 0 1 0 0 0 <>] def\n"); X X printf(" end\n"); X /* Should be unique enough between Postscript runs */ X printf(" /UniqueID %ld def\n", (long) getpid() + (optind << 16)); X printf("end\n"); X printf("/%s exch definefont pop\n", filebuf); X X /* end of font definition */ X if (!fontonly) { X X printf("36 %d moveto\n", 11 * 72 - 36); X printf("/%s findfont 18 scalefont setfont\n", filebuf); X printf("(%s) show\n", argv[optind]); X printf("36 %d moveto\n", 11 * 72 - 54); X printf("/Courier findfont 18 scalefont setfont\n"); X printf("(%s) show\n", argv[optind]); X X#ifdef NEVER X printf("/%s findfont 10 scalefont setfont\n", filebuf); X printf("72 500 moveto (ABCDEFGHIJKLMNOPQRSTUVWXYZ) show\n"); X printf("72 400 moveto (abcdefghijklmnopqrstuvwxyz) show\n"); X#endif X X#define XPOS(i) (((i) % 16) * 30 + 72) X#define YPOS(i) (680 - ((i) / 16) * 44) X#define PSIZE 7 X#define PSEP 8 X X printf("/%s findfont 18 scalefont setfont\n", filebuf); X for (i = 0; i < highest; i++) { X printf("%d %d moveto\n", XPOS(i), YPOS(i) + 3 * PSEP + 3); X printf("(\\%03o) show\n", i); X } X printf("/Courier findfont %d scalefont setfont\n", PSIZE); X for (i = 0; i < highest; i++) { X if ((i % 16) == 0) { X printf("%d %d moveto\n", 36, YPOS(i) + 2 * PSEP); X printf("(DEC:) show\n"); X printf("%d %d moveto\n", 36, YPOS(i) + PSEP); X printf("(HEX:) show\n"); X printf("%d %d moveto\n", 36, YPOS(i)); X printf("(OCT:) show\n"); X } X printf("%d %d moveto\n", XPOS(i), YPOS(i) + 2 * PSEP); X printf("(%3d) show\n", i); X printf("%d %d moveto\n", XPOS(i), YPOS(i) + PSEP); X printf("( %02x) show\n", i); X printf("%d %d moveto\n", XPOS(i), YPOS(i)); X printf("(%03o) show\n", i); X } X printf("showpage\n"); X printf("saveobj restore\004"); X } X X pk_destroy(p); X free(filebuf); X } X exit(0); X} END_OF_FILE if test 6667 -ne `wc -c <'utils/pk2ps.c'`; then echo shar: \"'utils/pk2ps.c'\" unpacked with wrong size! fi # end of 'utils/pk2ps.c' fi if test -f 'utils/showfont.S' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'utils/showfont.S'\" else echo shar: Extracting \"'utils/showfont.S'\" \(4512 characters\) sed "s/^X//" >'utils/showfont.S' <<'END_OF_FILE' X%%STARTSHELL%% X#@(#)showfont 2.1 90/07/18 X# Shell script to dump postscript fonts with widths into a pretty table X# usage: showfont X# emits postscript to display the font called along with X# interesting font metrics. If a file exists called , X# the file is merged with the postscript, and a second argument is X# used for the font name. X# X# Cell format: X# octal decimal hex X# height CHARACTER X# widthps X# lbear catwidth rbear X# X# widthps is suitable for the widths/widthps/entries (unitwidth 10, res 720) X# cat width is same scale as CAT: (unitwidth 6, res 432) X# the Character is displayed at 18 point. X Xcopies=1 Xif [ $# = 0 ] Xthen X echo "usage: showfont " >&2 X exit 1 Xfi X( Xcat << !END! X%! PS-Adobe 1.0 X%%Title: showfont -- displays the font metrics in a pretty one page table X%%Creator: Ken Marchant & Chris Lewis X%%CreationDate: March 1989 X%%Pages: atend X%% X/SAVEOBJ save def X!END! X Xif [ -r "$1" ] Xthen X cat $1 X shift Xfi Xfont=$1 Xcase $font in X /*) X font=`echo $font | sed -e 's/^.//'` X ;; Xesac Xcat << !ENDTHING! X X(START showfont display $font `date`\n) print Xflush X/FONTname ($font) def X X%% Setup functions used and etc... X X/rowmove { X /I exch def X I 16 mod 30 mul 72 add X 680 I 16 idiv 30 mul sub X moveto X} def X X/widths 259 array def X/widthps 259 array def X/heights 259 array def X/lbear 259 array def X/rbear 259 array def X/tmp 1 string def X.5 setlinewidth X X/Helvetica findfont 9 scalefont setfont X X%% Draw the grid around the cells X%% and add the hex labels to the outside of the box X X0 1 16 X{ X /i exch def X /j i 30 mul def X %% vertical lines X j 62 add dup 220 moveto X 700 lineto X stroke X X %% horizontal lines X j 220 add dup 62 exch moveto X 542 exch lineto X stroke X X i 16 ge { clear exit } if X X %% hex across the top X j 77 add dup 705 moveto X i 16 ( ) cvrs show X X %% hex along the sides X 50 670 j sub 12 add moveto X i 16 ( ) cvrs show X} Xfor X X% scale width in points at 18pts to width in 1/720'nds at 10 point. X/myscaleps { X 720 mul 72 div 10 mul 18 div round cvi X} def X X X% scale width in points at 18 pts, to width in 1/432'nds at 6 point. X/myscale { X 2 mul X % 10 mul round cvi 10 div X round cvi X} def X X/irmove { X CY add exch X CX add exch moveto X} def X X%% Print out the headings in the font to be displayed and Times-Roman X X/Times-Roman findfont 18 scalefont setfont X295 FONTname stringwidth pop .5 mul sub 750 moveto FONTname show X XFONTname findfont 18 scalefont setfont X295 FONTname stringwidth pop .5 mul sub 730 moveto FONTname show X X%% loop thru all the charcters and display in 18 point X%% insert the character widths into the widths array X0 1 258 X{ X newpath X /i exch def X i rowmove X i 255 gt { X i 256 eq { /tmp (ff) def } if X i 257 eq { /tmp (ffi) def } if X i 258 eq { /tmp (ffl) def } if X } { X /tmp 1 string def X tmp 0 i put X } ifelse X tmp show X X widths i tmp stringwidth pop dup /width exch def X myscale put X X widthps i tmp stringwidth pop myscaleps put X X % Set current point again. X i rowmove X /curx currentpoint pop def X X % retrieve bounding box info. X tmp false charpath flattenpath pathbbox X /ury exch def X /urx exch def X /lly exch def X /llx exch def X X % calc left bearing as leftx - curx X X lbear i llx curx sub myscale put X X % calc height as upper y - lower y X X heights i ury lly sub myscale put X X % calc right bearing as width - upper x X X rbear i width urx curx sub sub myscale put X X} Xfor X X%%display the widths in the widths array X X/Helvetica-Narrow findfont 5 scalefont setfont X X0 1 258 X{ X /i exch def X X i rowmove X X currentpoint /CY exch def /CX exch def X X 2 -8 irmove X widths i get ( ) cvs show X X -9 8 irmove X heights i get ( ) cvs show X X -9 0 irmove X widthps i get ( ) cvs show X X -9 -8 irmove X lbear i get ( ) cvs show X X 12 -8 irmove X rbear i get ( ) cvs show X X -9 15 irmove X i 8 ( ) cvrs show X X 1 15 irmove X i 10 ( ) cvrs show X X 12 15 irmove X i 16 ( ) cvrs show X} Xfor X XFONTname findfont 18 scalefont setfont X72 144 moveto (This is a test of this font.) show X72 124 moveto (ABCDEFGHIJKLMNOPQRSTUVWXYZ) show X72 104 moveto (abcdefghijklmnopqrstuvwxyz) show X72 84 moveto (0123456789!@#\$\\%^&*\\(\\)_+=) show X72 64 moveto ({}[]\\\\|;:'",.<>?/&~\`) show X Xshowpage X(END showfont display $font `date`\n) print Xflush XSAVEOBJ restore X%%Pages: 1 X!ENDTHING! Xecho "\004\c" X) END_OF_FILE if test 4512 -ne `wc -c <'utils/showfont.S'`; then echo shar: \"'utils/showfont.S'\" unpacked with wrong size! fi # end of 'utils/showfont.S' fi if test -f 'widths/Makefile' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'widths/Makefile'\" else echo shar: Extracting \"'widths/Makefile'\" \(6562 characters\) sed "s/^X//" >'widths/Makefile' <<'END_OF_FILE' X#2.4 90/08/08 XSCRIPTS = gfnttab XTD = testdir XPSW = \ X widthps/DESC \ X widthps/AB widthps/BR widthps/HB widthps/I widthps/PX \ X widthps/AI widthps/BX widthps/HO widthps/NB widthps/R \ X widthps/AR widthps/C widthps/NI widthps/S \ X widthps/AX widthps/CB widthps/HX widthps/NR widthps/S2 \ X widthps/B widthps/CO widthps/Hb widthps/NX widthps/ZC \ X widthps/BB widthps/CX widthps/Hi widthps/PB widthps/ZD \ X widthps/BI widthps/Hr widthps/PI widthps/BO widthps/H \ X widthps/Hx widthps/PR X Xinclude ../makeincl X Xall: subst.done $(PSW) dit2catwid $(SCRIPTS) ljwidths widths X X$(PSW): X @eval `echo $@ | sed -e 's/\(.*\)\/\([^\/]*\)$$/d=\1 f=s.\2/'` ; \ X cd $$d ; $(GET) $(GFLAGS) $$f X Xwidths: gfnttab dit2catwid X -rm -f gfnttab.log X for i in width* ; \ X do \ X echo "Processing $$i" ; \ X ./gfnttab $$i >> gfnttab.log ; \ X done X Xsubst.done: ../makeincl ../sedscript X rm -f $(SCRIPTS) X touch subst.done X X../utils/pk2ditwid: X cd ../utils ; make pk2ditwid X X# The "for ps in" list below is sort of monotonic increasing ratios X# away from point size 10, further, the larger fonts are the ones X# most likely to not be EXACTLY what pointsize they say they are X# (eg: my PK 36 is actually closer to 32) Xsepwidths: ../utils/pk2ditwid X rm -f pk2sep.log pk2sep.err X @$(IGNORESH) if [ -d $(LJF) ] ; \ X then \ X fontlist=`find $(LJF) -type f \ X '(' -name '*.*.pk' -o -name '*.*.sfp' ')' -print | \ X sed -e 's/^\.\///' -e 's/\..*$$//' -e 's/.*\///' | sort -u` ; \ X for font in $$fontlist ; \ X do \ X case $$font in \ X ?) ;; \ X ??) ;; \ X *) \ X echo "$$font can't be a psroff/troff font!" \ X >> pk2dit.err ; \ X continue ; \ X ;; \ X esac ; \ X file= ; \ X for ps in 10 11 9 12 8 7 14 6 16 18 20 22 24 28 36 ; \ X do \ X file= ; \ X if [ -r $(LJF)/$$font.$$ps.pk ] ; \ X then \ X file=$(LJF)/$$font.$$ps.pk ; \ X elif [ -r $(LJF)/$$font.$$ps.sfp ] ; \ X then \ X file=$(LJF)/$$font.$$ps.sfp ; \ X fi ; \ X if [ -n "$$file" ] ; \ X then \ X if [ "$$font" = S ] ; \ X then \ X args=-S ; \ X else \ X args= ; \ X fi ; \ X echo "pk2ditwid: $$file" >> pk2sep.log ; \ X ../utils/pk2ditwid $$args $$file >> pk2sep.log \ X 2>> pk2sep.err ; \ X if [ $$? != 0 ] ; \ X then \ X echo "pk2ditwid (on $$font) failed - check pk2sep.log" \ X >> pk2sep.err ; \ X else \ X mv $$font widthlj/$$font.$$ps ; \ X fi ; \ X fi ; \ X done ; \ X done ; \ X for ps in 10 11 9 12 8 7 14 6 16 18 20 22 24 28 36 ; \ X do \ X for i in $$fontlist ; \ X do \ X if [ ! -r widthlj/$$i.$$ps ] ; \ X then \ X continue ; \ X fi ; \ X case $$i in \ X S) \ X args="-s widthlj/R.$$ps widthlj/S.$$ps" ; \ X if [ ! -r widthlj/R.$$ps ] ; \ X then \ X continue ; \ X fi ; \ X ;; \ X *) \ X args="widthlj/S.$$ps widthlj/$$i.$$ps" ; \ X ;; \ X esac ; \ X echo "dit2catwid: $$i.$$ps" >> pk2sep.log ; \ X ./dit2catwid $$args widthlj/ft$$i.$$ps >> pk2sep.log \ X 2>> pk2sep.err ; \ X done ; \ X done ; \ X fi X X# The "for ps in" list below is sort of monotonic increasing ratios X# away from point size 10, further, the larger fonts are the ones X# most likely to not be EXACTLY what pointsize they say they are X# (eg: my PK 36 is actually closer to 32) Xljwidths: ../utils/pk2ditwid X rm -f pk2dit.log pk2dit.err X @$(IGNORESH) if [ -d $(LJF) ] ; \ X then \ X fontlist=`find $(LJF) -type f \ X '(' -name '*.*.pk' -o -name '*.*.sfp' ')' -print | \ X sed -e 's/^\.\///' -e 's/\..*$$//' -e 's/.*\///' | sort -u` ; \ X for font in $$fontlist ; \ X do \ X case $$font in \ X ?) ;; \ X ??) ;; \ X *) \ X echo "$$font can't be a psroff/troff font!" \ X >> pk2dit.err ; \ X continue ; \ X ;; \ X esac ; \ X file= ; \ X for ps in 10 11 9 12 8 7 14 6 16 18 20 22 24 28 36 ; \ X do \ X if [ -r $(LJF)/$$font.$$ps.pk ] ; \ X then \ X file=$(LJF)/$$font.$$ps.pk ; \ X break ; \ X elif [ -r $(LJF)/$$font.$$ps.sfp ] ; \ X then \ X file=$(LJF)/$$font.$$ps.sfp ; \ X break ; \ X fi ; \ X done ; \ X if [ -n "$$file" ] ; \ X then \ X echo "Best fit for $$font is $$file" >> pk2dit.log ; \ X if [ "$$font" = S ] ; \ X then \ X args=-S ; \ X else \ X args= ; \ X fi ; \ X echo "Creating widthlj/$$font from $$file" ; \ X ../utils/pk2ditwid $$args $$file >> pk2dit.log \ X 2>> pk2dit.err ; \ X if [ $$? != 0 ] ; \ X then \ X echo "pk2ditwid (on $$font) failed - check pk2dit.log" \ X >> pk2dit.err ; \ X else \ X mv $$font widthlj/$$font ; \ X fi ; \ X fi ; \ X done ; \ X fi X @test ! -s pk2dit.err || (cat pk2dit.err ; exit 1) X @rm -f pk2dit.err X Xinstall: X Xinstallwidths: X @$(IGNORESH) \ X test -w $(FONTDIR) || (echo "Install as root" ; exit 1 ; ) ; \ X for i in width* ; \ X do \ X base=`echo $$i | sed -e 's/.*width//'` ; \ X test -d $(FONTDIR)/$$base || mkdir $(FONTDIR)/$$base ; \ X test -w $(FONTDIR)/$$base || \ X (echo "Install as root" ; exit 1 ; ) ; \ X files=`echo width$$base/ft*` ; \ X if [ "$$files" = "width$$base"'/ft*' ] ; \ X then \ X echo "No $$base widths to install" ; \ X continue ; \ X fi ; \ X echo "Installing $$base widths" ; \ X mv width$$base/ft* $(FONTDIR)/$$base ; \ X done X Xcmp: X test -d $(TD) || mkdir $(TD) X @$(IGNORESH) for i in width* ; \ X do \ X base=`echo $$i | sed -e 's/.*width//'` ; \ X cd $$i ; \ X for j in ft* ; \ X do \ X if [ ! -f $$j ] ; \ X then \ X continue ; \ X fi ; \ X echo "Comparing $$j to $(FONTDIR)/$$base/$$j" ; \ X set +e ; \ X cmp -l $$j $(FONTDIR)/$$base/$$j ; \ X set -e ; \ X done ; \ X cd ../ ; \ X done > $(TD)/widthdiff 2>&1 X Xtest: dit2catwid $(SCRIPTS) X test -d $(TD) || mkdir $(TD) X cp widthps/S $(TD)/S X sed -e '1,/charset/d' widthps/S2 >> $(TD)/S X ./dit2catwid -v $(TD)/S widthps/R $(TD)/ftR > $(TD)/ftR.nout X @echo "Comparing $(TD)/ftR and $(FONTDIR)/ps/ftR" X -cmp -l $(TD)/ftR $(FONTDIR)/ps/ftR X ./dit2catwid -vc $(TD)/S widthps/R $(TD)/ftR.c > $(TD)/ftR.c.nout X ./dit2catwid -sv widthps/R $(TD)/S $(TD)/ftS > $(TD)/ftS.nout X @echo "Comparing $(TD)/ftS and $(FONTDIR)/ps/ftS" X -cmp -l $(TD)/ftS $(FONTDIR)/ps/ftS X ./dit2catwid -svc widthps/R $(TD)/S $(TD)/ftS.c > $(TD)/ftS.c.nout X Xclean: X rm -rf dit2catwid $(SCRIPTS) */ft* *.o $(TD) *.fonts.new X rm -f gfnttab.log pk2dit.log pk2sep.log pk2dit.err pk2sep.err X Xdit2catwid.o: ../defs.h X X../cattab.o: ../defs.h X @echo "cattab.o is out of date, please run make troff2ps in top level first" X exit X Xdit2catwid: ../cattab.o dit2catwid.o X $(CC) $(CFLAGS) -o dit2catwid dit2catwid.o ../cattab.o $(LIBFLAGS) END_OF_FILE if test 6562 -ne `wc -c <'widths/Makefile'`; then echo shar: \"'widths/Makefile'\" unpacked with wrong size! fi # end of 'widths/Makefile' fi echo shar: End of archive 11 \(of 16\). cp /dev/null ark11isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 16 archives. echo "Read the README to get started with psroff installation" rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still must unpack the following archives: echo " " ${MISSING} fi exit 0 -- Chris Lewis, Phone: TBA UUCP: uunet!utai!lsuc!ecicrl!clewis Moderator of the Ferret Mailing List (ferret-request@eci386) Psroff mailing list (psroff-request@eci386)