home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume8 / her2vfont < prev    next >
Encoding:
Internet Message Format  |  1987-03-01  |  38.3 KB

  1. Subject:  v08i089:  Hershey fonts to 'vfont' rasterizer
  2. Newsgroups: mod.sources
  3. Approved: mirror!rs
  4.  
  5. Submitted by: William LeFebvre <phil@rice.edu>
  6. Mod.sources: Volume 8, Issue 89
  7. Archive-name: her2vfont
  8.  
  9. I have gotten many requests for this program, but I have been slow to
  10. resond to them.  Sorry about the delay.
  11.  
  12. This program, hfont, rasterizes characters from the public domain
  13. vector font called "Hershey's Repertory" using a symmetric DDA
  14. algorithm.  It stores the resulting fonts in vfont format.  I'm not
  15. sure if Bell Unix has the proper include file for vfont format:
  16. "/usr/include/vfont.h".  Some of you may have to go searching for it:
  17. I cannot provide it for you.
  18.  
  19. This software is provided AS IS.  I'm not particularly interested in
  20. supporting it, but I am providing it in the interests of sharing
  21. knowledge.  So don't expect this program to be as well polished as,
  22. say, "top" is.  Share and enjoy!
  23.  
  24.             William LeFebvre
  25.             Department of Computer Science
  26.             Rice University
  27.             <phil@Rice.edu>
  28.  
  29. ------------------------------ CUT HERE ------------------------------
  30. echo 'Start of distribution file hfont.shar:'
  31. echo 'Extracting README...'
  32. sed 's/^X//' > README << '/'
  33. XHFONT
  34. X
  35. XThis is a program that rasterizes the Hershey vector fonts using a
  36. Xsymmetric DDA.  It builds fonts in the standard vfont format.  It takes as
  37. Xinput lines describing what hershey character should be placed in what
  38. Xposition in the vfont, along with certain rasterization options.  It is
  39. Xcapable of building fonts of any point size using a pen shape provided by
  40. Xthe user.
  41. X
  42. XBefore running this program, you need the following files: hershey format
  43. Xfile, pen file, descriptor file.  I will describe each one in turn:
  44. X
  45. Xhershey format file:
  46. X   The standard Hershey repertory, as distributed, will do.  This program
  47. X   understands a rather loose format that includes the format used by
  48. X   Hershey.  The default is "occidental" in the current directory.
  49. X
  50. Xpen file:
  51. X   This describes the shape of the pen at various point sizes.  Each pen
  52. X   description in this file starts with the line "pen x" where "x" is the
  53. X   point size at which this pen should be used.  The last line in the file
  54. X   is always "penend".  Each pen itself is described with a simple diagram
  55. X   consisting of spaces and stars (*).  Here is an example of a simple pen
  56. X   shape:
  57. X
  58. X           *
  59. X          ***
  60. X           *
  61. X
  62. X   The file "pen.round" in this distribution will give you a good idea
  63. X   what a pen file should look like.  It is also the default.
  64. X
  65. Xdescriptor file:
  66. X   Hfont expects to see this on standard input.  You can type them in by
  67. X   hand from the terminal (especially convenient when testing things out),
  68. X   but it is best to keep permanent descriptions in separate files and
  69. X   use shell redirection when running hfont.  This file has two areas.
  70. X   Each line in the first area contains a keyword and possible arguments.
  71. X   This allows for description specific options.  The keywords and their
  72. X   functions are:
  73. X
  74. X        repertory filename
  75. X            use "filename" as the vector repertory rather than the default
  76. X
  77. X        maxchar num
  78. X            an outdated keyword that should no longer be used
  79. X
  80. X        pen filename
  81. X            use "pen" as the penfile
  82. X
  83. X        aspect num
  84. X            use the (fractional) number "num" as the standard aspect ratio
  85. X            for all characters (explained in more detail later)
  86. X
  87. X        charset
  88. X            start of the character set description
  89. X
  90. X   The "charset" keyword is always the last one, and it separates the
  91. X   first area from the second.  Each line after "charset" has the
  92. X   following form:
  93. X
  94. X        index,char[,vmot][,rxxx]
  95. X
  96. X   "index" is the character number of the desired character in the vector
  97. X   repertory (for example, 2001 is the Duplex Roman "A" in the Hershey
  98. X   occidental repertory); "char" is the character position in the vfont
  99. X   where the character will be placed (it can either be a single
  100. X   character, or "\" followed by an octal number -- simply "\" is sufficint
  101. X   for the backslash); "vmot" is a number giving vertical displacement;
  102. X   "rxxx" is a specific aspect ratio for this character (where "xxx" is
  103. X   replaced with a fractional number).
  104. X
  105. X   There are two options that can be specified in the "index" field.  If
  106. X   the index number is really "p", then an exact image of the drawing pen
  107. X   is used as a character.  If the index starts with a "s", remainder of
  108. X   the field is taken to be an integer specifying the width of a space.
  109. X   This space is then used as the character (and no bitmap is associated
  110. X   with it).  For example:
  111. X
  112. X        p,\210     places an image of the pen at octal 210 in the vfont.
  113. X        s15,\212   places a 15 pixel wide space at octal 212.
  114. X
  115. X   Oversight:  there is no way to generate a point size specific space.
  116. X
  117. XRasterizing options:
  118. X
  119. XVertical displacement:
  120. X   When I first wrote this, I found this option very useful.  It allows
  121. X   one to shift a character's rasterized image vertically.  So, for
  122. X   example, the same horizontal line can be used for a hyphen and an
  123. X   underline.  This also helped me get the fonts produced closer to what
  124. X   troff expected them to be.  The vertical displacement can be negative
  125. X   if desired.
  126. X
  127. XAspect ratio:
  128. X
  129. X   By default, all characters are rasterized with an aspect ratio of 1.
  130. X   The aspect ratio is a fraction:  the horizontal amplification divided by
  131. X   the vertical amplification.  Since this program is rasterizing a vector
  132. X   fonts, one can play such games with the co-ordinates during
  133. X   rasterization.  An aspect ratio of 1 is normal (and, thus, the
  134. X   default).  An aspect ratio of .8 will stretch characters vertically,
  135. X   and a ratio of 1.2 will stretch them horizontally.  Again, this option
  136. X   was deemed desirable for our applications at Rice.  I noticed that one
  137. X   of the primary differences between the Hershey duplex Roman font and a
  138. X   standard Times Roman font was that all the lower case Hershey
  139. X   characters looked like someone had stepped on them.  So, I played a
  140. X   little with varying aspect ratios and decided that a ratio of 0.8 for
  141. X   just the lower case characters came very close to the Times Roman font
  142. X   (I used the original AT&T troff documentation as a sample of a Times
  143. X   Roman font).  A standard aspect ratio can be defined for the whole font
  144. X   by using the "aspect" keyword at the front of the description, and
  145. X   individual ratios can be specified for each character as described above.
  146. X
  147. XAgain, examples of descriptor files are included in this distribution.
  148. XThey have a suffix of ".spec".  There is one for three of the four standard
  149. Xtroff fonts:  R, I, and B.  They should give you some good examples.  The
  150. Xspecial font (S) had a specially hand-crafted repertory file that
  151. Xcontained different character specifications for things like the bracket
  152. Xbuilding characters.  If you are interested in this special repertory send
  153. Xme mail and I can arrange to have it sent to you, provided you have
  154. Xalready obtained the original Hershey repertory on tape (this requires
  155. Xsigning a license agreement with NTIS, and some of the characters in this
  156. Xspecial repertory are straight from the original Hershey).
  157. X
  158. XA word about resolution:
  159. X
  160. XAs distributed, this program is set up to build 300 dpi fonts.  It should
  161. Xbe very easy to change this for other resolutions, but I haven't given much
  162. Xthought to how this would be done.  I suspect that it is as easy as
  163. Xchanging the preprocessor constant "PT_Scale" to a different value.
  164. X
  165. XI am also sending a file called extra.occ, which contains some extra
  166. Xcharacters defined in hershey format.  The descriptor files reference
  167. Xthese characters.  They are all the characters I needed for the three
  168. Xtroff fonts but couldn't find reasonable equivalents for in the original
  169. XHershey font.  If you want to run hfont with the descriptor files I am
  170. Xincluding, then you will either have to add these characters to your
  171. XHershey repertory (maintaining the ascending order), or remove the extra
  172. Xdefinitions from the descriptor files.
  173. X
  174. XFinally, there is a program called "vsc" (for Vfont Snarf Character),
  175. Xwhich helps you peruse a vfont file.  Give it the name of a vfont file as
  176. Xan argument, then it will print out the information in the font header
  177. Xarea.  Type a character followed by a return and it will print out, first,
  178. Xthe contents of the character dispatch, and then the raster image (in a
  179. Xvisible manner).
  180. X
  181. XA warning about Sun fonts:  the fonts used by the Sun workstation for
  182. XSuntools are not quite standard vfont format.  The bitmaps are padded out
  183. Xto a short word boundary rather than a byte boundary.  The fonts that this
  184. Xprogram produces will not work as Suntools fonts.  However, changing vfont
  185. Xso that it does produce the right format should be easy.
  186. X
  187. XI hope you find this useful.  I'm not really using this program much
  188. Xanymore, since the project I wrote it for fell through.  You are welcome
  189. Xto use it as you want, but please credit me as the original author (unless
  190. Xyou almost completely rewrite it).  I hate to say it, but I'm not really
  191. Xall that interested in bug fixes and small enhancements.  If you are
  192. Xhaving problems trying to track down a bug, I will lend what assistance I
  193. Xcan.  If you add something that you think is just really spectacular, drop
  194. Xme a line.  I'll be more interested in brief sketches than actual diffs.
  195. XEssentially, this is an "as is" free piece of software.
  196. X
  197. X                        William LeFebvre
  198. X                        Department of Computer Science
  199. X                        Rice University
  200. X                        <phil@Rice.edu>
  201. /
  202. echo 'Extracting Makefile...'
  203. sed 's/^X//' > Makefile << '/'
  204. X# Makefile for "hfont"; a program to rasterize Hershey font characters
  205. X#
  206. X# Written by William LeFebvre, Computer Science Department, Rice University
  207. X
  208. XFILES = README Makefile hfont.c painter.c vsc.c painter.h extra.occ \
  209. X    pen.round R.spec I.spec B.spec
  210. X
  211. Xall: hfont vsc
  212. X
  213. Xhfont: hfont.o painter.o
  214. X    cc $(CFLAGS) -o hfont hfont.o painter.o
  215. X
  216. Xvsc: vsc.o
  217. X    cc $(CFLAGS) -o vsc vsc.o
  218. X
  219. Xpainter.o: painter.c painter.h
  220. Xhfont.o: hfont.c painter.h
  221. X
  222. Xclean:
  223. X    rm -f hfont.o painter.o vsc.o hfont vsc core
  224. X
  225. Xshar:
  226. X    rm -f hfont.shar
  227. X    packmail 1000000 hfont.shar $(FILES)
  228. /
  229. echo 'Extracting hfont.c...'
  230. sed 's/^X//' > hfont.c << '/'
  231. X/*
  232. X *  hfont - build a vfont raster file from a hershey format vector file
  233. X *
  234. X *  Written by William LeFebvre, LCSE, Rice University
  235. X */
  236. X
  237. X# include <sys/types.h>
  238. X# include <vfont.h>
  239. X# include "painter.h"
  240. X
  241. X# define  No    0
  242. X# define  Yes    1
  243. X
  244. X# define  MAX_CHARS    256        /* number of chars in a vfont file */
  245. X# define  Headersize    (sizeof(struct header) + sizeof(struct dispatch) * MAX_CHARS)
  246. X
  247. X# define  PT_Scale    .14        /* scaling factor for point sizes */
  248. X# define  Base_scale    10.0        /* scaling factor for baseline */
  249. X
  250. Xchar   bitmap[Max_x][Max_y];
  251. Xchar   input[256];
  252. Xunsigned char filebuff[Max_x*(Max_y/8)];
  253. Xunsigned char *fbufp;
  254. Xdouble left_extent, right_extent;
  255. Xint    left_max, right_max;
  256. Xint    up_max, down_max;
  257. Xint    vtrans;
  258. Xdouble x_factor = 1.4;
  259. Xdouble y_factor = 1.4;
  260. Xdouble real_x_factor;
  261. Xdouble x_trans;
  262. Xdouble translate_x();
  263. XFILE   *vecfont;
  264. X
  265. Xint  left_ex;
  266. Xint  map_to_char;
  267. Xint  vfont;
  268. Xint  baseline;
  269. Xint  hi_char = 168;
  270. X
  271. Xchar verbose = No;
  272. X
  273. Xchar *gets();
  274. Xchar *vgets();
  275. Xchar *index();
  276. Xchar *process_option();
  277. X
  278. Xstruct header v_header;
  279. Xstruct dispatch v_character[256];
  280. X
  281. Xmain(argc, argv)
  282. X
  283. Xint  argc;
  284. Xchar *argv[];
  285. X
  286. X{
  287. X    int i;
  288. X    int j;
  289. X    int arg;
  290. X    int bytecnt;
  291. X    int pt_size = 0;
  292. X    int char_num;
  293. X    int space_char;
  294. X    int filesize;
  295. X    unsigned char bytemask;
  296. X    unsigned char byte;
  297. X    char *inp;
  298. X    char *p;
  299. X    static char repertory[256] = "occidental";
  300. X    static char pen_file[256] = "pen.round";
  301. X    static char buff[256];
  302. X    struct dispatch *character;
  303. X
  304. X    /* get optional arguments */
  305. X
  306. X    for (arg = 1; ((arg < argc) && (argv[arg][0] == '-')); arg++)
  307. X    {
  308. X    switch (argv[arg][1])
  309. X    {
  310. X        case 'p':        /* point size */
  311. X        pt_size = atoi(&argv[arg][2]);
  312. X        strcpy(buff, &argv[arg][2]);
  313. X        set_factor((double)pt_size * PT_Scale);
  314. X        break;
  315. X
  316. X        case 's':        /* scale factor */
  317. X        sscanf(&argv[arg][2], "%F", &x_factor);
  318. X        set_factor(x_factor);
  319. X        break;
  320. X
  321. X        case 'v':        /* verbose */
  322. X        verbose = Yes;
  323. X        break;
  324. X
  325. X        default:
  326. X        fprintf(stderr, "Illegal option `%s'\n", argv[arg]);
  327. X        exit(1);
  328. X    }
  329. X    }
  330. X    if (arg+1 > argc )
  331. X    {
  332. X    fprintf(stderr, "usage: hfont [-pn] [-sn] fontfile\n");
  333. X    exit(1);
  334. X    }
  335. X
  336. X    /* read options from stdin */
  337. X
  338. X    while (vgets(input) != NULL && strcmp(input, "charset") != 0)
  339. X    {
  340. X    /* get the option name */
  341. X    if ((p = index(input, ' ')) != 0)
  342. X    {
  343. X        *p = '\0';
  344. X    }
  345. X    while (*(++p) == ' ');
  346. X
  347. X    /* string switch on option names */
  348. X    if (strcmp(input, "repertory") == 0)
  349. X    {
  350. X        strcpy(repertory, p);
  351. X    }
  352. X    else if (strcmp(input, "maxchar") == 0)
  353. X    {
  354. X        hi_char = atoi(p);
  355. X    }
  356. X    else if (strcmp(input, "pen") == 0)
  357. X    {
  358. X        strcpy(pen_file, p);
  359. X    }
  360. X    else if (strcmp(input, "aspect") == 0)
  361. X    {
  362. X        x_factor *= atof(p);
  363. X    }
  364. X    else
  365. X    {
  366. X        fprintf(stderr, "Unknown option: `%s'\n", input);
  367. X        exit(1);
  368. X    }
  369. X    }
  370. X
  371. X    /* open the font files */
  372. X    if ((vecfont = fopen(repertory, "r")) == NULL)
  373. X    {
  374. X    perror(repertory);
  375. X    exit(1);
  376. X    }
  377. X    if ((vfont = creat(argv[arg], 0666)) == -1)
  378. X    {
  379. X    perror(argv[arg]);
  380. X    exit(1);
  381. X    }
  382. X
  383. X    /* read in the pens */
  384. X    if ((i = read_pens(pen_file, pt_size)) < 0)
  385. X    {
  386. X    if (i == -1)
  387. X    {
  388. X        perror("Pen file");
  389. X    }
  390. X    else
  391. X    {
  392. X        fprintf(stderr, "Pen file: couldn't find pen for %d point\n",
  393. X        pt_size);
  394. X    }
  395. X    exit(1);
  396. X    }
  397. X
  398. X    /* leave space for the header, character descriptors, and space bitmap */
  399. X    lseek(vfont, Headersize + 2, 0);
  400. X    filesize = 2;
  401. X
  402. X    /* remember what the real x factor is */
  403. X
  404. X    real_x_factor = x_factor;
  405. X
  406. X    /* translate the characters */
  407. X
  408. X    while(vgets(input) != NULL)
  409. X    {
  410. X    /* get the character desired */
  411. X
  412. X    space_char = char_num = 0;
  413. X    if (input[0] == 's')
  414. X    {
  415. X        /* space character of specified width */
  416. X        space_char = atoi(&(input[1]));
  417. X    }
  418. X    else if (input[0] == 'p')
  419. X    {
  420. X        /* image of the drawing pen */
  421. X        char_num = -1;
  422. X    }
  423. X    else
  424. X    {
  425. X        /* normal vector character */
  426. X        char_num = atoi(input);
  427. X    }
  428. X
  429. X    /* find the font character to use */
  430. X
  431. X    if ((inp = index(input, ',')) == 0)
  432. X    {
  433. X        fprintf(stderr, "bad character designation in `%s'\n",
  434. X        input);
  435. X        break;
  436. X    }
  437. X    if ((inp[1] == '\\') && (inp[2] != '\0'))
  438. X    {
  439. X        /* octal format */
  440. X        sscanf(&(inp[2]), "%o", &map_to_char);
  441. X    }
  442. X    else
  443. X    {
  444. X        /* character format */
  445. X        map_to_char = inp[1];
  446. X    }
  447. X
  448. X    /* check for extra options */
  449. X
  450. X    vtrans = 0;
  451. X    inp += 2;
  452. X    if ((inp = process_option(inp)) != 0)
  453. X    {
  454. X        process_option(inp);
  455. X    }
  456. X
  457. X    /* get a pointer to the character descriptor */
  458. X
  459. X    character = &(v_character[map_to_char]);
  460. X
  461. X    /* find the character in the Hershey font */
  462. X
  463. X    if (space_char != 0)
  464. X    {
  465. X        /* this is a special width space character */
  466. X        character->nbytes = 2;
  467. X        character->addr = 0;
  468. X        character->up = character->down =
  469. X        character->left = character->right = 0;
  470. X        character->width = space_char;
  471. X    }
  472. X    else
  473. X    {
  474. X        /* normal hershey character */
  475. X        /* clear the bitmap */
  476. X        bzero(bitmap, sizeof(bitmap));
  477. X
  478. X        if (char_num == -1)
  479. X        {
  480. X        /* paint just one blotch of the pen at the center */
  481. X        reset_painter();
  482. X        paint(0, baseline - Y_center, 0, 0, 2);
  483. X        }
  484. X        else
  485. X        {
  486. X        /* find and paint a vector character */
  487. X        if (find_num(char_num) != 0)
  488. X        {
  489. X            fprintf(stderr, "character %d not found\n", char_num);
  490. X            break;
  491. X        }
  492. X    
  493. X        /* paint the character */
  494. X        paint_char(vtrans);
  495. X        }
  496. X
  497. X        /* get integer left extent */
  498. X        left_ex = (int)(left_extent - 0.5) + X_center;
  499. X
  500. X        /* fill in the character descriptor */
  501. X        character->width =
  502. X        (int)(right_extent - left_extent + 0.5);
  503. X
  504. X        character->down   = down_max - baseline;
  505. X        character->up     = baseline - up_max;
  506. X        character->left   = left_ex - left_max;
  507. X        character->right  = right_max - left_ex + 1;
  508. X        character->addr   = filesize;
  509. X        character->nbytes = bytecnt = ((right_max - left_max + 8) >> 3) *
  510. X                    (down_max - up_max);
  511. X
  512. X        /* write the bitmap --- this is a problem */
  513. X        fbufp = filebuff;
  514. X        for (i = up_max; i <= down_max; i++)
  515. X        {
  516. X        for (j = left_max; j <= right_max; )
  517. X        {
  518. X            byte = 0;
  519. X            for (bytemask=0x80; bytemask != 0; (bytemask >>= 1, j++))
  520. X            {
  521. X            byte |= (bitmap[j][i] ? bytemask : 0);
  522. X            }
  523. X            *fbufp++ = byte;
  524. X        }
  525. X        }
  526. X        write(vfont, filebuff, bytecnt);
  527. X        filesize += bytecnt;
  528. X
  529. X    }
  530. X
  531. X    /* restore x factor */
  532. X    x_factor = real_x_factor;
  533. X    }
  534. X
  535. X    /* write the font header with the real file size */
  536. X    v_header.size = filesize;
  537. X    v_header.magic = 0436;
  538. X    v_header.maxx = v_header.maxy = v_header.xtend = 0;
  539. X    lseek(vfont, 0, 0);
  540. X    write(vfont, &v_header, sizeof(v_header));
  541. X
  542. X    /* write the character dispatch area */
  543. X    write(vfont, v_character, sizeof(v_character));
  544. X
  545. X    close(vfont);
  546. X}
  547. X
  548. X/*
  549. X *  set_factor - set a new scaling factor (and all things associated with it)
  550. X */
  551. X
  552. Xset_factor(factor)
  553. X
  554. Xdouble factor;
  555. X
  556. X{
  557. X    y_factor = x_factor = factor;
  558. X    baseline = (int)(Base_scale * factor + 0.5) + Y_center;
  559. X    if (verbose)
  560. X    {
  561. X    fprintf(stderr, "scaling factor = %f, baseline = %d\n",
  562. X        y_factor, baseline);
  563. X    }
  564. X}
  565. X
  566. X/*
  567. X *  process_option(ptr) - process possible line option pointed to by ptr.
  568. X */
  569. X
  570. Xchar *process_option(ptr)
  571. X
  572. Xchar *ptr;
  573. X
  574. X{
  575. X    if ((ptr = index(ptr, ',')) != 0)
  576. X    {
  577. X    ptr++;
  578. X    if (ptr[0] == 'r')
  579. X    {
  580. X        /* aspect ratio */
  581. X        x_factor *= atof(&ptr[1]);
  582. X    }
  583. X    else
  584. X    {
  585. X        /* assume it's vertical translation */
  586. X        vtrans = atoi(&(ptr[0]));
  587. X    }
  588. X    }
  589. X    return(ptr);
  590. X}
  591. X
  592. Xchar *vgets(buff)
  593. X
  594. Xregister char *buff;
  595. X
  596. X{
  597. X    register char *retval;
  598. X
  599. X    if ((retval = gets(buff)) != NULL && verbose)
  600. X    {
  601. X    fprintf(stderr, "%s\n", buff);
  602. X    }
  603. X    return(retval);
  604. X}
  605. /
  606. echo 'Extracting painter.c...'
  607. sed 's/^X//' > painter.c << '/'
  608. X# include "painter.h"
  609. X
  610. X# define  No    0
  611. X# define  Yes    1
  612. X
  613. Xextern char   bitmap[Max_x][Max_y];
  614. Xextern char   input[256];
  615. Xextern double left_extent, right_extent;
  616. Xextern int    left_max, right_max;
  617. Xextern int    up_max, down_max;
  618. Xextern double x_factor;
  619. Xextern double y_factor;
  620. Xextern double x_trans;
  621. Xextern double translate_x();
  622. Xextern FILE   *vecfont;
  623. Xint  vtrans;
  624. Xchar shape_area[1024];        /* holds pen shapes */
  625. Xchar *shape_hi = shape_area;
  626. X
  627. Xextern int errno;
  628. X
  629. X/* functions that adjust int/frac pairs (referenced in paint_line) */
  630. Xint adjust_down();
  631. Xint adjust_up();
  632. Xint adjust_no();
  633. Xint (*set_adjust())();
  634. X
  635. X/* setup the painting pen */
  636. X
  637. Xstruct pen
  638. X{
  639. X    int  x_off;
  640. X    int  y_off;
  641. X    char *shape;
  642. X}
  643. X    pen;
  644. X
  645. X/* each byte in shape_area is one of: */
  646. X
  647. X#define    Pen_blank    0
  648. X#define    Pen_full    3
  649. X#define    Pen_pos    2
  650. X#define    Pen_neg    1
  651. X#define    Pen_eol    4
  652. X#define    Pen_eop    12
  653. X
  654. X/*
  655. X *  read_pens(filename, point) - read in the pen shapes from "filename" and
  656. X *                   select the pen for size "point".  If point
  657. X *                   is 0, just use the first pen in the file.
  658. X */
  659. X
  660. Xread_pens(filename, point)
  661. X
  662. Xchar *filename;
  663. Xint  point;
  664. X
  665. X{
  666. X    FILE *f;
  667. X    int x, y, xmax;
  668. X    int found;
  669. X    char ch;
  670. X    char line[256];
  671. X    char *pshape;
  672. X
  673. X    /* open the pen file */
  674. X    if ((f = fopen(filename, "r")) == NULL)
  675. X    {
  676. X    return(-1);
  677. X    }
  678. X
  679. X    /* find the right sized pen */
  680. X    found = No;
  681. X    while (!found)
  682. X    {
  683. X    if (fgets(line, sizeof(line), f) == NULL)
  684. X    {
  685. X        fclose(f);
  686. X        return(-2);
  687. X    }
  688. X    if (sscanf(line, "pen %d", &x) == 1 && (x == point || point == 0))
  689. X    {
  690. X        /* found it */
  691. X        found = Yes;
  692. X    }
  693. X    }
  694. X    
  695. X    /* get this pen */
  696. X    /* preset extremes and such */
  697. X    xmax = x = y = 0;
  698. X    pen.shape = pshape = shape_hi;
  699. X
  700. X    /* one character at a time ... */
  701. X    while ((ch = getc(f)) != 'p')
  702. X    {
  703. X    switch(ch)
  704. X    {
  705. X        case EOF:
  706. X        /* that wasn't supposed to happen */
  707. X        fclose(f);
  708. X        return(-2);
  709. X
  710. X        case '*':
  711. X        /* completely filled in */
  712. X        *pshape++ = Pen_full;
  713. X        x++;
  714. X        break;
  715. X
  716. X        case '/':
  717. X        /* filled in only on positive slope */
  718. X        *pshape++ = Pen_pos;
  719. X        x++;
  720. X        break;
  721. X
  722. X        case '\\':
  723. X        /* filled in only on negative slope */
  724. X        *pshape++ = Pen_neg;
  725. X        x++;
  726. X        break;
  727. X
  728. X        case '\n':
  729. X        /* end of line */
  730. X        *pshape++ = Pen_eol;
  731. X        y++;
  732. X        if (xmax < x)
  733. X            xmax = x;
  734. X        x = 0;
  735. X        break;
  736. X
  737. X        default:
  738. X        /* anything else is not filled in */
  739. X        *pshape++ = Pen_blank;
  740. X        x++;
  741. X        /* break; */
  742. X    }
  743. X
  744. X    /* calculate offsets */
  745. X    pen.x_off = (xmax - 1) / 2;
  746. X    pen.y_off = (y - 1) / 2;
  747. X    }
  748. X
  749. X    /* set end of pen marker */
  750. X    *pshape++ = Pen_eop;
  751. X
  752. X    /* throw away rest of delimiting line and reset high water mark */
  753. X    fgets(line, 132, f);
  754. X    shape_hi = pshape;
  755. X
  756. X    /* close and leave */
  757. X    fclose(f);
  758. X    return(0);
  759. X}
  760. X
  761. X/*
  762. X *  find_num(num) - scan thru the font file to find character "num"
  763. X */
  764. X
  765. Xfind_num(num)
  766. X
  767. Xint num;
  768. X
  769. X{
  770. X    static int last_char_num = 0;
  771. X    int this_num;
  772. X
  773. X    /* check for special case num = 0 */
  774. X
  775. X    if (num == 0)
  776. X    {
  777. X    /* use the next one in the file */
  778. X    if (fgets(input, 256, vecfont) == NULL)
  779. X        return(-1);
  780. X    last_char_num = atoi(input);
  781. X    fseek(vecfont, -strlen(input), 1);
  782. X    printf("%d\n", last_char_num);
  783. X    return(0);
  784. X    }
  785. X
  786. X    /* rewind the file if the character is behind us */
  787. X
  788. X    if (last_char_num >= num)
  789. X    {
  790. X    rewind(vecfont);
  791. X    }
  792. X
  793. X    /* check the first number on each line */
  794. X
  795. X    while(fgets(input, 256, vecfont) != NULL)
  796. X    {
  797. X    if ((this_num = atoi(input)) == num)
  798. X    {
  799. X        /* found it -- back up over the line */
  800. X        fseek(vecfont, -strlen(input), 1);
  801. X
  802. X        /* remember where we are and return success */
  803. X        last_char_num = num;
  804. X        return(0);
  805. X    }
  806. X    if (this_num > num)
  807. X    {
  808. X        /* we have gone past it -- it doesn't exist */
  809. X        /* remember where we are and return failure */
  810. X        last_char_num = this_num;
  811. X        return(-1);
  812. X    }
  813. X    }
  814. X    /* off the end of the file */
  815. X    /* remember this and return failure */
  816. X    last_char_num = 32000;
  817. X    return(-1);
  818. X}
  819. X
  820. X/*
  821. X *  paint_char() - paint the character where vecfont is positioned
  822. X */
  823. X
  824. Xpaint_char(vtr)
  825. X
  826. Xint vtr;        /* vertical translation */
  827. X
  828. X{
  829. X    double x, y;
  830. X    double new_x, new_y;
  831. X    int ret;
  832. X    int i, j;
  833. X
  834. X    /* set vertical translation */
  835. X
  836. X    vtrans = vtr;
  837. X
  838. X    /* get the extents of the character */
  839. X    move_to_colon();
  840. X    get_pair(&i, &j);
  841. X
  842. X    /* calculate translation factors and translate extents */
  843. X
  844. X    x_trans      = -((double)i + (double)j) / 2.;
  845. X    left_extent  = translate_x(i);
  846. X    right_extent = translate_x(j);
  847. X    
  848. X    /* reset the painting process */
  849. X    reset_painter();
  850. X
  851. X    /* grab succesive pairs and paint lines between them */
  852. X    get_adj_pair(&x, &y);
  853. X    while ((ret = get_adj_pair(&new_x, &new_y)) != -1)
  854. X    {
  855. X    if (ret == 1)
  856. X    {
  857. X        /* pen up */
  858. X        get_adj_pair(&x, &y);
  859. X    }
  860. X    else
  861. X    {
  862. X        paint_line(x, y, new_x, new_y);
  863. X        x = new_x;
  864. X        y = new_y;
  865. X    }
  866. X    }
  867. X}
  868. X
  869. Xreset_painter()
  870. X
  871. X{
  872. X    left_max = right_max = X_center;
  873. X    up_max   = down_max  = Y_center;
  874. X}
  875. X
  876. X/*
  877. X *  get_pair(px, py) - get a pair of numbers from vecfont
  878. X */
  879. X
  880. Xget_pair(px, py)
  881. X
  882. Xint *px;
  883. Xint *py;
  884. X
  885. X{
  886. X    char ch;
  887. X
  888. X    if ((ch = getc(vecfont)) == '\n')
  889. X    {
  890. X    move_to_colon();
  891. X    }
  892. X    else
  893. X    {
  894. X    ungetc(ch, vecfont);
  895. X    }
  896. X    fscanf(vecfont, "%d %d", px, py);
  897. X    move_to_colon();
  898. X    if (*px != -64)
  899. X    return(0);
  900. X
  901. X    if (*py == 0)
  902. X    return(1);
  903. X
  904. X    while(getc(vecfont) != '\n')
  905. X    /* read */;
  906. X
  907. X    return(-1);
  908. X}
  909. X
  910. X/*
  911. X *  get_adj_pair(px, py) - get an adjusted pair of numbers
  912. X */
  913. X
  914. Xget_adj_pair(px, py)
  915. X
  916. Xdouble *px;
  917. Xdouble *py;
  918. X
  919. X{
  920. X    int ret;
  921. X    int x, y;
  922. X
  923. X    if ((ret = get_pair(&x, &y)) == 0)
  924. X    {
  925. X    *px = translate_x(x);
  926. X    *py = ((double)(y + vtrans) * y_factor);
  927. X    }
  928. X    return(ret);
  929. X}
  930. X
  931. Xdouble translate_x(x)
  932. X
  933. Xint x;
  934. X
  935. X{
  936. X    return(((double)x + x_trans) * x_factor);
  937. X}
  938. X
  939. X/*
  940. X *  move_to_colon() - move to the next colon in vecfont
  941. X */
  942. X
  943. Xmove_to_colon()
  944. X
  945. X{
  946. X    while(getc(vecfont) != ':')
  947. X    /* keep going */;
  948. X
  949. X    return;
  950. X}
  951. X
  952. X/*
  953. X *  paint_line - paints a line from one point to another, based on
  954. X *         a symmetric DDA algorithm
  955. X */
  956. X
  957. Xpaint_line(x1, y1, x2, y2)
  958. X
  959. Xdouble x1;
  960. Xdouble y1;
  961. Xdouble x2;
  962. Xdouble y2;
  963. X
  964. X{
  965. X    double diff_x2_x1;
  966. X    double diff_y2_y1;
  967. X    double x;
  968. X    double y;
  969. X    double x_frac;
  970. X    double y_frac;
  971. X    double x_inc;
  972. X    double y_inc;
  973. X    double epsilon = 0.0078125;    /* 2 ^ -7 */
  974. X    int i;
  975. X    int x_int;
  976. X    int y_int;
  977. X    int slope;
  978. X    int (*x_adjust)();
  979. X    int (*y_adjust)();
  980. X    register int xchange;
  981. X    register int ychange;
  982. X
  983. X#ifdef DEBUG
  984. X    fprintf(stderr, "painting a line from %f,%f to %f,%f\n", x1, y1, x2, y2);
  985. X#endif
  986. X    
  987. X#ifdef notdef
  988. X    /* for now, make sure we travel in a negative y direction */
  989. X    if (y1 < y2)
  990. X    {
  991. X    x  = x1;
  992. X    x1 = x2;
  993. X    x2 = x;
  994. X    y  = y1;
  995. X    y1 = y2;
  996. X    y2 = y;
  997. X    }
  998. X# endif
  999. X
  1000. X    x = x1;
  1001. X    y = y1;
  1002. X
  1003. X    /* separaate x and y into integer and fraction */
  1004. X    x_frac = x - (double)(x_int = (int)x);
  1005. X    y_frac = y - (double)(y_int = (int)y);
  1006. X
  1007. X    /* determine differences and increments */
  1008. X    x_inc = (diff_x2_x1 = x2 - x1) * epsilon;
  1009. X    y_inc = (diff_y2_y1 = y2 - y1) * epsilon;
  1010. X
  1011. X    /*
  1012. X     *  set the "adjust" routine pointers to appropriate values, and insure
  1013. X     *    that the frac values are in the correct range: (-1, 0] going
  1014. X     *    downward and [0, 1) going upward.
  1015. X     */
  1016. X    x_adjust = set_adjust(&x_int, &x_frac, diff_x2_x1);
  1017. X    y_adjust = set_adjust(&y_int, &y_frac, diff_y2_y1);
  1018. X#ifdef DEBUG
  1019. X    fprintf(stderr, "after adjust: x = %d + %e, y = %d + %e\n",
  1020. X    x_int, x_frac, y_int, y_frac);
  1021. X#endif
  1022. X
  1023. X    /* calculate the line slope */
  1024. X    slope = sign(diff_x2_x1) == sign(diff_y2_y1) ? Pen_pos : Pen_neg;
  1025. X
  1026. X    /* paint the first pixel */
  1027. X    paint(x_int, y_int, 1, 1, slope);
  1028. X
  1029. X#ifdef DEBUG
  1030. X    fprintf(stderr, "x_inc = %e, y_inc = %e\n", x_inc, y_inc);
  1031. X#endif
  1032. X    for (i=0; i < 128; i++)
  1033. X    {
  1034. X    x_frac += x_inc;
  1035. X    y_frac += y_inc;
  1036. X    xchange = (*x_adjust)(&x_int, &x_frac);
  1037. X    ychange = (*y_adjust)(&y_int, &y_frac);
  1038. X    if (xchange || ychange)
  1039. X    {
  1040. X#ifdef DEBUG
  1041. X        fprintf(stderr, "change (%c%c): x = %d + %f, y = %d + %f\n",
  1042. X        xchange ? 'x' : ' ', ychange ? 'y' : ' ',
  1043. X        x_int, x_frac, y_int, y_frac);
  1044. X#endif
  1045. X        paint(x_int, y_int, (x_frac < 0.5), (y_frac < 0.5), slope);
  1046. X    }
  1047. X    }
  1048. X}
  1049. X
  1050. X/*
  1051. X *  int/frac pair adjusting routines.  These routines all have the form:
  1052. X *
  1053. X *  adjust_xx(int_part, frac_part) - adjust integer / fraction pair, return
  1054. X *                     Yes if adjustment was necessary, o/w No
  1055. X *
  1056. X *  The names are as follows:
  1057. X *    adjust_down() - adjust for a pair that is being decremented
  1058. X *    adjust_up()   - adjust for a pair that is being incremented
  1059. X *      adjust_no()   - never adjust (for a pair that never changes)
  1060. X */
  1061. X
  1062. Xadjust_down(int_part, frac_part)
  1063. X
  1064. Xint    *int_part;
  1065. Xdouble *frac_part;
  1066. X
  1067. X{
  1068. X    if (*frac_part <= -0.5)
  1069. X    {
  1070. X    if (*frac_part < -1.5)
  1071. X    {
  1072. X        fprintf(stderr, "symmetric DDA jump %d (< -1)\n",
  1073. X            (int)*frac_part);
  1074. X    }
  1075. X    (*int_part)--;
  1076. X    *frac_part += 1.;
  1077. X#ifdef DEBUG
  1078. X    fprintf(stderr, "adjust got downward change: ");
  1079. X#endif
  1080. X    return(Yes);
  1081. X    }
  1082. X    return(No);
  1083. X}
  1084. X
  1085. Xadjust_up(int_part, frac_part)
  1086. X
  1087. Xint    *int_part;
  1088. Xdouble *frac_part;
  1089. X
  1090. X{
  1091. X    if (*frac_part >= 0.5)
  1092. X    {
  1093. X    if (*frac_part > 1.5)
  1094. X    {
  1095. X        fprintf(stderr, "symmetric DDA jump %d (> 1)\n",
  1096. X            (int)*frac_part);
  1097. X    }
  1098. X    (*int_part)++;
  1099. X    *frac_part -= 1.;
  1100. X#ifdef DEBUG
  1101. X    fprintf(stderr, "adjust got upward change: ");
  1102. X#endif
  1103. X    return(Yes);
  1104. X    }
  1105. X    return(No);
  1106. X}
  1107. X
  1108. Xadjust_no(int_part, frac_part)
  1109. X
  1110. Xint    *int_part;
  1111. Xdouble *frac_part;
  1112. X
  1113. X{
  1114. X    return(No);
  1115. X}
  1116. X
  1117. Xint (*set_adjust(intp, fracp, direct))()
  1118. X
  1119. Xint *intp;
  1120. Xdouble *fracp;
  1121. Xdouble direct;
  1122. X
  1123. X{
  1124. X    /* frac needs to be in the range [-0.5, 0.5] */
  1125. X    if (*fracp >  0.5)
  1126. X    {
  1127. X    *fracp -= 1.0;
  1128. X    (*intp)++;
  1129. X    }
  1130. X    if (*fracp < -0.5)
  1131. X    {
  1132. X    *fracp += 1.0;
  1133. X    (*intp)--;
  1134. X    }
  1135. X    return(direct < 0.0 ? adjust_down : direct > 0.0 ? adjust_up : adjust_no);
  1136. X}
  1137. X
  1138. Xpaint(x, y, xhalf, yhalf, slope)
  1139. X
  1140. Xint x;
  1141. Xint y;
  1142. Xint xhalf;
  1143. Xint yhalf;
  1144. Xint slope;
  1145. X
  1146. X{
  1147. X    int x_low, x_hi;
  1148. X    int y_low, y_hi;
  1149. X    register int ix, iy, ixstart;
  1150. X    register char *pshape;
  1151. X
  1152. X#ifdef DEBUG
  1153. X    fprintf(stderr, "painting %d, %d\n", x, y);
  1154. X#endif
  1155. X
  1156. X    /* center the points in our bitmap */
  1157. X
  1158. X    ix = x + X_center;
  1159. X    iy = y + Y_center;
  1160. X
  1161. X    /* move bitmap pointers to upper left corner of pen */
  1162. X    ix -= pen.x_off;
  1163. X    iy -= pen.y_off;
  1164. X    ixstart = ix;
  1165. X
  1166. X    /* check maximums */
  1167. X    if (ix < left_max)
  1168. X    left_max = ix;
  1169. X    if (iy < up_max)
  1170. X    up_max = iy;
  1171. X
  1172. X    /* color in the shape of the pen */
  1173. X
  1174. X    for (pshape = pen.shape; *pshape != Pen_eop; pshape++)
  1175. X    {
  1176. X    if (*pshape == Pen_eol)
  1177. X    {
  1178. X        if (ix > right_max)
  1179. X        right_max = ix;
  1180. X        ix = ixstart;
  1181. X        iy++;
  1182. X    }
  1183. X    else
  1184. X    {
  1185. X        if (*pshape & slope)
  1186. X        {
  1187. X        bitmap[ix][iy] = Yes;
  1188. X        }
  1189. X        ix++;
  1190. X    }
  1191. X    }
  1192. X
  1193. X    /* check y_down maximum */
  1194. X
  1195. X    if (iy  > down_max)
  1196. X    down_max = iy;
  1197. X
  1198. X}
  1199. X
  1200. Xsign(a)
  1201. X
  1202. Xdouble a;
  1203. X
  1204. X{
  1205. X    if (a < 0)
  1206. X    return(-1);
  1207. X    return(1);
  1208. X}
  1209. X
  1210. Xint pairound(pair_int, pair_frac)
  1211. X
  1212. Xint    pair_int;
  1213. Xdouble pair_frac;
  1214. X
  1215. X{
  1216. X    if (pair_int < 0)
  1217. X    {
  1218. X    if (pair_frac <= -0.5)
  1219. X    {
  1220. X        pair_int--;
  1221. X    }
  1222. X    }
  1223. X    else
  1224. X    {
  1225. X    if (pair_frac >= 0.5)
  1226. X    {
  1227. X        pair_int++;
  1228. X    }
  1229. X    }
  1230. X#ifdef DEBUG
  1231. X    fprintf(stderr, "pairound: returning %d\n", pair_int);
  1232. X#endif
  1233. X    return (pair_int);
  1234. X}
  1235. X
  1236. /
  1237. echo 'Extracting vsc.c...'
  1238. sed 's/^X//' > vsc.c << '/'
  1239. X#include <stdio.h>
  1240. X
  1241. X/*
  1242. X *  snarf a character out of a font file
  1243. X */
  1244. X
  1245. X#include <vfont.h>
  1246. X#define  Header_area_size \
  1247. X        (sizeof(struct header) + (sizeof(struct dispatch) * 256))
  1248. X
  1249. Xmain(argc, argv)
  1250. X
  1251. Xint argc;
  1252. Xchar *argv[];
  1253. X
  1254. X{
  1255. X    int ch;
  1256. X    int fd;
  1257. X    unsigned char byte;
  1258. X    int i,j;
  1259. X    int raster_size;
  1260. X    int curr;
  1261. X    int rotated = 0;
  1262. X    struct dispatch dispatch;
  1263. X    struct header header;
  1264. X
  1265. X    if (argc < 2)
  1266. X    {
  1267. X    printf("Give me a file, bozo!\n");
  1268. X    exit(1);
  1269. X    }
  1270. X    if ((fd = open(argv[1], 0)) == -1)
  1271. X    {
  1272. X    printf("Can't open it\n");
  1273. X    exit(1);
  1274. X    }
  1275. X
  1276. X    /* check for rotation */
  1277. X    if (argv[1][strlen(argv[1]) - 1] == 'r')
  1278. X    {
  1279. X    rotated = 1;
  1280. X    }
  1281. X
  1282. X    read(fd, &header, sizeof(header));
  1283. X    printf("header.magic = %d (0x%x)\n", header.magic, header.magic);
  1284. X    printf("header.size  = %d (0x%x)\n", header.size, header.size);
  1285. X    printf("header.maxx  = %d (0x%x)\n", header.maxx, header.maxx);
  1286. X    printf("header.maxy  = %d (0x%x)\n", header.maxy, header.maxy);
  1287. X    printf("header.xtend = %d (0x%x)\n\n", header.xtend, header.xtend);
  1288. X
  1289. X    while((ch = getchar()) != EOF)
  1290. X    {
  1291. X    lseek(fd, (ch * sizeof(struct dispatch)) + sizeof(struct header), 0);
  1292. X    read(fd, &dispatch, sizeof(dispatch));
  1293. X    
  1294. X    if (dispatch.nbytes == 0)
  1295. X    {
  1296. X        printf("Character undefined\n");
  1297. X    }
  1298. X    else
  1299. X    {
  1300. X        printf("dispatch.addr   = %d (0x%x)\n",
  1301. X            dispatch.addr, dispatch.addr);
  1302. X        printf("dispatch.nbytes = %d (0x%x)\n",
  1303. X            dispatch.nbytes, dispatch.nbytes);
  1304. X        printf("dispatch.up     = %d (0x%x)\n",
  1305. X            dispatch.up, dispatch.up);
  1306. X        printf("dispatch.down   = %d (0x%x)\n",
  1307. X            dispatch.down, dispatch.down);
  1308. X        printf("dispatch.left   = %d (0x%x)\n",
  1309. X            dispatch.left, dispatch.left);
  1310. X        printf("dispatch.right  = %d (0x%x)\n",
  1311. X            dispatch.right, dispatch.right);
  1312. X        printf("dispatch.width  = %d (0x%x)\n",
  1313. X            dispatch.width, dispatch.width);
  1314. X        if (rotated)
  1315. X        {
  1316. X        raster_size = (dispatch.up + dispatch.down + 7) / 8;
  1317. X        }
  1318. X        else
  1319. X        {
  1320. X        raster_size = (dispatch.left + dispatch.right + 7) / 8;
  1321. X        }
  1322. X        printf("raster size     = %d\n", raster_size);
  1323. X
  1324. X        lseek(fd, dispatch.addr + Header_area_size, 0);
  1325. X        curr = 0;
  1326. X        for(j=0; j<dispatch.nbytes; j++)
  1327. X        {
  1328. X        read(fd, &byte, 1);
  1329. X        if (curr++ == raster_size)
  1330. X        {
  1331. X            curr = 1;
  1332. X            putchar('\n');
  1333. X        }
  1334. X        for(i=0; i<8; i++)
  1335. X        {
  1336. X            if (byte & 0x80)
  1337. X            putchar('@');
  1338. X            else
  1339. X            putchar(' ');
  1340. X            byte <<= 1;
  1341. X        }
  1342. X        }
  1343. X    }
  1344. X    getchar();    /* ignore newline */
  1345. X    putchar('\n');
  1346. X    }
  1347. X}
  1348. /
  1349. echo 'Extracting painter.h...'
  1350. sed 's/^X//' > painter.h << '/'
  1351. X# include <math.h>
  1352. X# include <stdio.h>
  1353. X
  1354. X# define  Max_x 400
  1355. X# define  Max_y 400
  1356. X# define  X_center 200
  1357. X# define  Y_center 200
  1358. X
  1359. X# define  Off   0
  1360. X# define  On    1
  1361. X
  1362. /
  1363. echo 'Extracting extra.occ...'
  1364. sed 's/^X//' > extra.occ << '/'
  1365. X  848  :-11  11:-11  14: 11  14:-64 -64:
  1366. X  910  :-10  10:-10 -10: 10 -10: 10  10:-10  10:-10 -10:-64 -64:
  1367. X  911  :-10  10:-10 -10: 10 -10: 10  10:-10  10:-10 -10:-64   0: -9  -9: -9   9: -8   9: -8  -9: -7  -9: -7   9: -6   9: -6  -9:
  1368. X       : -5  -9: -5   9: -4   9: -4  -9: -3  -9: -3   9: -2   9: -2  -9: -1  -9: -1   9:  0   9:  0  -9:  1  -9:  1   9:  2   9:
  1369. X       :  2  -9:  3  -9:  3   9:  4   9:  4  -9:  5  -9:  5   9:  6   9:  6  -9:  7  -9:  7   9:  8   9:  8  -9:  9  -9:  9   9:
  1370. X       :-64 -64:
  1371. X  913  : -7   7: -1  -7: -4  -6: -6  -4: -7  -1: -7   1: -6   4: -4   6: -1   7:  1   7:  4   6:  6   4:  7   1:  7  -1:  6  -4:
  1372. X       :  4  -6:  1  -7: -1  -7:-64   0: -4  -6:  4  -6:-64   0: -5  -5:  5  -5:-64   0: -6  -4:  6  -4:-64   0: -6  -2:  6  -2:
  1373. X       :-64   0: -7  -1:  7  -1:-64   0: -7   1:  7   1:-64   0: -6   2:  6   2:-64   0: -6   4:  6   4:-64   0: -5   5:  5   5:
  1374. X       :-64   0: -4   6:  4   6:-64 -64:
  1375. X  914  :-11  11: -2 -11: -5 -10: -8  -8:-10  -5:-11  -2:-11   2:-10   5: -8   8: -5  10: -2  11:  2  11:  5  10:  8   8: 10   5:
  1376. X       : 11   2: 11  -2: 10  -5:  8  -8:  5 -10:  2 -11: -2 -11:-64   0: 11 -11:-11  11:-64 -64:
  1377. X  990  :-10  10: -6   7:  0  -7:  6   7:-64 -64:
  1378. X  991  :-10  10: -6  -7:  0   7:  6  -7:-64 -64:
  1379. X  992  :-23  23:-14  -3: 14  -3:-64   0:-14   3: 14   3:-64   0: -4  -9:-20   0: -4   9:-64   0:  4  -9: 20   0:  4   9:-64 -64:
  1380. X  993  :-23  23:-14  -3: 14  -3:-64   0:-14   3: 14   3:-64   0:  4  -9: 20   0:  4   9:-64 -64:
  1381. X 2296  :-11  11: -2 -11: -5 -10: -8  -8:-10  -5:-11  -2:-11   2:-10   5: -8   8: -5  10: -2  11:  2  11:  5  10:  8   8: 10   5:
  1382. X       : 11   2: 11  -2: 10  -5:  8  -8:  5 -10:  2 -11: -2 -11:-64   0:  4  -4:  2  -5:  0  -5: -2  -4: -3  -2: -3   1: -2   3:
  1383. X       :  0   4:  2   4:  4   3:-64 -64:
  1384. X 2297  :-11  11: -2 -11: -5 -10: -8  -8:-10  -5:-11  -2:-11   2:-10   5: -8   8: -5  10: -2  11:  2  11:  5  10:  8   8: 10   5:
  1385. X       : 11   2: 11  -2: 10  -5:  8  -8:  5 -10:  2 -11: -2 -11:-64   0: -3  -5: -3   4:-64   0: -3  -5:  1  -5:  3  -4:  3  -1:
  1386. X       :  1   0: -3   0:-64   0:  0   0:  3   4:-64 -64:
  1387. X 2298  :-12  12:  8  -8:  1  -8: -3  -7: -5  -6: -7  -4: -8  -1: -8   1: -7   4: -5   6: -3   7:  1   8:  8   8:-64   0: 8   13:
  1388. X       :-8   13:-64 -64:
  1389. X 2299  :-12  12: -8  -8: -1  -8:  3  -7:  5  -6:  7  -4:  8  -1:  8   1:  7   4:  5   6:  3   7: -1   8: -8   8:-64   0: 8   13:
  1390. X       :-8   13:-64 -64:
  1391. /
  1392. echo 'Extracting pen.round...'
  1393. sed 's/^X//' > pen.round << '/'
  1394. Xpen 6
  1395. X *
  1396. X***
  1397. X *
  1398. Xpen 7
  1399. X *
  1400. X***
  1401. X *
  1402. Xpen 8
  1403. X *
  1404. X***
  1405. X *
  1406. Xpen 9
  1407. X *
  1408. X***
  1409. X *
  1410. Xpen 10
  1411. X * 
  1412. X***
  1413. X * 
  1414. Xpen 11
  1415. X *
  1416. X***
  1417. X *
  1418. Xpen 12
  1419. X *
  1420. X***
  1421. X *
  1422. Xpen 14
  1423. X **
  1424. X****
  1425. X****
  1426. X **
  1427. Xpen 16
  1428. X  *
  1429. X ***
  1430. X*****
  1431. X ***
  1432. X  *
  1433. Xpen 18
  1434. X  *
  1435. X ***
  1436. X*****
  1437. X ***
  1438. X  *
  1439. Xpen 20
  1440. X  **
  1441. X ****
  1442. X******
  1443. X******
  1444. X ****
  1445. X  **
  1446. Xpen 22
  1447. X   *
  1448. X *****
  1449. X ***** 
  1450. X*******
  1451. X *****
  1452. X *****
  1453. X   *  
  1454. Xpen 24
  1455. X  **
  1456. X ****
  1457. X******
  1458. X******
  1459. X ****
  1460. X  **
  1461. Xpen 28
  1462. X   **
  1463. X ******
  1464. X ******
  1465. X********
  1466. X********
  1467. X ******
  1468. X ******
  1469. X   **
  1470. Xpen 36
  1471. X     *     
  1472. X   *****   
  1473. X   *****   
  1474. X ********* 
  1475. X ********* 
  1476. X***********
  1477. X ********* 
  1478. X ********* 
  1479. X   *****   
  1480. X   *****   
  1481. X     *     
  1482. Xpenend
  1483. /
  1484. echo 'Extracting R.spec...'
  1485. sed 's/^X//' > R.spec << '/'
  1486. Xcharset
  1487. Xp,\240
  1488. Xs30, 
  1489. X224,-
  1490. X804,\
  1491. X848,_
  1492. X848,\205,-3
  1493. X848,\206,-14
  1494. X910,\210
  1495. X913,\207
  1496. X2001,A
  1497. X2002,B
  1498. X2003,C
  1499. X2004,D
  1500. X2005,E
  1501. X2006,F
  1502. X2007,G
  1503. X2008,H
  1504. X2009,I
  1505. X2010,J
  1506. X2011,K
  1507. X2012,L
  1508. X2013,M
  1509. X2014,N
  1510. X2015,O
  1511. X2016,P
  1512. X2017,Q
  1513. X2018,R
  1514. X2019,S
  1515. X2020,T
  1516. X2021,U
  1517. X2022,V
  1518. X2023,W
  1519. X2024,X
  1520. X2025,Y
  1521. X2026,Z
  1522. X2101,a,r.8
  1523. X2102,b,r.8
  1524. X2103,c,r.8
  1525. X2104,d,r.8
  1526. X2105,e,r.8
  1527. X2106,f,r.8
  1528. X2107,g,r.8
  1529. X2108,h,r.8
  1530. X2109,i,r.8
  1531. X2110,j,r.8
  1532. X2111,k,r.8
  1533. X2112,l,r.8
  1534. X2113,m,r.8
  1535. X2114,n,r.8
  1536. X2115,o,r.8
  1537. X2116,p,r.8
  1538. X2117,q,r.8
  1539. X2118,r,r.8
  1540. X2119,s,r.8
  1541. X2120,t,r.8
  1542. X2121,u,r.8
  1543. X2122,v,r.8
  1544. X2123,w,r.8
  1545. X2124,x,r.8
  1546. X2125,y,r.8
  1547. X2126,z,r.8
  1548. X2177,\203,r.8
  1549. X2178,\201,r.8
  1550. X2179,\202,r.8
  1551. X2180,\211,r.8
  1552. X2181,\212,r.8
  1553. X2200,0,r.8
  1554. X2201,1,r.8
  1555. X2202,2,r.8
  1556. X2203,3,r.8
  1557. X2204,4,r.8
  1558. X2205,5,r.8
  1559. X2206,6,r.8
  1560. X2207,7,r.8
  1561. X2208,8,r.8
  1562. X2209,9,r.8
  1563. X2210,.
  1564. X2211,,
  1565. X2212,:
  1566. X2213,;
  1567. X2214,!
  1568. X2215,?
  1569. X2216,\215
  1570. X2217,"
  1571. X2218,\213
  1572. X2219,*
  1573. X2220,/
  1574. X2221,(
  1575. X2222,)
  1576. X2223,[
  1577. X2224,]
  1578. X2225,{
  1579. X2226,}
  1580. X2229,|
  1581. X2231,\204
  1582. X2232,+
  1583. X2238,=
  1584. X2241,<
  1585. X2242,>
  1586. X2246,~
  1587. X2247,^
  1588. X2251,'
  1589. X2252,`
  1590. X2271,%
  1591. X2272,&
  1592. X2273,@
  1593. X2274,$
  1594. X2275,#
  1595. X2277,\214
  1596. X2296,\216
  1597. X2297,\217
  1598. /
  1599. echo 'Extracting I.spec...'
  1600. sed 's/^X//' > I.spec << '/'
  1601. Xaspect 0.8
  1602. Xcharset
  1603. Xp,\240
  1604. Xs30, 
  1605. X224,-
  1606. X800,\206
  1607. X804,\
  1608. X848,_
  1609. X848,\205,-3
  1610. X910,\210
  1611. X913,\207
  1612. X2051,A
  1613. X2052,B
  1614. X2053,C
  1615. X2054,D
  1616. X2055,E
  1617. X2056,F
  1618. X2057,G
  1619. X2058,H
  1620. X2059,I
  1621. X2060,J
  1622. X2061,K
  1623. X2062,L
  1624. X2063,M
  1625. X2064,N
  1626. X2065,O
  1627. X2066,P
  1628. X2067,Q
  1629. X2068,R
  1630. X2069,S
  1631. X2070,T
  1632. X2071,U
  1633. X2072,V
  1634. X2073,W
  1635. X2074,X
  1636. X2075,Y
  1637. X2076,Z
  1638. X2151,a
  1639. X2152,b
  1640. X2153,c
  1641. X2154,d
  1642. X2155,e
  1643. X2156,f
  1644. X2157,g
  1645. X2158,h
  1646. X2159,i
  1647. X2160,j
  1648. X2161,k
  1649. X2162,l
  1650. X2163,m
  1651. X2164,n
  1652. X2165,o
  1653. X2166,p
  1654. X2167,q
  1655. X2168,r
  1656. X2169,s
  1657. X2170,t
  1658. X2171,u
  1659. X2172,v
  1660. X2173,w
  1661. X2174,x
  1662. X2175,y
  1663. X2176,z
  1664. X2191,\203
  1665. X2192,\201
  1666. X2193,\202
  1667. X2194,\211
  1668. X2195,\212
  1669. X2217,"
  1670. X2219,*
  1671. X2223,[
  1672. X2224,]
  1673. X2225,{
  1674. X2226,}
  1675. X2229,|
  1676. X2231,\204
  1677. X2232,+
  1678. X2238,=
  1679. X2241,<
  1680. X2242,>
  1681. X2246,~
  1682. X2247,^
  1683. X2271,%
  1684. X2273,@
  1685. X2275,#
  1686. X2750,0
  1687. X2751,1
  1688. X2752,2
  1689. X2753,3
  1690. X2754,4
  1691. X2755,5
  1692. X2756,6
  1693. X2757,7
  1694. X2758,8
  1695. X2759,9
  1696. X2760,.
  1697. X2761,,
  1698. X2762,:
  1699. X2763,;
  1700. X2764,!
  1701. X2765,?
  1702. X2766,`
  1703. X2767,'
  1704. X2768,&
  1705. X2769,$
  1706. X2770,/
  1707. X2771,(
  1708. X2772,)
  1709. /
  1710. echo 'Extracting B.spec...'
  1711. sed 's/^X//' > B.spec << '/'
  1712. Xcharset
  1713. Xp,\240
  1714. Xs30, 
  1715. X224,-
  1716. X800,\206
  1717. X804,\
  1718. X848,_
  1719. X848,\205,-3
  1720. X911,\210
  1721. X913,\207
  1722. X2177,\203,r.8
  1723. X2178,\201,r.8
  1724. X2179,\202,r.8
  1725. X2180,\211,r.8
  1726. X2181,\212,r.8
  1727. X2225,{
  1728. X2226,}
  1729. X2229,|
  1730. X2241,<
  1731. X2242,>
  1732. X2246,~
  1733. X2247,^
  1734. X2271,%
  1735. X2273,@
  1736. X2275,#
  1737. X3001,A
  1738. X3002,B
  1739. X3003,C
  1740. X3004,D
  1741. X3005,E
  1742. X3006,F
  1743. X3007,G
  1744. X3008,H
  1745. X3009,I
  1746. X3010,J
  1747. X3011,K
  1748. X3012,L
  1749. X3013,M
  1750. X3014,N
  1751. X3015,O
  1752. X3016,P
  1753. X3017,Q
  1754. X3018,R
  1755. X3019,S
  1756. X3020,T
  1757. X3021,U
  1758. X3022,V
  1759. X3023,W
  1760. X3024,X
  1761. X3025,Y
  1762. X3026,Z
  1763. X3101,a,r.8
  1764. X3102,b,r.8
  1765. X3103,c,r.8
  1766. X3104,d,r.8
  1767. X3105,e,r.8
  1768. X3106,f,r.8
  1769. X3107,g,r.8
  1770. X3108,h,r.8
  1771. X3109,i,r.8
  1772. X3110,j,r.8
  1773. X3111,k,r.8
  1774. X3112,l,r.8
  1775. X3113,m,r.8
  1776. X3114,n,r.8
  1777. X3115,o,r.8
  1778. X3116,p,r.8
  1779. X3117,q,r.8
  1780. X3118,r,r.8
  1781. X3119,s,r.8
  1782. X3120,t,r.8
  1783. X3121,u,r.8
  1784. X3122,v,r.8
  1785. X3123,w,r.8
  1786. X3124,x,r.8
  1787. X3125,y,r.8
  1788. X3126,z,r.8
  1789. X3200,0,r.8
  1790. X3201,1,r.8
  1791. X3202,2,r.8
  1792. X3203,3,r.8
  1793. X3204,4,r.8
  1794. X3205,5,r.8
  1795. X3206,6,r.8
  1796. X3207,7,r.8
  1797. X3208,8,r.8
  1798. X3209,9,r.8
  1799. X3210,.
  1800. X3211,,
  1801. X3212,:
  1802. X3213,;
  1803. X3214,!
  1804. X3215,?
  1805. X3216,`
  1806. X3217,'
  1807. X3218,&
  1808. X3219,$
  1809. X3220,/
  1810. X3221,(
  1811. X3222,)
  1812. X3223,*
  1813. X3224,\204
  1814. X3225,+
  1815. X3226,=
  1816. X3227,\215
  1817. X3228,"
  1818. X3229,\213
  1819. /
  1820. echo 'Distribution file hfont.shar complete.'
  1821.  
  1822.