home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1659 < prev    next >
Internet Message Format  |  1990-12-28  |  5KB

  1. From: ajcd@cs.ed.ac.uk (Angus Duggan)
  2. Newsgroups: comp.text.tex,alt.sources
  3. Subject: pbmtopk patch #1
  4. Message-ID: <146@skye.cs.ed.ac.uk>
  5. Date: 10 Aug 90 12:21:15 GMT
  6.  
  7. Whoops, didn't test pktopbm quite thoroughly enough, here's a patch which
  8. fixes a bug in it. I've also made a change to pbmtopk which allows the
  9. character number to be changed when reading option files.
  10.  
  11. I forgot to mention that this package requires Jef Poskanzer's pbmplus library
  12. (actually only libpbm), which comes with the X11R4 distribution. I think it's
  13. available for anonymous ftp also, but I don't know any net addresses for it.
  14.  
  15. Enjoy,
  16. A.
  17. ==
  18. Angus Duggan, Department of Computer Science,    | Ignorance of the manual is
  19. University of Edinburgh, JCMB,            | no excuse.
  20. The King's Buildings, Mayfield Road,        | JANET:  ajcd@uk.ac.ed.lfcs
  21. Edinburgh, EH9 3JZ, Scotland.    | OR:  ajcd%lfcs.ed.ac.uk@nsfnet-relay.ac.uk
  22.  
  23. *** Makefile.old    Fri Aug 10 13:13:29 1990
  24. --- Makefile    Fri Aug 10 13:03:09 1990
  25. ***************
  26. *** 6,24 ****
  27.   
  28.   all: pbmtopk pktopbm
  29.   
  30. ! test: test.dvi
  31.   
  32.   pbmtopk: pbmtopk.c
  33.       $(CC) $(CFLAGS) -o pbmtopk pbmtopk.c -lm -lpbm
  34.   
  35.   pktopbm: pktopbm.c
  36. !     $(CC) $(CFLAGS) -o pktopbm pktopbm.c -lm -lpbm
  37.   
  38.   test.dvi: test.tex test.tfm
  39.       tex test
  40.   
  41. ! test.tfm: pbmtopk test.opt
  42. !     pbmtopk test.300pk test.tfm 300 -s 10 -c 65 -f test.opt
  43.   
  44.   clean:
  45. !     rm -f pbmtopk pktopbm test.dvi test.log test.tfm test.300pk
  46. --- 6,27 ----
  47.   
  48.   all: pbmtopk pktopbm
  49.   
  50. ! test: test.dvi test.pbm
  51.   
  52.   pbmtopk: pbmtopk.c
  53.       $(CC) $(CFLAGS) -o pbmtopk pbmtopk.c -lm -lpbm
  54.   
  55.   pktopbm: pktopbm.c
  56. !     $(CC) $(CFLAGS) -o pktopbm pktopbm.c -lpbm
  57.   
  58. + test.pbm: pktopbm test.300pk
  59. +     pktopbm test.300pk -c 65 test.pbm
  60.   test.dvi: test.tex test.tfm
  61.       tex test
  62.   
  63. ! test.300pk test.tfm: pbmtopk test.opt
  64. !     pbmtopk test.300pk test.tfm 300 -s 10 -f test.opt
  65.   
  66.   clean:
  67. !     rm -f pbmtopk pktopbm test.dvi test.log test.tfm test.300pk test.pbm
  68. *** pbmtopk.1.old    Fri Aug 10 11:03:20 1990
  69. --- pbmtopk.1    Fri Aug 10 12:42:33 1990
  70. ***************
  71. *** 42,48 ****
  72.   in the font with the specified attributes. If any of the attributes are
  73.   omitted, or replaced with "*", a default value will be calculated from the
  74.   size of the bitmap. The settings of the -W, -H, -D, -I, -h, -v, -x, and -y
  75. ! options do not affected characters created in this way. Lines beginning with
  76.   "%" or "#" are ignored.
  77.   .IP "-c num"
  78.   Sets the character number of the next bitmap encountered to num.
  79. --- 42,51 ----
  80.   in the font with the specified attributes. If any of the attributes are
  81.   omitted, or replaced with "*", a default value will be calculated from the
  82.   size of the bitmap. The settings of the -W, -H, -D, -I, -h, -v, -x, and -y
  83. ! options do not affected characters created in this way.
  84. ! The character number can be changed by including a line starting with "=",
  85. ! followed by the new number.
  86. ! Lines beginning with
  87.   "%" or "#" are ignored.
  88.   .IP "-c num"
  89.   Sets the character number of the next bitmap encountered to num.
  90. *** pbmtopk.c.old    Fri Aug 10 11:03:27 1990
  91. --- pbmtopk.c    Fri Aug 10 13:08:46 1990
  92. ***************
  93. *** 836,842 ****
  94.   
  95.       if (fgets(buffer, MAXOPTLINE, fp) == NULL) break ;
  96.       while (isspace(*here)) here++ ;
  97. !     if (*here && *here != '%' && *here != '#') {
  98.         char str[NAMELENGTH] ;
  99.         integer i, n;
  100.         
  101. --- 836,847 ----
  102.   
  103.       if (fgets(buffer, MAXOPTLINE, fp) == NULL) break ;
  104.       while (isspace(*here)) here++ ;
  105. !     if (*here && *here == '=') {
  106. !       if (sscanf(here+1, "%d", &car) != 1) {
  107. !     fprintf(stderr, "Bad option file line %s!\n", buffer) ;
  108. !     jumpout() ;
  109. !       }
  110. !     } else if (*here && *here != '%' && *here != '#') {
  111.         char str[NAMELENGTH] ;
  112.         integer i, n;
  113.         
  114. ***************
  115. *** 1036,1039 ****
  116. --- 1041,1045 ----
  117.     writetfmfile() ;
  118.     if (pkfile != stdout) fclose(pkfile) ;
  119.     if (tfmfile != stdout) fclose(tfmfile) ;
  120. +   exit(0);
  121.   }
  122. *** pktopbm.c.old    Fri Aug 10 13:09:52 1990
  123. --- pktopbm.c    Fri Aug 10 13:08:32 1990
  124. ***************
  125. *** 299,306 ****
  126.       } else goto lab9997 ;
  127.       bitweight = 0 ;
  128.       if (dynf == 14) {
  129. !       for (i = 1 ; i <= cheight ; i ++)
  130. !     for (j = 1 ; j <= cwidth ; j ++) {
  131.         if (getbit())
  132.           bitmap[i][j] = PBM_BLACK ;
  133.         else
  134. --- 299,306 ----
  135.       } else goto lab9997 ;
  136.       bitweight = 0 ;
  137.       if (dynf == 14) {
  138. !       for (i = 0 ; i < cheight ; i ++)
  139. !     for (j = 0 ; j < cwidth ; j ++) {
  140.         if (getbit())
  141.           bitmap[i][j] = PBM_BLACK ;
  142.         else
  143. ***************
  144. *** 377,380 ****
  145. --- 377,381 ----
  146.         fprintf(stderr, " Warning: No character in position %d (file %s).\n",
  147.             car, filename[car]) ;
  148.     fprintf(stderr, "%d bytes read from packed file.\n", pkloc) ;
  149. +   exit(0);
  150.   }
  151. *** test.opt.old    Fri Aug 10 12:32:20 1990
  152. --- test.opt    Fri Aug 10 12:35:38 1990
  153. ***************
  154. *** 1,6 ****
  155.   % pbmtopk option file for the 'test font.
  156. ! % invoke with: pbmtopk test.300pk test.tfm 300 -s 10 -c 65 -f test.opt
  157. ! %
  158.   % character 'A': small 64x64 version of my face.
  159.   face.pbm
  160.   % character 'B': my name.
  161. --- 1,7 ----
  162.   % pbmtopk option file for the 'test font.
  163. ! % invoke with: pbmtopk test.300pk test.tfm 300 -s 10 -f test.opt
  164. ! % reset character number to 65 ('A')
  165. ! = 65
  166.   % character 'A': small 64x64 version of my face.
  167.   face.pbm
  168.   % character 'B': my name.
  169.