home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume12 / bdftools / part01 < prev    next >
Internet Message Format  |  1993-04-28  |  52KB

  1. From: mleisher@NMSU.Edu
  2. Newsgroups: comp.sources.x
  3. Subject: v12i004: bdftools -- tools for working with BDF fonts, Part01/02
  4. Message-ID: <csx-12i004:bdftools@uunet.UU.NET>
  5. Date: 2 Mar 91 08:28:09 GMT
  6. Approved: argv@sun.com
  7.  
  8. Submitted-by: mleisher@NMSU.Edu
  9. Posting-number: Volume 12, Issue 4
  10. Archive-name: bdftools/part01
  11.  
  12. ---- Cut Here and feed the following to sh ----
  13. #!/bin/sh
  14. # This is bdftools/part, a shell archive (produced by shar 3.49)
  15. # To extract the files from this archive, save it to a file, remove
  16. # everything above the "!/bin/sh" line above, and type "sh file_name".
  17. #
  18. # made 02/25/1991 05:04 UTC by mleisher@nmsu.edu
  19. # Source directory /tmp_mnt/home/nikita1/X11R4/contrib/fonts
  20. #
  21. # existing files will NOT be overwritten unless -c is specified
  22. #
  23. # This is part 1 of a multipart archive                                    
  24. # do not concatenate these parts, unpack them in order with /bin/sh        
  25. #
  26. # This shar contains:
  27. # length  mode       name
  28. # ------ ---------- ------------------------------------------
  29. #    513 -rw-rw-r-- bdftools/README
  30. #   6165 -rw-rw-r-- bdftools/bdftops-1.1/bdftops.c
  31. #   2082 -rw-rw-r-- bdftools/bdftops-1.1/bdftops.man
  32. #   1586 -rw-rw-r-- bdftools/bdftops-1.1/README
  33. #     22 -rw-rw-r-- bdftools/bdftops-1.1/patchlevel.h
  34. #    337 -rw-rw-r-- bdftools/bdftops-1.1/Imakefile
  35. #   9117 -rw-rw-r-- bdftools/bdftops-1.1/Makefile
  36. #    217 -rw-rw-r-- bdftools/bintobdf-1.0/Imakefile
  37. #  11688 -rw-rw-r-- bdftools/bintobdf-1.0/bintobdf.c
  38. #    680 -rw-rw-r-- bdftools/bintobdf-1.0/bintobdf.h
  39. #   3475 -rw-rw-r-- bdftools/bintobdf-1.0/bintobdf.man
  40. #     21 -rw-rw-r-- bdftools/bintobdf-1.0/patchlevel.h
  41. #   1685 -rw-rw-r-- bdftools/bintobdf-1.0/README
  42. #    441 -rw-rw-r-- bdftools/snftobdf-1.4/Imakefile
  43. #    178 -rw-rw-r-- bdftools/snftobdf-1.4/MANIFEST
  44. #   9230 -rw-rw-r-- bdftools/snftobdf-1.4/Makefile
  45. #   2716 -rw-rw-r-- bdftools/snftobdf-1.4/README
  46. #   3915 -rw-rw-r-- bdftools/snftobdf-1.4/input.c
  47. #   5991 -rw-rw-r-- bdftools/snftobdf-1.4/output.c
  48. #   2543 -rw-rw-r-- bdftools/snftobdf-1.4/snftobdf.c
  49. #     21 -rw-rw-r-- bdftools/snftobdf-1.4/patchlevel.h
  50. #   1083 -rw-rw-r-- bdftools/snftobdf-1.4/snftobdf.h
  51. #   1074 -rw-rw-r-- bdftools/snftobdf-1.4/snftobdf.man
  52. #
  53. if test -r _shar_seq_.tmp; then
  54.     echo 'Must unpack archives in sequence!'
  55.     echo Please unpack part `cat _shar_seq_.tmp` next
  56.     exit 1
  57. fi
  58. # ============= bdftools/README ==============
  59. if test ! -d 'bdftools'; then
  60.     echo 'x - creating directory bdftools'
  61.     mkdir 'bdftools'
  62. fi
  63. if test -f 'bdftools/README' -a X"$1" != X"-c"; then
  64.     echo 'x - skipping bdftools/README (File already exists)'
  65.     rm -f _shar_wnt_.tmp
  66. else
  67. > _shar_wnt_.tmp
  68. echo 'x - extracting bdftools/README (Text)'
  69. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/README' &&
  70. Here are three utilities for working with BDF format fonts:
  71. 1. bdftops 1.1 - converts a BDF font into a bitmapped Postscript font
  72. X
  73. 2. bintobdf 1.0 - converts a raw bitmap font into a BDF font
  74. X                  (designed primarily for working with Oriental fonts)
  75. X
  76. 3. snftobdf 1.4 - converts an SNF format font into a BDF format font
  77. X
  78. Please send fixes, additions, etc. to:
  79. X
  80. Internet: mleisher@nmsu.edu
  81. Bitnet  : mleisher@nmsu.bitnet
  82. X
  83. Mark Leisher
  84. Computing Research Lab
  85. New Mexico State University
  86. Las Cruces, NM
  87. SHAR_EOF
  88. chmod 0664 bdftools/README ||
  89. echo 'restore of bdftools/README failed'
  90. Wc_c="`wc -c < 'bdftools/README'`"
  91. test 513 -eq "$Wc_c" ||
  92.     echo 'bdftools/README: original size 513, current size' "$Wc_c"
  93. rm -f _shar_wnt_.tmp
  94. fi
  95. # ============= bdftools/bdftops-1.1/bdftops.c ==============
  96. if test ! -d 'bdftools/bdftops-1.1'; then
  97.     echo 'x - creating directory bdftools/bdftops-1.1'
  98.     mkdir 'bdftools/bdftops-1.1'
  99. fi
  100. if test -f 'bdftools/bdftops-1.1/bdftops.c' -a X"$1" != X"-c"; then
  101.     echo 'x - skipping bdftools/bdftops-1.1/bdftops.c (File already exists)'
  102.     rm -f _shar_wnt_.tmp
  103. else
  104. > _shar_wnt_.tmp
  105. echo 'x - extracting bdftools/bdftops-1.1/bdftops.c (Text)'
  106. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bdftops-1.1/bdftops.c' &&
  107. #include <stdio.h>
  108. X
  109. char *program, *fontname;
  110. char buff[128];
  111. int fontno = 1;
  112. X
  113. int w, h, psize, resX, resY;
  114. double unit_width, unit_height;
  115. double width_scale;
  116. double bbx_llx, bbx_lly, bbx_urx, bbx_ury;
  117. X
  118. char *
  119. get_fontname(str)
  120. char *str;
  121. {
  122. X    int len;
  123. X    char *ptr, *ptr1, *tmp_name;
  124. X
  125. X    if (str == NULL) {
  126. X        tmp_name = (char *)malloc(20 * sizeof(char));
  127. X        sprintf(tmp_name, "BDF FONT %d", fontno++);
  128. X        return(tmp_name);
  129. X    }
  130. X    len = strlen(str);
  131. X    ptr = str + (len - 1);
  132. X    while(ptr > str && *ptr != '.')
  133. X      ptr--;
  134. X    if (ptr == str)
  135. X      return(str);
  136. X    ptr1 = ptr;
  137. X    while(ptr1 > str && *ptr1 != '/')
  138. X      ptr1--;
  139. X    if (*ptr1 == '/')
  140. X      ptr1++;
  141. X
  142. X    tmp_name = (char *)malloc(((ptr - ptr1) + 1) * sizeof(char));
  143. X    strncpy(tmp_name, ptr1, (ptr - ptr1));
  144. X    tmp_name[(ptr - ptr1)] = '\0';
  145. X    return(tmp_name);
  146. }
  147. X
  148. void
  149. header(in)
  150. FILE *in;
  151. {
  152. X    int dx, dy;
  153. X    int i, count, ndx, ndy;
  154. X
  155. X    printf("%%!PS-Adobe-2.0\n");
  156. X    printf("10 dict dup begin\n");
  157. X    printf("/FontType 3 def\n");
  158. X    printf("/FontMatrix [1 0 0 1 0 0] def\n");
  159. X
  160. X    fscanf(in, "%[^\n]\n", buff);
  161. X    while(!feof(in) && strncmp(buff, "SIZE", 4))
  162. X      fscanf(in, "%[^\n]\n", buff);
  163. X    if (strncmp(buff, "SIZE", 4)) {
  164. X        fprintf(stderr, "%s: missing SIZE\n");
  165. X        exit(1);
  166. X    }
  167. X    sscanf(buff, "SIZE %d %d %d", &psize, &resX, &resY);
  168. X
  169. X    width_scale = (((double)psize)/1000.0) * (((double)resX)/72.27);
  170. X
  171. X    while(!feof(in) && strncmp(buff, "FONTBOUNDINGBOX", 15))
  172. X      fscanf(in, "%[^\n]\n", buff);
  173. X    if (strncmp(buff, "FONTBOUNDINGBOX", 15)) {
  174. X        fprintf(stderr, "%s: missing FONTBOUNDINGBOX\n");
  175. X        exit(1);
  176. X    }
  177. X    sscanf(buff, "FONTBOUNDINGBOX %d %d %d %d", &w, &h, &dx, &dy);
  178. X
  179. X    ndx = (dx < 0) ? -(dx) : dx;
  180. X    ndy = (dy < 0) ? -(dy) : dy;
  181. X
  182. X    unit_width = (double)(w + dx);
  183. X    unit_height = (double)(h + dy);
  184. X
  185. X    bbx_llx = ((double)(w + ndx)) / unit_width;
  186. X    bbx_urx = ((double) dx) / unit_width;
  187. X
  188. X    bbx_lly = ((double)(h + ndy)) / unit_height;
  189. X    bbx_ury = ((double) dy) / unit_height;
  190. X
  191. X    printf("/FontBBox [%g %g %g %g] def\n", bbx_llx, bbx_lly, bbx_urx, bbx_ury);
  192. X    printf("/Encoding 256 array def\n");
  193. X    printf("0 1 255 {Encoding exch /.notdef put} for\n");
  194. X    printf("Encoding\n");
  195. X    count = 0;
  196. X    for (i = 0; i < 255; i++) {
  197. X        printf("dup %d /char%d put\t", i, i);
  198. X        count++;
  199. X        if (count % 3 == 0) {
  200. X            count = 0;
  201. X            printf("\n");
  202. X        }
  203. X    }
  204. X    printf("255 /char255 put\n");
  205. X    printf("/BuildChar\n{0 begin\n/char exch def\n/fontdict exch def\n");
  206. X    printf("/charname fontdict /Encoding get char get def\n");
  207. X    printf("/charinfo fontdict /CharData get charname get def\n");
  208. X    printf("/wx charinfo 0 get def\n");
  209. X    printf("/charbbox charinfo 1 4 getinterval def\n");
  210. X    printf("wx 0 charbbox aload pop setcachedevice\n");
  211. X    printf("charinfo 5 get charinfo 6 get true\n");
  212. X    printf("fontdict /imagemaskmatrix get\n");
  213. X    printf("dup 4 charinfo 7 get put\n");
  214. X    printf("dup 5 charinfo 8 get put\n");
  215. X    printf("charinfo 9 1 getinterval cvx imagemask\n");
  216. X    printf("end } def\n");
  217. X    printf("/BuildChar load 0 6 dict put\n");
  218. X    printf("/imagemaskmatrix [%d 0 0 -%d 0 0] def\n", w, h);
  219. X    printf("/CharData 256 dict def\nCharData begin\n");
  220. }
  221. X
  222. void
  223. gen_chars(in)
  224. FILE *in;
  225. {
  226. X    int cw, ch, dx, dy, udx, udy, encoding, i;
  227. X    int sw, dummy, count = 0;
  228. X    double wx, llx, lly, urx, ury, ndx, ndy, tdx;
  229. X
  230. X    fscanf(in, "%[^\n]\n", buff);
  231. X    while(!feof(in)) {
  232. X        while(!feof(in) && strncmp(buff, "ENCODING", 8))
  233. X          fscanf(in, "%[^\n]\n", buff);
  234. X        if (feof(in))
  235. X          break;
  236. X        sscanf(buff, "ENCODING %d", &encoding);
  237. X
  238. X        if (encoding < 0 || encoding > 255) {
  239. X            fscanf(in, "%[^\n]\n", buff);
  240. X            continue;
  241. X        }
  242. X
  243. X        while(!feof(in) && strncmp(buff, "SWIDTH", 6))
  244. X          fscanf(in, "%[^\n]\n", buff);
  245. X        if (feof(in))
  246. X          break;
  247. X        sscanf(buff, "SWIDTH %d %d", &sw, &dummy);
  248. X
  249. X        sw = (int)(((double)sw) * width_scale);
  250. X        sw++;
  251. X
  252. X        if (!feof(in)) {
  253. X            while(!feof(in) && strncmp(buff, "BBX", 3))
  254. X              fscanf(in, "%[^\n]\n", buff);
  255. X            if (feof(in))
  256. X              break;
  257. X            sscanf(buff, "BBX %d %d %d %d", &cw, &ch, &dx, &dy);
  258. X
  259. X            udx = (dx < 0) ? -(dx) : dx;
  260. X            udy = (dy < 0) ? -(dy) : dy;
  261. X
  262. X            wx = ((double)sw) / unit_width;
  263. X            if (wx == 0)
  264. X              wx = ((double)w) * 0.01;
  265. X
  266. X            llx = ((double) dx) / unit_width;
  267. X            urx = ((double)(sw + dx)) / unit_width;
  268. X            llx = ((wx - (llx+urx)) < 0.0) ? -(llx) : llx;
  269. X
  270. X            lly = ((double) dy) / unit_height;
  271. X            ury = ((double)(ch + udy)) / unit_height;
  272. X
  273. X            ury += bbx_lly - ury;
  274. X
  275. X            ndx = ((double)dx) + 0.5;
  276. X            ndy = ((double)(ch + dy)) + 0.5;
  277. X            printf("/char%d [%g %g %g %g %g %d %d %g %g\n<", encoding, wx, llx,
  278. X                   lly, urx, ury, cw, ch, ndx, ndy);
  279. X
  280. X            fscanf(in, "%[^\n]\n", buff);
  281. X            while(!feof(in) && strncmp(buff, "BITMAP", 6))
  282. X              fscanf(in, "%[^\n]\n", buff);
  283. X            if (feof(in))
  284. X              break;
  285. X            for (i = 0; i < ch; i++) {
  286. X                fscanf(in, "%[^\n]", buff);
  287. X                printf("%s", buff);
  288. X                getc(in);  /* kill the EOL */
  289. X            }
  290. X            printf(">] def\n");
  291. X        } else
  292. X          fscanf(in, "%[^\n]\n", buff);
  293. X        count++;
  294. X    }
  295. X    if (count < 256)
  296. X      printf("/.notdef [%g 0 0 0 0 1 0 0 <>] def\n", ((double) w) * .01);
  297. X    printf("end\nend\n/%s exch definefont pop\n", fontname);
  298. }
  299. X
  300. X
  301. main(argc, argv)
  302. int argc;
  303. char **argv;
  304. {
  305. X    FILE *in = stdin;
  306. X
  307. X    program = argv[0];
  308. X
  309. X    argc--;
  310. X    *argv++;
  311. X    while(argc) {
  312. X        if (!(in = fopen(argv[0], "r")))
  313. X          fprintf(stderr, "%s: problem with %s\n", program, argv[0]);
  314. X        else {
  315. X            fontname = get_fontname(argv[0]);
  316. X            header(in);
  317. X            gen_chars(in);
  318. X            fclose(in);
  319. X            in = NULL;
  320. X        }
  321. X        argc--;
  322. X        *argv++;
  323. X    }
  324. X    if (in != NULL) {
  325. X        header(in);
  326. X        gen_chars(in);
  327. X    }
  328. }
  329. SHAR_EOF
  330. chmod 0664 bdftools/bdftops-1.1/bdftops.c ||
  331. echo 'restore of bdftools/bdftops-1.1/bdftops.c failed'
  332. Wc_c="`wc -c < 'bdftools/bdftops-1.1/bdftops.c'`"
  333. test 6165 -eq "$Wc_c" ||
  334.     echo 'bdftools/bdftops-1.1/bdftops.c: original size 6165, current size' "$Wc_c"
  335. rm -f _shar_wnt_.tmp
  336. fi
  337. # ============= bdftools/bdftops-1.1/bdftops.man ==============
  338. if test -f 'bdftools/bdftops-1.1/bdftops.man' -a X"$1" != X"-c"; then
  339.     echo 'x - skipping bdftools/bdftops-1.1/bdftops.man (File already exists)'
  340.     rm -f _shar_wnt_.tmp
  341. else
  342. > _shar_wnt_.tmp
  343. echo 'x - extracting bdftools/bdftops-1.1/bdftops.man (Text)'
  344. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bdftops-1.1/bdftops.man' &&
  345. .TH BDFTOPS 1 "Release 4" "X Version 11"
  346. .SH NAME
  347. bdftops - BDF font to Postscript font generator
  348. .SH SYNOPSIS
  349. .B "bdftops"
  350. [bdf-file(s)]
  351. .SH DESCRIPTION
  352. .PP
  353. .B bdftops
  354. reads a Bitmap Distribution Format (BDF) file (or from standard input
  355. if no file is specified on the command line) and produces a
  356. Postscript font on standard output.
  357. .sp
  358. .B bdftops
  359. will use the font filename minus the \fI.bdf\fP extension as
  360. the name of the font, the full font filename if the \fI.bdf\fP extension is
  361. not there, or a font name of "\fBBDF-FONT-\fIn\fP", where \fIn\fP is a
  362. number, when a font file is read from standard input.
  363. .SH "TUNING FONTS"
  364. .B bdftops
  365. depends on the SWIDTH (scalable width) x value heavily.  If this value
  366. is not correct, then the horizontal offsets will be a little too
  367. small, especially with variable width fonts.  Details of the SWIDTH
  368. entry are described in the "Bitmap Distribution Format 2.1" document.
  369. .sp
  370. Variable width fonts will probably need a small amount of hand tuning
  371. to get correct kerning.
  372. .sp
  373. An example of a Postscript character definition from the Adobe
  374. Times-Roman 24(timR24.bdf) font:
  375. .nf
  376. \f(CW/char116 [0.230769 0 0 1 1 7 15 -0.5 14.5
  377. <103070FE303030303030303030321C>] def\fP
  378. .fi
  379. .sp
  380. The first number is the horziontal offset of the character that
  381. follows this one, the next four numbers are the character's bounding
  382. box for the font cacheing mechanism, the next two numbers are the
  383. bitmap's width and height, and the last two numbers are horizontal and
  384. vertical translations of the bitmap with .5 subtracted to handle
  385. Postscript rounding errors.
  386. .sp
  387. This example in particular is a lower case ``t''.  The horizontal
  388. offset of the next character is not quite right.  So the 0.230769
  389. needs to be increased a little so that the character following the
  390. ``t'' is kerned correctly.
  391. .SH "SEE ALSO"
  392. XX(1), Xserver(1), bdftosnf(1)
  393. .br
  394. "Bitmap Distribution Format 2.1"
  395. .SH AUTHOR
  396. Internet: mleisher@nmsu.edu     Bitnet: mleisher@nmsu.bitnet
  397. .br
  398. Mark Leisher
  399. .br
  400. Computing Research Lab
  401. .br
  402. New Mexico State University
  403. .br
  404. Las Cruces, NM 88003
  405. .br
  406. (505) 646-5711
  407. X
  408. SHAR_EOF
  409. chmod 0664 bdftools/bdftops-1.1/bdftops.man ||
  410. echo 'restore of bdftools/bdftops-1.1/bdftops.man failed'
  411. Wc_c="`wc -c < 'bdftools/bdftops-1.1/bdftops.man'`"
  412. test 2082 -eq "$Wc_c" ||
  413.     echo 'bdftools/bdftops-1.1/bdftops.man: original size 2082, current size' "$Wc_c"
  414. rm -f _shar_wnt_.tmp
  415. fi
  416. # ============= bdftools/bdftops-1.1/README ==============
  417. if test -f 'bdftools/bdftops-1.1/README' -a X"$1" != X"-c"; then
  418.     echo 'x - skipping bdftools/bdftops-1.1/README (File already exists)'
  419.     rm -f _shar_wnt_.tmp
  420. else
  421. > _shar_wnt_.tmp
  422. echo 'x - extracting bdftools/bdftops-1.1/README (Text)'
  423. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bdftops-1.1/README' &&
  424. --------------------------------------------------------------------
  425. Copyright (C) 1990 Mark Leisher.
  426. X
  427. Author: Mark Leisher (mleisher@nmsu.edu)
  428. X
  429. This program is free software; you can redistribute it and/or modify
  430. it under the terms of the GNU General Public License as published by
  431. the Free Software Foundation; either version 1, or (at your option)
  432. any later version.
  433. X
  434. This program is distributed in the hope that it will be useful,
  435. but WITHOUT ANY WARRANTY; without even the implied warranty of
  436. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  437. GNU General Public License for more details.
  438. X
  439. A copy of the GNU General Public License can be obtained from this
  440. program's author (send electronic mail to mleisher@nmsu.edu) or from
  441. the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
  442. 02139, USA.
  443. --------------------------------------------------------------------
  444. X
  445. This program makes a Postscript font out from a BDF font.  It will not
  446. work with large, two byte BDF fonts such as Chinese or Japanese BDF
  447. fonts.  It also ignores any entries that have an ENCODING value less
  448. than zero.
  449. X
  450. You might want to tune some of the Postscript parameters by hand to
  451. get the output closer to what you want.  There is a short description
  452. of this in the man page.
  453. X
  454. This program depends heavily on the SWIDTH entry for each character.
  455. Please see the "Bitmap Distribution Format 2.1" document for details
  456. on SWIDTH.  You can also send me email for a copy of this document.
  457. X
  458. Please send bug reports, enhancements, etc. to:
  459. Internet: mleisher@nmsu.edu
  460. Bitnet  : mleisher@nmsu.bitnet
  461. SHAR_EOF
  462. chmod 0664 bdftools/bdftops-1.1/README ||
  463. echo 'restore of bdftools/bdftops-1.1/README failed'
  464. Wc_c="`wc -c < 'bdftools/bdftops-1.1/README'`"
  465. test 1586 -eq "$Wc_c" ||
  466.     echo 'bdftools/bdftops-1.1/README: original size 1586, current size' "$Wc_c"
  467. rm -f _shar_wnt_.tmp
  468. fi
  469. # ============= bdftools/bdftops-1.1/patchlevel.h ==============
  470. if test -f 'bdftools/bdftops-1.1/patchlevel.h' -a X"$1" != X"-c"; then
  471.     echo 'x - skipping bdftools/bdftops-1.1/patchlevel.h (File already exists)'
  472.     rm -f _shar_wnt_.tmp
  473. else
  474. > _shar_wnt_.tmp
  475. echo 'x - extracting bdftools/bdftops-1.1/patchlevel.h (Text)'
  476. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bdftops-1.1/patchlevel.h' &&
  477. #define patchlevel 1
  478. X
  479. SHAR_EOF
  480. chmod 0664 bdftools/bdftops-1.1/patchlevel.h ||
  481. echo 'restore of bdftools/bdftops-1.1/patchlevel.h failed'
  482. Wc_c="`wc -c < 'bdftools/bdftops-1.1/patchlevel.h'`"
  483. test 22 -eq "$Wc_c" ||
  484.     echo 'bdftools/bdftops-1.1/patchlevel.h: original size 22, current size' "$Wc_c"
  485. rm -f _shar_wnt_.tmp
  486. fi
  487. # ============= bdftools/bdftops-1.1/Imakefile ==============
  488. if test -f 'bdftools/bdftops-1.1/Imakefile' -a X"$1" != X"-c"; then
  489.     echo 'x - skipping bdftools/bdftops-1.1/Imakefile (File already exists)'
  490.     rm -f _shar_wnt_.tmp
  491. else
  492. > _shar_wnt_.tmp
  493. echo 'x - extracting bdftools/bdftops-1.1/Imakefile (Text)'
  494. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bdftops-1.1/Imakefile' &&
  495. #
  496. # Make file for the BDF font to Postscript font converter
  497. #
  498. # If TOP is incorrectly defined, uncomment and change the following
  499. # line to point at the X11 distribution source.
  500. X
  501. #        TOP = /usr/local/src/X11/mit
  502. X
  503. X      SRCS  = bdftops.c
  504. X      OBJS  = bdftops.o
  505. X   INCLUDES = -I.
  506. X   PROGRAM  = bdftops
  507. X
  508. ComplexProgramTarget(bdftops)
  509. SHAR_EOF
  510. chmod 0664 bdftools/bdftops-1.1/Imakefile ||
  511. echo 'restore of bdftools/bdftops-1.1/Imakefile failed'
  512. Wc_c="`wc -c < 'bdftools/bdftops-1.1/Imakefile'`"
  513. test 337 -eq "$Wc_c" ||
  514.     echo 'bdftools/bdftops-1.1/Imakefile: original size 337, current size' "$Wc_c"
  515. rm -f _shar_wnt_.tmp
  516. fi
  517. # ============= bdftools/bdftops-1.1/Makefile ==============
  518. if test -f 'bdftools/bdftops-1.1/Makefile' -a X"$1" != X"-c"; then
  519.     echo 'x - skipping bdftools/bdftops-1.1/Makefile (File already exists)'
  520.     rm -f _shar_wnt_.tmp
  521. else
  522. > _shar_wnt_.tmp
  523. echo 'x - extracting bdftools/bdftops-1.1/Makefile (Text)'
  524. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bdftops-1.1/Makefile' &&
  525. # Makefile generated by imake - do not edit!
  526. # $XConsortium: imake.c,v 1.51 89/12/12 12:37:30 jim Exp $
  527. #
  528. # The cpp used on this machine replaces all newlines and multiple tabs and
  529. # spaces in a macro expansion with a single space.  Imake tries to compensate
  530. # for this, but is not always successful.
  531. #
  532. X
  533. ###########################################################################
  534. # Makefile generated from "Imake.tmpl" and </tmp/IIf.a09492>
  535. # $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
  536. #
  537. # Platform-specific parameters may be set in the appropriate .cf
  538. # configuration files.  Site-wide parameters may be set in the file
  539. # site.def.  Full rebuilds are recommended if any parameters are changed.
  540. #
  541. # If your C preprocessor doesn't define any unique symbols, you'll need
  542. # to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  543. # "make Makefile", "make Makefiles", or "make World").
  544. #
  545. # If you absolutely can't get imake to work, you'll need to set the
  546. # variables at the top of each Makefile as well as the dependencies at the
  547. # bottom (makedepend will do this automatically).
  548. #
  549. X
  550. ###########################################################################
  551. # platform-specific configuration parameters - edit sun.cf to change
  552. X
  553. # platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
  554. # operating system:  SunOS 4.1
  555. X
  556. ###########################################################################
  557. # site-specific configuration parameters - edit site.def to change
  558. X
  559. # site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
  560. X
  561. X            SHELL = /bin/sh
  562. X
  563. X              TOP = /usr/local/src/X11/mit
  564. X      CURRENT_DIR = .
  565. X
  566. X               AR = ar clq
  567. X  BOOTSTRAPCFLAGS =
  568. X               CC = cc
  569. X
  570. X         COMPRESS = compress
  571. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  572. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  573. X          INSTALL = install
  574. X               LD = ld
  575. X             LINT = lint
  576. X      LINTLIBFLAG = -C
  577. X         LINTOPTS = -axz
  578. X               LN = ln -s
  579. X             MAKE = make
  580. X               MV = mv
  581. X               CP = cp
  582. X           RANLIB = ranlib
  583. X  RANLIBINSTFLAGS =
  584. X               RM = rm -f
  585. X     STD_INCLUDES =
  586. X  STD_CPP_DEFINES =
  587. X      STD_DEFINES =
  588. X EXTRA_LOAD_FLAGS =
  589. X  EXTRA_LIBRARIES =
  590. X             TAGS = ctags
  591. X
  592. X    SHAREDCODEDEF = -DSHAREDCODE
  593. X         SHLIBDEF = -DSUNSHLIB
  594. X
  595. X    PROTO_DEFINES =
  596. X
  597. X     INSTPGMFLAGS =
  598. X
  599. X     INSTBINFLAGS = -m 0755
  600. X     INSTUIDFLAGS = -m 4755
  601. X     INSTLIBFLAGS = -m 0664
  602. X     INSTINCFLAGS = -m 0444
  603. X     INSTMANFLAGS = -m 0444
  604. X     INSTDATFLAGS = -m 0444
  605. X    INSTKMEMFLAGS = -m 4755
  606. X
  607. X          DESTDIR =
  608. X
  609. X     TOP_INCLUDES = -I$(INCROOT)
  610. X
  611. X      CDEBUGFLAGS = -O
  612. X        CCOPTIONS =
  613. X      COMPATFLAGS = -DXAW_BC
  614. X
  615. X      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
  616. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
  617. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  618. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  619. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  620. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS)
  621. X   LDCOMBINEFLAGS = -X -r
  622. X
  623. X        MACROFILE = sun.cf
  624. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  625. X
  626. X    IMAKE_DEFINES =
  627. X
  628. X         IRULESRC = $(CONFIGDIR)
  629. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  630. X
  631. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  632. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  633. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  634. X
  635. ###########################################################################
  636. # X Window System Build Parameters
  637. # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  638. X
  639. ###########################################################################
  640. # X Window System make variables; this need to be coordinated with rules
  641. # $XConsortium: Project.tmpl,v 1.63 89/12/18 16:46:44 jim Exp $
  642. X
  643. X          PATHSEP = /
  644. X        USRLIBDIR = /usr/local/lib/X11R4
  645. X           BINDIR = /usr/local/bin/X11R4
  646. X          INCROOT = /usr/include/X11
  647. X     BUILDINCROOT = $(TOP)
  648. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  649. X      BUILDINCTOP = ..
  650. X           INCDIR = $(INCROOT)/X11
  651. X           ADMDIR = $(DESTDIR)/usr/adm
  652. X           LIBDIR = /usr/local/lib/X11R4
  653. X        CONFIGDIR = $(LIBDIR)/config
  654. X       LINTLIBDIR = $(USRLIBDIR)/lint
  655. X
  656. X          FONTDIR = /usr/local/lib/X11R4/fonts
  657. X         XINITDIR = $(LIBDIR)/xinit
  658. X           XDMDIR = $(LIBDIR)/xdm
  659. X           AWMDIR = $(LIBDIR)/awm
  660. X           TWMDIR = $(LIBDIR)/twm
  661. X           GWMDIR = $(LIBDIR)/gwm
  662. X          MANPATH = $(DESTDIR)/usr/local/man
  663. X    MANSOURCEPATH = $(MANPATH)/man
  664. X           MANDIR = /usr/local/man/man1
  665. X        LIBMANDIR = $(MANSOURCEPATH)3X
  666. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  667. X
  668. X        SOXLIBREV = 4.2
  669. X          SOXTREV = 4.0
  670. X         SOXAWREV = 4.0
  671. X        SOOLDXREV = 4.0
  672. X         SOXMUREV = 4.0
  673. X        SOXEXTREV = 4.0
  674. X
  675. X       FONTCFLAGS = -t
  676. X
  677. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  678. X
  679. X            IMAKE = imake
  680. X           DEPEND = makedepend
  681. X              RGB = rgb
  682. X            FONTC = bdftosnf
  683. X        MKFONTDIR = mkfontdir
  684. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier.sh
  685. X
  686. X        CONFIGSRC = $(TOP)/config
  687. X        CLIENTSRC = $(TOP)/clients
  688. X          DEMOSRC = $(TOP)/demos
  689. X           LIBSRC = $(TOP)/lib
  690. X          FONTSRC = $(TOP)/fonts
  691. X       INCLUDESRC = $(TOP)/X11
  692. X        SERVERSRC = $(TOP)/server
  693. X          UTILSRC = $(TOP)/util
  694. X        SCRIPTSRC = $(UTILSRC)/scripts
  695. X       EXAMPLESRC = $(TOP)/examples
  696. X       CONTRIBSRC = $(TOP)/../contrib
  697. X           DOCSRC = $(TOP)/doc
  698. X           RGBSRC = $(TOP)/rgb
  699. X        DEPENDSRC = $(UTILSRC)/makedepend
  700. X         IMAKESRC = $(CONFIGSRC)
  701. X         XAUTHSRC = $(LIBSRC)/Xau
  702. X          XLIBSRC = $(LIBSRC)/X
  703. X           XMUSRC = $(LIBSRC)/Xmu
  704. X       TOOLKITSRC = $(LIBSRC)/Xt
  705. X       AWIDGETSRC = $(LIBSRC)/Xaw
  706. X       OLDXLIBSRC = $(LIBSRC)/oldX
  707. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  708. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  709. X     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
  710. X     EXTENSIONSRC = $(TOP)/extensions
  711. X
  712. X  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
  713. X     EXTENSIONLIB =  -lXext
  714. X
  715. X          DEPXLIB = $(DEPEXTENSIONLIB)
  716. X             XLIB = $(EXTENSIONLIB) -lX11
  717. X
  718. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  719. X         XAUTHLIB =  -lXau
  720. X
  721. X        DEPXMULIB =
  722. X           XMULIB = -lXmu
  723. X
  724. X       DEPOLDXLIB =
  725. X          OLDXLIB = -loldX
  726. X
  727. X      DEPXTOOLLIB =
  728. X         XTOOLLIB = -lXt
  729. X
  730. X        DEPXAWLIB =
  731. X           XAWLIB = -lXaw
  732. X
  733. X LINTEXTENSIONLIB = $(USRLIBDIR)/llib-lXext.ln
  734. X         LINTXLIB = $(USRLIBDIR)/llib-lX11.ln
  735. X          LINTXMU = $(USRLIBDIR)/llib-lXmu.ln
  736. X        LINTXTOOL = $(USRLIBDIR)/llib-lXt.ln
  737. X          LINTXAW = $(USRLIBDIR)/llib-lXaw.ln
  738. X
  739. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  740. X
  741. X         DEPLIBS1 = $(DEPLIBS)
  742. X         DEPLIBS2 = $(DEPLIBS)
  743. X         DEPLIBS3 = $(DEPLIBS)
  744. X
  745. ###########################################################################
  746. # Imake rules for building libraries, programs, scripts, and data files
  747. # rules:  $XConsortium: Imake.rules,v 1.67 89/12/18 17:14:15 jim Exp $
  748. X
  749. ###########################################################################
  750. # start of Imakefile
  751. X
  752. #
  753. # Make file for the BDF font to Postscript font converter
  754. #
  755. # If TOP is incorrectly defined, uncomment and change the following
  756. # line to point at the X11 distribution source.
  757. X
  758. #        TOP = /usr/local/src/X11/mit
  759. X
  760. X      SRCS  = bdftops.c
  761. X      OBJS  = bdftops.o
  762. X   INCLUDES = -I.
  763. X   PROGRAM  = bdftops
  764. X
  765. X PROGRAM = bdftops
  766. X
  767. all:: bdftops
  768. X
  769. bdftops: $(OBJS)
  770. X    $(RM) $@
  771. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  772. X
  773. saber_bdftops:
  774. X    #load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  775. X
  776. osaber_bdftops:
  777. X    #load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  778. X
  779. install:: bdftops
  780. X    $(INSTALL) -c $(INSTPGMFLAGS)   bdftops $(BINDIR)
  781. X
  782. install.man:: bdftops.man
  783. X    $(INSTALL) -c $(INSTMANFLAGS) bdftops.man $(MANDIR)/bdftops.1
  784. X
  785. depend::
  786. X    $(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  787. X
  788. lint:
  789. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  790. lint1:
  791. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  792. X
  793. clean::
  794. X    $(RM) $(PROGRAM)
  795. X
  796. ###########################################################################
  797. # common rules for all Makefiles - do not edit
  798. X
  799. emptyrule::
  800. X
  801. clean::
  802. X    $(RM_CMD) \#*
  803. X
  804. Makefile::
  805. X    -@if [ -f Makefile ]; then \
  806. X    echo "    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  807. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  808. X    else exit 0; fi
  809. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  810. X
  811. tags::
  812. X    $(TAGS) -w *.[ch]
  813. X    $(TAGS) -xw *.[ch] > TAGS
  814. X
  815. saber:
  816. X    #load $(ALLDEFINES) $(SRCS)
  817. X
  818. osaber:
  819. X    #load $(ALLDEFINES) $(OBJS)
  820. X
  821. ###########################################################################
  822. # empty rules for directories that do not have SUBDIRS - do not edit
  823. X
  824. install::
  825. X    @echo "install in $(CURRENT_DIR) done"
  826. X
  827. install.man::
  828. X    @echo "install.man in $(CURRENT_DIR) done"
  829. X
  830. Makefiles::
  831. X
  832. includes::
  833. X
  834. ###########################################################################
  835. # dependencies generated by makedepend
  836. X
  837. SHAR_EOF
  838. chmod 0664 bdftools/bdftops-1.1/Makefile ||
  839. echo 'restore of bdftools/bdftops-1.1/Makefile failed'
  840. Wc_c="`wc -c < 'bdftools/bdftops-1.1/Makefile'`"
  841. test 9117 -eq "$Wc_c" ||
  842.     echo 'bdftools/bdftops-1.1/Makefile: original size 9117, current size' "$Wc_c"
  843. rm -f _shar_wnt_.tmp
  844. fi
  845. # ============= bdftools/bintobdf-1.0/Imakefile ==============
  846. if test ! -d 'bdftools/bintobdf-1.0'; then
  847.     echo 'x - creating directory bdftools/bintobdf-1.0'
  848.     mkdir 'bdftools/bintobdf-1.0'
  849. fi
  850. if test -f 'bdftools/bintobdf-1.0/Imakefile' -a X"$1" != X"-c"; then
  851.     echo 'x - skipping bdftools/bintobdf-1.0/Imakefile (File already exists)'
  852.     rm -f _shar_wnt_.tmp
  853. else
  854. > _shar_wnt_.tmp
  855. echo 'x - extracting bdftools/bintobdf-1.0/Imakefile (Text)'
  856. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bintobdf-1.0/Imakefile' &&
  857. #
  858. # Make file for the binary to BDF font converter
  859. #
  860. X
  861. X      SRCS  = bintobdf.c
  862. X      OBJS  = bintobdf.o
  863. X   INCLUDES = -I. -I$(SERVERSRC)/include -I$(BDFTOSNFSRC)
  864. X   PROGRAM  = bintobdf
  865. X
  866. ComplexProgramTarget(bintobdf)
  867. SHAR_EOF
  868. chmod 0664 bdftools/bintobdf-1.0/Imakefile ||
  869. echo 'restore of bdftools/bintobdf-1.0/Imakefile failed'
  870. Wc_c="`wc -c < 'bdftools/bintobdf-1.0/Imakefile'`"
  871. test 217 -eq "$Wc_c" ||
  872.     echo 'bdftools/bintobdf-1.0/Imakefile: original size 217, current size' "$Wc_c"
  873. rm -f _shar_wnt_.tmp
  874. fi
  875. # ============= bdftools/bintobdf-1.0/bintobdf.c ==============
  876. if test -f 'bdftools/bintobdf-1.0/bintobdf.c' -a X"$1" != X"-c"; then
  877.     echo 'x - skipping bdftools/bintobdf-1.0/bintobdf.c (File already exists)'
  878.     rm -f _shar_wnt_.tmp
  879. else
  880. > _shar_wnt_.tmp
  881. echo 'x - extracting bdftools/bintobdf-1.0/bintobdf.c (Text)'
  882. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bintobdf-1.0/bintobdf.c' &&
  883. #include <stdio.h>
  884. #include <sys/types.h>
  885. #include <sys/stat.h>
  886. #include <sys/time.h>
  887. #include "bintobdf.h"
  888. #include "patchlevel.h"
  889. X
  890. char *program;               /* This program's name.                    */
  891. char *fontname = NULL;       /* BDF font name.                          */
  892. int rev_bytes_out = FALSE;   /* Reverse the character's bytes.          */
  893. int size = 16;               /* Default to 16x16 font.                  */
  894. int bytes_per_char = 0;      /* Bytes needed for each char.             */
  895. int bytes_skipped = 0;       /* Number of initial bytes to be skipped.  */
  896. int encoding_start = 0xa1a1; /* Initial encoding start.                 */
  897. int chars_per_row = 0x5e;    /* Number characters per row in font.      */
  898. int gen_n_chars = 0;         /* Only generate n charaters.              */
  899. int xoff = 0;                /* Character's x offset.                   */
  900. int yoff = -2;               /* Character's y offset.                   */
  901. int default_char = 0xa1a1;   /* Default char of BDF font.               */
  902. int total_chars = 0;         /* Total number of chars in input file.    */
  903. X
  904. /*
  905. X * Set the default architecture specific bit and byte orderings for bitmaps.
  906. X */
  907. int bitOrder  = DEFAULTBITORDER,
  908. X    byteOrder = DEFAULTBYTEORDER,
  909. X    scanUnit  = DEFAULTSCANUNIT;
  910. X
  911. /*
  912. X * Next three functions for adjusting bitmaps for different architectures.
  913. X */
  914. static void
  915. invertbits(buf, count)
  916. unsigned char *buf;
  917. int count;
  918. {
  919. X    int i, n, m;
  920. X    unsigned char c, oc;
  921. X
  922. X    for ( i = 0; i < count; i++ ) {
  923. X        c = buf[i];
  924. X        oc = 0;
  925. X        for (n=0, m=7; n < 8; n++, m--) {
  926. X            oc |= ((c >> n) & 1) << m;
  927. X        }
  928. X        buf[i] = oc;
  929. X    }
  930. }
  931. X
  932. static void
  933. invert2(buf, count)
  934. unsigned char *buf;
  935. int count;
  936. {
  937. X    int i;
  938. X    unsigned char c;
  939. X
  940. X    for ( i = 0; i < count; i += 2) {
  941. X        c = buf[i];
  942. X        buf[i] = buf[i+1];
  943. X        buf[i+1] = c;
  944. X    }
  945. }
  946. X
  947. static void
  948. invert4(buf, count)
  949. unsigned char *buf;
  950. int count;
  951. {
  952. X    int i;
  953. X    unsigned char c;
  954. X
  955. X    for (i = 0; i < count; i += 4) {
  956. X        c = buf[i];
  957. X        buf[i] = buf[i+3];
  958. X        buf[i+3] = c;
  959. X        c = buf[i+1];
  960. X        buf[i+1] = buf[i+2];
  961. X        buf[i+2] = c;
  962. X    }
  963. }
  964. X
  965. #define my_abs(x) (((x) < 0) ? -(x) : (x))
  966. X
  967. void
  968. genbdf(infile, outfile)
  969. FILE *infile, *outfile;
  970. {
  971. X    time_t clock;
  972. X    struct stat fsize;
  973. X
  974. X    int i, row, column, row_start, column_start;
  975. X    int start, end, inc;
  976. X    int swidth, dwidth;
  977. X    long int fsz, nfsz;
  978. X    int done;
  979. X    int bpcl, count, char_count;
  980. X    double resval;
  981. X
  982. X    unsigned char *in_buf;
  983. X
  984. X    time(&clock);
  985. X    fprintf(outfile, "STARTFONT 2.1\n");
  986. X    fprintf(outfile, "COMMENT GENERATED BY \"bin2bdf %d.%d\"\n",
  987. X            BINTOBDFVERSION, patchlevel);
  988. X    fprintf(outfile, "COMMENT AUTHOR %s\n", AUTHOR_STRING);
  989. X    fprintf(outfile, "COMMENT DATE %s", ctime(&clock));
  990. X    fprintf(outfile, "COMMENT\n");
  991. X    fprintf(outfile, "FONT %s\n", fontname);
  992. X    fprintf(outfile, "SIZE %d %d %d\n", size, DEFAULTXRES, DEFAULTYRES);
  993. X    fprintf(outfile, "FONTBOUNDINGBOX %d %d %d %d\n", size, size, xoff, yoff);
  994. X    fprintf(outfile, "STARTPROPERTIES 4\n");
  995. X    fprintf(outfile, "COPYRIGHT \"Public Domain\"\n");
  996. X    fprintf(outfile, "DEFAULT_CHAR %d\n", default_char);
  997. X    fprintf(outfile, "FONT_ASCENT %d\n", size + yoff);
  998. X    fprintf(outfile, "FONT_DESCENT %d\n", my_abs(yoff));
  999. X    fprintf(outfile, "ENDPROPERTIES\n");
  1000. X
  1001. X    if (fstat(fileno(infile), &fsize) < 0) {
  1002. X        fprintf(stderr, "%s: stat error on input file\n", program);
  1003. X        fclose(infile);
  1004. X        exit(-1);
  1005. X    }
  1006. X
  1007. X    fsz = nfsz = ((long int)fsize.st_size) - bytes_skipped;
  1008. X
  1009. X    if (bytes_skipped) {
  1010. X        if (fseek(infile, bytes_skipped, 0L) < 0) {
  1011. X            fprintf(stderr, "%s: fseek problem on input file.\n", program);
  1012. X            fclose(infile);
  1013. X            if (outfile != stdout)
  1014. X              fclose(outfile);
  1015. X        }
  1016. X    }
  1017. X
  1018. X    while(fsz % size) fsz--;
  1019. X    if ((nfsz - fsz) != 0) {
  1020. X        fprintf(stderr,
  1021. X                "%s: found odd number of bytes - skipping %d bytes forward.\n",
  1022. X                program, (nfsz - fsz));
  1023. X        if (fseek(infile, (nfsz - fsz), 1L) < 0) {
  1024. X            fprintf(stderr, "%s: fseek problem on input file.\n", program);
  1025. X            fclose(infile);
  1026. X            if (outfile != stdout)
  1027. X              fclose(outfile);
  1028. X        }
  1029. X    }
  1030. X
  1031. X    total_chars = fsz / bytes_per_char;
  1032. X    total_chars++;
  1033. X
  1034. X    if ((gen_n_chars == 0) || (gen_n_chars > total_chars))
  1035. X      gen_n_chars = total_chars;
  1036. X
  1037. X    resval = (((double)size)/1000.0) * (((double)DEFAULTXRES)/72.27);
  1038. X    swidth = (int)(((double)DEFAULTXRES)/resval) / 10;
  1039. X    dwidth = size;
  1040. X
  1041. X    fprintf(outfile, "CHARS %d\n", gen_n_chars);
  1042. X
  1043. X    row_start = (encoding_start >> 8) & 0xff;
  1044. X    column_start = encoding_start & 0xff;
  1045. X
  1046. X    row = row_start;
  1047. X    column = column_start;
  1048. X    done = FALSE;
  1049. X    bpcl = (size + 7) / 8;
  1050. X    in_buf = (unsigned char *)malloc(bytes_per_char * sizeof(unsigned char));
  1051. X
  1052. X    char_count = 0;
  1053. X    while(char_count < gen_n_chars && !feof(infile)) {
  1054. X        if ((column - column_start) == chars_per_row) {
  1055. X            column = column_start;
  1056. X            row++;
  1057. X        }
  1058. X
  1059. X        fprintf(outfile, "STARTCHAR %02x%02x\n", row & 0xff, column & 0xff);
  1060. X        fprintf(outfile, "ENCODING %d\n", ((row << 8) | column));
  1061. X        fprintf(outfile, "SWIDTH %d 0\n", swidth);
  1062. X        fprintf(outfile, "DWIDTH %d 0\n", size);
  1063. X        fprintf(outfile, "BBX %d %d %d %d\n", size, size, xoff, yoff);
  1064. X        fprintf(outfile, "BITMAP\n");
  1065. X
  1066. X
  1067. X        if (fread(in_buf, 1, bytes_per_char, infile) != bytes_per_char) {
  1068. X            if (!feof(infile)) {
  1069. X                fprintf(stderr,
  1070. X                        "%s: missing some bytes on the end of input file\n",
  1071. X                        program);
  1072. X                fclose(infile);
  1073. X                if (outfile != stdout)
  1074. X                  fclose(outfile);
  1075. X                exit(-1);
  1076. X            }
  1077. X        }
  1078. X
  1079. X        if (bitOrder == LSBFirst)
  1080. X          invertbits(in_buf, bytes_per_char);
  1081. X        if (bitOrder != byteOrder) {
  1082. X            if (scanUnit == 2)
  1083. X              invert2(in_buf, bytes_per_char);
  1084. X            else if (scanUnit == 4)
  1085. X              invert4(in_buf, bytes_per_char);
  1086. X        }
  1087. X
  1088. X        if (rev_bytes_out) {
  1089. X            start = bytes_per_char - 1;
  1090. X            end = inc = -1;
  1091. X        } else {
  1092. X            start = 0;
  1093. X            end = bytes_per_char;
  1094. X            inc = 1;
  1095. X        }
  1096. X
  1097. X        count = 0;
  1098. X        while (start != end) {
  1099. X            if (count == bpcl) {
  1100. X                putc('\n', outfile);
  1101. X                count = 0;
  1102. X            }
  1103. X            count++;
  1104. X            fprintf(outfile, "%02x", in_buf[start]);
  1105. X            start += inc;
  1106. X        }
  1107. X        fprintf(outfile, "\nENDCHAR\n");
  1108. X        column++;
  1109. X        char_count++;
  1110. X    }
  1111. X    fprintf(outfile, "ENDFONT\n");
  1112. }
  1113. X
  1114. char *
  1115. make_fontname(name)
  1116. char *name;
  1117. {
  1118. X    char *tmp_name, *ptr, *ptr1;
  1119. X    int len;
  1120. X
  1121. X    len = strlen(name) - 1;
  1122. X    ptr = ptr1 = name + len;
  1123. X    for (;*ptr && *ptr != DIR_SEP && ptr != name; ptr--) {}
  1124. X
  1125. X    if (!*ptr) {
  1126. X        fprintf(stderr, "%s: unexpected NULL in filename\n", program);
  1127. X        exit(-1);
  1128. X    }
  1129. X
  1130. X    for (;*ptr1 && *ptr1 != '.' && ptr1 != name; ptr1--) {}
  1131. X
  1132. X    if (ptr == name && ptr1 == name) {
  1133. X        tmp_name = (char *)malloc((len + 4) * sizeof(char));
  1134. X        sprintf(tmp_name, "%s%d", name, size);
  1135. X        return(tmp_name);
  1136. X    }
  1137. X
  1138. X    if (*ptr == DIR_SEP)
  1139. X      ptr++;
  1140. X
  1141. X    tmp_name = (char *)malloc((ptr1 - ptr + 5) * sizeof(char));
  1142. X    sprintf(tmp_name, "%.*s%d", (ptr1 - ptr), ptr, size);
  1143. X
  1144. X    return(tmp_name);
  1145. }
  1146. X
  1147. void
  1148. usage()
  1149. {
  1150. X    fprintf(stderr, "usage:  %s [-size #] [-skip #] [-cdefglmLMoruxy] ",
  1151. X            program);
  1152. X    fprintf(stderr, "infile\n");
  1153. X    exit(-1);
  1154. }
  1155. X
  1156. int
  1157. getint(str)
  1158. char *str;
  1159. {
  1160. X    if (!str)
  1161. X      usage();
  1162. X    return(atoi(str));
  1163. }
  1164. X
  1165. main(argc, argv)
  1166. int argc;
  1167. char **argv;
  1168. {
  1169. X    FILE *in = stdin, *out = stdout;
  1170. X    char next;
  1171. X
  1172. X    program = argv[0];
  1173. X    argc--;
  1174. X    *argv++;
  1175. X
  1176. X    if (!argc)
  1177. X      usage();
  1178. X
  1179. X    while(argc) {
  1180. X        if (argv[0][0] == '-') {
  1181. X            switch(argv[0][1]) {
  1182. X              case 'c':
  1183. X              case 'C':
  1184. X                argc--;
  1185. X                *argv++;
  1186. X                chars_per_row = getint(argv[0]);
  1187. X                break;
  1188. X              case 'd':
  1189. X              case 'D':
  1190. X                argc--;
  1191. X                *argv++;
  1192. X                default_char = getint(argv[0]);
  1193. X                break;
  1194. X              case 'e':
  1195. X              case 'E':
  1196. X                argc--;
  1197. X                *argv++;
  1198. X                encoding_start = getint(argv[0]);
  1199. X                break;
  1200. X              case 'f':
  1201. X              case 'F':
  1202. X                argc--;
  1203. X                *argv++;
  1204. X                if (argv[0])
  1205. X                  fontname = argv[0];
  1206. X                else
  1207. X                  usage();
  1208. X                break;
  1209. X              case 'g':
  1210. X              case 'G':
  1211. X                argc--;
  1212. X                *argv++;
  1213. X                gen_n_chars = getint(argv[0]);
  1214. X                break;
  1215. X              case 'L':
  1216. X                byteOrder = LSBFirst;
  1217. X                break;
  1218. X              case 'l':
  1219. X                bitOrder = LSBFirst;
  1220. X                break;
  1221. X              case 'M':
  1222. X                byteOrder = MSBFirst;
  1223. X                break;
  1224. X              case 'm':
  1225. X                bitOrder = MSBFirst;
  1226. X                break;
  1227. X              case 'o':
  1228. X              case 'O':
  1229. X                argc--;
  1230. X                *argv++;
  1231. X                if (argv[0]) {
  1232. X                    if (!(out = fopen(argv[0], "w+b"))) {
  1233. X                        fprintf(stderr, "%s: problem with output file %s\n",
  1234. X                                argv[0]);
  1235. X                        exit(-1);
  1236. X                    }
  1237. X                } else
  1238. X                  usage();
  1239. X                break;
  1240. X              case 'r':
  1241. X              case 'R':
  1242. X                rev_bytes_out = TRUE;
  1243. X                break;
  1244. X              case 's':
  1245. X              case 'S':
  1246. X                next = '\0';
  1247. X                switch(argv[0][2]) {
  1248. X                    /* Set char width to size by size bits. */
  1249. X                  case 'i':
  1250. X                  case 'I':
  1251. X                    argc--;
  1252. X                    *argv++;
  1253. X                    size = getint(argv[0]);
  1254. X                    break;
  1255. X                    /* Skip n bytes at beginning of file. */
  1256. X                  case 'k':
  1257. X                  case 'K':
  1258. X                    argc--;
  1259. X                    *argv++;
  1260. X                    bytes_skipped = getint(argv[0]);
  1261. X                    break;
  1262. X                  default:
  1263. X                    usage();
  1264. X                    break;
  1265. X                }
  1266. X                break;
  1267. X              case 'u':
  1268. X              case 'U':
  1269. X                argc--;
  1270. X                *argv++;
  1271. X                scanUnit = getint(argv[0]);
  1272. X                break;
  1273. X              case 'x':
  1274. X              case 'X':
  1275. X                argc--;
  1276. X                *argv++;
  1277. X                xoff = getint(argv[0]);
  1278. X                break;
  1279. X              case 'y':
  1280. X              case 'Y':
  1281. X                argc--;
  1282. X                *argv++;
  1283. X                yoff = atoi(argv[0]);
  1284. X                break;
  1285. X              default:
  1286. X                usage();
  1287. X                break;
  1288. X            }
  1289. X        } else {
  1290. X            if (fontname == NULL)
  1291. X              fontname = make_fontname(argv[0]);
  1292. X            
  1293. X            if (!(in = fopen(argv[0], "r+b"))) {
  1294. X                fprintf(stderr, "%s: problem with input file %s\n",
  1295. X                        program, argv[0]);
  1296. X                exit(-1);
  1297. X            }
  1298. X            bytes_per_char = ((size + 7) / 8) * size;
  1299. X            genbdf(in, out);
  1300. X            if (in != stdin)
  1301. X              fclose(in);
  1302. X            if (out != stdout)
  1303. X              fclose(out);
  1304. X        }
  1305. X        if (argc) {
  1306. X            argc--;
  1307. X            *argv++;
  1308. X        }
  1309. X    }
  1310. }
  1311. SHAR_EOF
  1312. chmod 0664 bdftools/bintobdf-1.0/bintobdf.c ||
  1313. echo 'restore of bdftools/bintobdf-1.0/bintobdf.c failed'
  1314. Wc_c="`wc -c < 'bdftools/bintobdf-1.0/bintobdf.c'`"
  1315. test 11688 -eq "$Wc_c" ||
  1316.     echo 'bdftools/bintobdf-1.0/bintobdf.c: original size 11688, current size' "$Wc_c"
  1317. rm -f _shar_wnt_.tmp
  1318. fi
  1319. # ============= bdftools/bintobdf-1.0/bintobdf.h ==============
  1320. if test -f 'bdftools/bintobdf-1.0/bintobdf.h' -a X"$1" != X"-c"; then
  1321.     echo 'x - skipping bdftools/bintobdf-1.0/bintobdf.h (File already exists)'
  1322.     rm -f _shar_wnt_.tmp
  1323. else
  1324. > _shar_wnt_.tmp
  1325. echo 'x - extracting bdftools/bintobdf-1.0/bintobdf.h (Text)'
  1326. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bintobdf-1.0/bintobdf.h' &&
  1327. #ifndef _bintobdf_h
  1328. #define _bintobdf_h
  1329. X
  1330. #include <X11/Xos.h>
  1331. #include <X11/Xmd.h>
  1332. #include <X11/X.h>
  1333. #include <X11/Xproto.h>
  1334. X
  1335. #include "fontstruct.h"
  1336. #include "bdftosnf.h"
  1337. X
  1338. #define AUTHOR_STRING "mleisher@nmsu.edu (Mark Leisher)"
  1339. #define BINTOBDFVERSION 1
  1340. X
  1341. #define FALSE 0
  1342. #define TRUE  1
  1343. X
  1344. /* Make sure the directory separator is defined for loading fonts. */
  1345. X
  1346. #ifndef DIR_SEP
  1347. #define DIR_SEP '/'
  1348. #endif
  1349. X
  1350. /*
  1351. X * This is the x and y resolution the font was designed at.
  1352. X * Most of the time, these values are just guessed at for bitmapped
  1353. X * fonts.
  1354. X */
  1355. #ifndef DEFAULTXRES
  1356. #define DEFAULTXRES 100
  1357. #endif
  1358. X
  1359. #ifndef DEFAULTYRES
  1360. #define DEFAULTYRES 100
  1361. #endif
  1362. X
  1363. #endif /* _bintobdf_h */
  1364. SHAR_EOF
  1365. chmod 0664 bdftools/bintobdf-1.0/bintobdf.h ||
  1366. echo 'restore of bdftools/bintobdf-1.0/bintobdf.h failed'
  1367. Wc_c="`wc -c < 'bdftools/bintobdf-1.0/bintobdf.h'`"
  1368. test 680 -eq "$Wc_c" ||
  1369.     echo 'bdftools/bintobdf-1.0/bintobdf.h: original size 680, current size' "$Wc_c"
  1370. rm -f _shar_wnt_.tmp
  1371. fi
  1372. # ============= bdftools/bintobdf-1.0/bintobdf.man ==============
  1373. if test -f 'bdftools/bintobdf-1.0/bintobdf.man' -a X"$1" != X"-c"; then
  1374.     echo 'x - skipping bdftools/bintobdf-1.0/bintobdf.man (File already exists)'
  1375.     rm -f _shar_wnt_.tmp
  1376. else
  1377. > _shar_wnt_.tmp
  1378. echo 'x - extracting bdftools/bintobdf-1.0/bintobdf.man (Text)'
  1379. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bintobdf-1.0/bintobdf.man' &&
  1380. .TH BINTOBDF 1 "Release 4" "X Version 11"
  1381. .SH NAME
  1382. bintobdf - Binary to BDF font converter for X11
  1383. .SH SYNOPSIS
  1384. .B "bintobdf"
  1385. [-c #] [-d #] [-e #] [-f name] [-g #] [-lmLM] [-o name] [-r] [-size #]
  1386. [-skip #] [-u #] [-x #] [-y #] bitmap-font-file
  1387. .SH DESCRIPTION
  1388. .PP
  1389. .B bintobdf
  1390. reads a raw bitmap font from the
  1391. specified file and writes an X11 Bitmap Distribution Format (BDF) to
  1392. standard output.
  1393. .SH OPTIONS
  1394. .TP 8
  1395. .B \-c #
  1396. The number following \fI-c\fP is the number of characters that will
  1397. appear in a row.  For instance, in the GB 2312-1980 and JIS X0208
  1398. encoding, there are 94 characters per row.  In the Big5 encoding,
  1399. there are 190 characters per row. (Default: 94)
  1400. .TP 8
  1401. .B \-d #
  1402. The number following \fI-d\fP will be the default character on the BDF
  1403. font.  (Default: \fIthe value for -e\fP)
  1404. .TP 8
  1405. .B \-e #
  1406. The number following \fI-e\fP will be the encoding value of the first
  1407. character in the BDF font.  For instance, the encoding starts at 41377
  1408. (0xa1a1) for GB 2312-1980, and the encoding starts at 8481 (0x2121) for
  1409. the JIS X0208 encoding.  The Big5 encoding starts at 41280 (0xa140).
  1410. .TP 8
  1411. .B \-f name
  1412. The string following \fI-f\fP will be the name used for the ``FONT''
  1413. entry of the BDF font. (Default: basename of the font concated with size)
  1414. .TP 8
  1415. .B \-g #
  1416. The number following \fI-g\fP indicates how many of the bitmap
  1417. characters to generate.  This is here for generating a limited number
  1418. of characters for testing purposes. (Default: calculated from raw
  1419. bitmap font file size and character size)
  1420. .TP 8
  1421. .B \-l
  1422. Force the bit order to least significant bit first.
  1423. .TP 8
  1424. .B \-m
  1425. Force the bit order to most significant bit first.
  1426. .TP 8
  1427. .B \-L
  1428. Force the byte order to least significant bit first.
  1429. .TP 8
  1430. .B \-M
  1431. Force the byte order to most significant bit first.
  1432. .TP 8
  1433. .B \-o name
  1434. Send the output to \fIname\fP instead of stdout.
  1435. .TP 8
  1436. .B \-r
  1437. Write each characters bytes in reverse order after they have been
  1438. adjusted for bit and byte order.
  1439. .TP 8
  1440. .B \-size #
  1441. The number following \fI-size\fP will be the width and height in bits
  1442. of each character. A lot of fonts that use two bytes per character are
  1443. either 16x16 or 24x24. (Default: 16)
  1444. .TP 8
  1445. .B \-skip #
  1446. The number that follows \fI-skip\fP will be the number of bytes
  1447. skipped at the beginning of the raw bitmap font file.  Occasionally, a
  1448. raw bitmap font file will have some sort of header information.
  1449. (Default: 0)
  1450. .TP 8
  1451. .B \-u #
  1452. The number that follows \fI-u\fP will be the scan unit for each
  1453. character's bitmap.  This value determines number of bytes that will
  1454. be swapped in setting bit and byte order of each character.  This
  1455. value shouldn't change for most Big<->Little Endian conversions.
  1456. If you are unsure if the target architecture needs this value changed,
  1457. check the \fBservermd.h\fP file in the X11 server source distribution.
  1458. (Default: 1)
  1459. .TP 8
  1460. .B \-x #
  1461. Set the X offset of the character in the BDF font.  For fonts that use
  1462. two bytes per character, a value of 0 usually looks alright. (Default: 0)
  1463. .TP 8
  1464. .B \-y #
  1465. Set the Y offset of the character in the BDF font.  In fonts that use
  1466. two bytes per character, a value of -2 usually looks alright. (Default: -2)
  1467. .SH "SEE ALSO"
  1468. XX(1), Xserver(1), bdftosnf(1), snftobdf(1), bdftops(1)
  1469. .br
  1470. "Bitmap Distribution Format 2.1"
  1471. .br
  1472. "X Logical Font Description Conventions"
  1473. .SH AUTHOR
  1474. Internet: mleisher@nmsu.edu   Bitnet: mleisher@nmsu.bitnet
  1475. .br
  1476. Mark Leisher
  1477. .br
  1478. Computing Research Lab
  1479. .br
  1480. New Mexico State University
  1481. .br
  1482. Las Cruces, NM 88003
  1483. .br
  1484. (505) 646-5711
  1485. X
  1486. SHAR_EOF
  1487. chmod 0664 bdftools/bintobdf-1.0/bintobdf.man ||
  1488. echo 'restore of bdftools/bintobdf-1.0/bintobdf.man failed'
  1489. Wc_c="`wc -c < 'bdftools/bintobdf-1.0/bintobdf.man'`"
  1490. test 3475 -eq "$Wc_c" ||
  1491.     echo 'bdftools/bintobdf-1.0/bintobdf.man: original size 3475, current size' "$Wc_c"
  1492. rm -f _shar_wnt_.tmp
  1493. fi
  1494. # ============= bdftools/bintobdf-1.0/patchlevel.h ==============
  1495. if test -f 'bdftools/bintobdf-1.0/patchlevel.h' -a X"$1" != X"-c"; then
  1496.     echo 'x - skipping bdftools/bintobdf-1.0/patchlevel.h (File already exists)'
  1497.     rm -f _shar_wnt_.tmp
  1498. else
  1499. > _shar_wnt_.tmp
  1500. echo 'x - extracting bdftools/bintobdf-1.0/patchlevel.h (Text)'
  1501. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bintobdf-1.0/patchlevel.h' &&
  1502. #define patchlevel 0
  1503. SHAR_EOF
  1504. chmod 0664 bdftools/bintobdf-1.0/patchlevel.h ||
  1505. echo 'restore of bdftools/bintobdf-1.0/patchlevel.h failed'
  1506. Wc_c="`wc -c < 'bdftools/bintobdf-1.0/patchlevel.h'`"
  1507. test 21 -eq "$Wc_c" ||
  1508.     echo 'bdftools/bintobdf-1.0/patchlevel.h: original size 21, current size' "$Wc_c"
  1509. rm -f _shar_wnt_.tmp
  1510. fi
  1511. # ============= bdftools/bintobdf-1.0/README ==============
  1512. if test -f 'bdftools/bintobdf-1.0/README' -a X"$1" != X"-c"; then
  1513.     echo 'x - skipping bdftools/bintobdf-1.0/README (File already exists)'
  1514.     rm -f _shar_wnt_.tmp
  1515. else
  1516. > _shar_wnt_.tmp
  1517. echo 'x - extracting bdftools/bintobdf-1.0/README (Text)'
  1518. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/bintobdf-1.0/README' &&
  1519. --------------------------------------------------------------------
  1520. Copyright (C) 1990 Mark Leisher.
  1521. X
  1522. Author: Mark Leisher (mleisher@nmsu.edu)
  1523. X
  1524. This program is free software; you can redistribute it and/or modify
  1525. it under the terms of the GNU General Public License as published by
  1526. the Free Software Foundation; either version 1, or (at your option)
  1527. any later version.
  1528. X
  1529. This program is distributed in the hope that it will be useful,
  1530. but WITHOUT ANY WARRANTY; without even the implied warranty of
  1531. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1532. GNU General Public License for more details.
  1533. X
  1534. A copy of the GNU General Public License can be obtained from this
  1535. program's author (send electronic mail to mleisher@nmsu.edu) or from
  1536. the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
  1537. 02139, USA.
  1538. --------------------------------------------------------------------
  1539. X
  1540. This program converts raw bitmap fonts into BDF format fonts.  It
  1541. allows for things like skipping headers on the input font and doing
  1542. bit and byte adjustments dependent on architecture.
  1543. X
  1544. I wrote bintobdf because I was tired of hacking out a new utility
  1545. every time I wanted to convert a raw bitmap font into a BDF font.
  1546. X
  1547. Bintobdf is designed primarily for fiddling with fonts that have a
  1548. large number of characters (i.e. some of the Oriental fonts), but it
  1549. can easily be used for just about any size raw bitmap font.  The only
  1550. real "gotcha" in the program is the assumption that the font's
  1551. characters are square.  This is hardcoded, so it would have to be
  1552. changed for other types of fonts.
  1553. X
  1554. Please send bug reports, enhancements, etc. to:
  1555. Internet: mleisher@nmsu.edu
  1556. Bitnet  : mleisher@nmsu.bitnet
  1557. SHAR_EOF
  1558. chmod 0664 bdftools/bintobdf-1.0/README ||
  1559. echo 'restore of bdftools/bintobdf-1.0/README failed'
  1560. Wc_c="`wc -c < 'bdftools/bintobdf-1.0/README'`"
  1561. test 1685 -eq "$Wc_c" ||
  1562.     echo 'bdftools/bintobdf-1.0/README: original size 1685, current size' "$Wc_c"
  1563. rm -f _shar_wnt_.tmp
  1564. fi
  1565. # ============= bdftools/snftobdf-1.4/Imakefile ==============
  1566. if test ! -d 'bdftools/snftobdf-1.4'; then
  1567.     echo 'x - creating directory bdftools/snftobdf-1.4'
  1568.     mkdir 'bdftools/snftobdf-1.4'
  1569. fi
  1570. if test -f 'bdftools/snftobdf-1.4/Imakefile' -a X"$1" != X"-c"; then
  1571.     echo 'x - skipping bdftools/snftobdf-1.4/Imakefile (File already exists)'
  1572.     rm -f _shar_wnt_.tmp
  1573. else
  1574. > _shar_wnt_.tmp
  1575. echo 'x - extracting bdftools/snftobdf-1.4/Imakefile (Text)'
  1576. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/snftobdf-1.4/Imakefile' &&
  1577. #
  1578. # Make file for the SNF to BDF font compiler
  1579. #
  1580. # If TOP is incorrectly defined, uncomment and change the following
  1581. # line to point at the X11 distribution source.
  1582. X
  1583. #        TOP = /usr/local/src/X11/mit
  1584. X
  1585. X      SRCS  = snftobdf.c input.c output.c
  1586. X      OBJS  = snftobdf.o input.o output.o
  1587. X   INCLUDES = -I. -I$(SERVERSRC)/include -I$(SERVERSRC)/ddx/snf \
  1588. X              -I$(BDFTOSNFSRC)
  1589. X   PROGRAM  = snftobdf
  1590. X
  1591. ComplexProgramTarget(snftobdf)
  1592. SHAR_EOF
  1593. chmod 0664 bdftools/snftobdf-1.4/Imakefile ||
  1594. echo 'restore of bdftools/snftobdf-1.4/Imakefile failed'
  1595. Wc_c="`wc -c < 'bdftools/snftobdf-1.4/Imakefile'`"
  1596. test 441 -eq "$Wc_c" ||
  1597.     echo 'bdftools/snftobdf-1.4/Imakefile: original size 441, current size' "$Wc_c"
  1598. rm -f _shar_wnt_.tmp
  1599. fi
  1600. # ============= bdftools/snftobdf-1.4/MANIFEST ==============
  1601. if test -f 'bdftools/snftobdf-1.4/MANIFEST' -a X"$1" != X"-c"; then
  1602.     echo 'x - skipping bdftools/snftobdf-1.4/MANIFEST (File already exists)'
  1603.     rm -f _shar_wnt_.tmp
  1604. else
  1605. > _shar_wnt_.tmp
  1606. echo 'x - extracting bdftools/snftobdf-1.4/MANIFEST (Text)'
  1607. sed 's/^X//' << 'SHAR_EOF' > 'bdftools/snftobdf-1.4/MANIFEST' &&
  1608. MANIFEST
  1609. SHAR_EOF
  1610. true || echo 'restore of bdftools/snftobdf-1.4/MANIFEST failed'
  1611. fi
  1612. echo 'End of bdftools/part part 1'
  1613. echo 'File bdftools/snftobdf-1.4/MANIFEST is continued in part 2'
  1614. echo 2 > _shar_seq_.tmp
  1615. exit 0
  1616.