home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume12 / hershtools / part02 < prev    next >
Encoding:
Internet Message Format  |  1987-10-24  |  39.9 KB

  1. Subject:  v12i041:  Hershey font manipulation tools and data, Part02/05
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rs@uunet.UU.NET
  5.  
  6. Submitted-by: lee@uhccux.UUCP (Greg Lee)
  7. Posting-number: Volume 12, Issue 41
  8. Archive-name: hershtools/part02
  9.  
  10. # This is a shell archive.  Remove anything before this line
  11. # then unpack it by saving it in a file and typing "sh file"
  12. # (Files unpacked will be owned by you and have default permissions).
  13. # This archive contains the following files:
  14. #    ./htrans.c
  15. #    ./plot.doc
  16. #    ./src.chr
  17. #    ./srd.chr
  18. #    ./srp.chr
  19. #    ./srs.chr
  20. #    ./termio.c
  21. #
  22. if `test ! -s ./htrans.c`
  23. then
  24. echo "writing ./htrans.c"
  25. sed 's/^X//' > ./htrans.c << '\Rogue\Monster\'
  26. X/*
  27. X         HTRANS
  28. X
  29. XTranslate a range of character definitions in occidental.hsy into
  30. Xan editable file format.
  31. X
  32. Xcompile: cc htrans -e1600
  33. Xlink:    li htrans -n
  34. X
  35. XGreg Lee, 10/84
  36. X
  37. X*/
  38. X#include <stdio.h>
  39. X#include <sys/file.h>
  40. X
  41. Xchar cbuf[1024];
  42. Xint cnum, firstc, lastc, cocnt, fd, i, maxi;
  43. Xchar dummy, letter, bndflag, fname[20];
  44. XFILE *fchr;
  45. X
  46. Xmain()
  47. X{    /*int fd, i, maxi;
  48. X    char fname[20];*/
  49. X
  50. X
  51. X    printf("Htrans - Create file of plot points from Hershey database.\n");
  52. X
  53. X    if ((fd = open("occidental.hsy",O_RDONLY,"r")) == NULL)
  54. X    {    printf("File occidental.hsy needed in current directory.");
  55. X        exit(1);
  56. X    }
  57. X
  58. X    printf("Output .chr file name?  : "); scanf("%s", fname);
  59. X    strcat(fname, ".chr");
  60. X    if ((fchr = fopen(fname, "w")) == NULL)
  61. X    {    printf("Can't open %s for output.", fname);
  62. X        exit(1);
  63. X    }
  64. X
  65. X    printf("first number? : "); scanf("%d", &firstc);
  66. X    scanf("%c", &dummy);
  67. X    printf("first letter? : "); scanf("%c", &letter);
  68. X    if (letter > ' ')
  69. X    {    scanf("%c", &dummy);
  70. X        printf("last letter?  : ");
  71. X        scanf("%c", &bndflag);
  72. X        lastc = firstc + bndflag - letter;
  73. X    }
  74. X    else { printf("last number?  : "); scanf("%d", &lastc); }
  75. X
  76. X    cnum = 0; cocnt = 0;
  77. X    bndflag = 1;
  78. X    i = 2;
  79. X
  80. X    maxi = read(fd, cbuf, 1024);
  81. X
  82. X    for (; cnum <= lastc ; i++,i++)
  83. X    {    if (i >= maxi)
  84. X        {    i = 0;
  85. X            if (maxi < 1024) break;
  86. X            maxi = read(fd, cbuf, 1024);
  87. X            if (!maxi) break;
  88. X        }
  89. X
  90. X        if (dspc(cbuf[i], cbuf[i+1]))
  91. X         if (letter > ' ' && letter < 128)
  92. X            fprintf(fchr, "'%c': ", letter++);
  93. X         else fprintf(fchr,"%d: ", cnum);
  94. X    }
  95. X
  96. X    fprintf(fchr, "\n");
  97. X    fclose(fchr);
  98. X
  99. X}
  100. X
  101. Xdspc(b1, b2)
  102. Xchar b1, b2;
  103. X{    int i1, i2;
  104. X
  105. X    i1 = b1 - 64; i2 = b2 - 64;
  106. X
  107. X    if (i1 == -64 && i2 == -64)
  108. X    {    if (cnum >= firstc) fprintf(fchr," End Char\n");
  109. X        cnum++;
  110. X        cocnt = 0; bndflag = 1;
  111. X        if (cnum >= firstc && cnum <= lastc) return(cnum);
  112. X        return(0);
  113. X    }
  114. X
  115. X    if (cnum < firstc) return(0);
  116. X
  117. X    if (i1 == -64 && i2 == 0)
  118. X    {    fprintf(fchr," Pen Up\n    ");
  119. X        cocnt = 0;
  120. X    }
  121. X    else
  122. X    {    if (cocnt >8) {cocnt = 0; fprintf(fchr,"\n    ");}
  123. X
  124. X        if (bndflag)
  125. X        { fprintf(fchr,"Bounds(%d,%d)", i1,i2); bndflag = 0; }
  126. X        else fprintf(fchr,"(%d,%d)", i1,i2);
  127. X        cocnt++;
  128. X    }
  129. X
  130. X    return(0);
  131. X}
  132. \Rogue\Monster\
  133. else
  134.   echo "will not over write ./htrans.c"
  135. fi
  136. if [ `wc -c ./htrans.c | awk '{printf $1}'` -ne 2077 ]
  137. then
  138. echo `wc -c ./htrans.c | awk '{print "Got " $1 ", Expected " 2077}'`
  139. fi
  140. if `test ! -s ./plot.doc`
  141. then
  142. echo "writing ./plot.doc"
  143. sed 's/^X//' > ./plot.doc << '\Rogue\Monster\'
  144. X
  145. XEplot, Hplot -- (c) Greg Lee, October 1984 (revised July 1987)
  146. X
  147. X
  148. XEplot is an interactive screen editor for modifying files of plotting
  149. Xpoints, as a preliminary to using such files with Hplot to create
  150. Xcharacter fonts. It will also create PostScript fonts, and .pl files
  151. Xfor use with the TeX utility 'pltotf' to make .tfm files.
  152. X
  153. X
  154. Xe    Edit        Enters edit mode. See below for subcommands.
  155. X
  156. Xc    Create        Make a new character ready to have plotting
  157. X            points added in edit mode.
  158. X
  159. Xr    Read        Read plotting points from .chr file.
  160. X
  161. Xz    Zap        Get rid of all plotting info.
  162. X
  163. Xp    Plot        Plot a character.
  164. X
  165. Xv    Display        Display the currently plotted character.
  166. X
  167. Xb    Base        Set y-coordinate of base line (default 9).
  168. X
  169. Xh    Height        Set height of character above the base line (def. 22).
  170. X
  171. Xd    Depth        Set depth below base line (def. 7).
  172. X
  173. Xf    Factors        The stretch/shrink factors X1/X2 and Y1/Y2
  174. X            modify the plotting points as they are read
  175. X            in from the .chr file, as well as affecting
  176. X            the editing display.
  177. X
  178. X^I    Italic        Points are sloped by I1/I2 as a .chr file is read.
  179. X
  180. Xt    Tall        Alter display mode for tall characters.
  181. X
  182. X^L    set Line style
  183. X
  184. X        The values of X Heavy, X Light, and Y Heavy, Y Light modify
  185. X        the action of the line drawing algorithm. This is not
  186. X        very useful.
  187. X
  188. X
  189. X^S    set serif level
  190. X
  191. X        This has an effect only when a file of plotting points
  192. X        is read in, and then only if the plotting points responsible
  193. X        for drawing serifs have been identified with a prefix 'S'
  194. X        or 's'. When the serif level is 0, points 'S(x,y)' and
  195. X        's(x,y)' are ignored. When the level is 1, only points
  196. X        'S(x,y)' are ignored.  For higher levels, all points are
  197. X        used.
  198. X
  199. Xn    Name file    Change name of file (.chr, .ps, or .pl) to save in
  200. X
  201. Xs    Save .chr    Save edited plotting points in .chr file.
  202. X
  203. Xa    Save .a        Save edited plotting points in .a assembler src file.
  204. X
  205. X^P    save .ps file    Save edited plotting points as a PostScript font.
  206. X
  207. X^T    save .pl file    Create .pl file with char dimensions (to make .tfm file)
  208. X
  209. X?    info        (same as HPLOT command)
  210. X
  211. X\\    debug        (same as HPLOT command)
  212. X
  213. Xx    eXit
  214. X
  215. Xq    same as x
  216. X
  217. X
  218. XEdit mode commands:
  219. X
  220. X
  221. XCursor movement
  222. X
  223. X    ^S    cursor left
  224. X    ^D    cursor right
  225. X    ^E    cursor up
  226. X    ^X    cursor down
  227. X    ^R    cursor up 8
  228. X    ^C    cursor down 8
  229. X    ^A    cursor left 8
  230. X    ^F    cursor right 8
  231. X    ^W    scroll up
  232. X    ^Z    scroll down
  233. X    ^Q    center scroll
  234. X
  235. XControl
  236. X
  237. X    CR    end edit
  238. X    ^L    plot Letter
  239. X    ^N    New plot
  240. X
  241. XPen movement
  242. X
  243. X   any non-control character (other than Space)
  244. X        pen to beginning of line named by character
  245. X
  246. X    ^B    pen Back to previous point
  247. X    Space    pen forward to next point
  248. X    ^U    pen Up
  249. X
  250. X
  251. XPlotting point modification
  252. X
  253. X    ^P    change Point
  254. X    ^I    Insert point
  255. X    ^G    delete point
  256. X    ^Y    delete line
  257. X    ^T    pull points toward cursor, when followed by:
  258. X            u    pulls points above (Up)
  259. X            d    pulls points below (Down)
  260. X            r    pulls at right
  261. X            l    pulls at left
  262. X       or    push points away from cursor, when followed by:
  263. X            U    pushes above
  264. X            D    pushes below
  265. X            R    pushes at right
  266. X            L    pushes at left
  267. X    ^H    change next line to hairline
  268. X
  269. X
  270. X
  271. XHPLOT -- Greg Lee, October, 1984
  272. X
  273. X
  274. X
  275. XHplot creates fonts from lists of plotting points for each character.
  276. XSource plotting points are in an editable text file. Text files of
  277. Xplotting points can be extracted from the Hershey data base with the
  278. Xutility program HTRANS (see below). The raster fonts created are in
  279. Xunix vfont format.
  280. X
  281. XIn outline, the procedure for creating a font is:
  282. X    A. read one or more files of plotting points (with the 'r' command)
  283. X    B. set various parameters determining size and style
  284. X    C. plot characters (with the 'p' or 'V' commands)
  285. X    D. assign a name to the font (with the 'n' command)
  286. X    E. generate and save the font (with the 'g' command)
  287. X    F. exit (with the 'x' command)
  288. X
  289. XHere is a list of commands available:
  290. X
  291. Xr    Read in a file of plotting points
  292. X
  293. X        A plotting point is specified in the form '(x,y)',
  294. X        where x and y are the x-coordinate and the
  295. X        y-coordinate. The lowest y values correspond to
  296. X        the top of the character (strangely enough). The
  297. X        lists of points for each character are headed by
  298. X        the character, surrounded by single quotes and followed
  299. X        by a colon. (^ replaces the first single quote for a
  300. X        control character.) There are various commands interspered
  301. X        among the plotting points, namely:
  302. X
  303. X            End Char    to end the list for a character
  304. X            Pen Up        to raise the pen
  305. X            Hair        to raise the pen and draw only
  306. X                     every other dot of the next line
  307. X            Bounds(x1,x2)    to define the left and right
  308. X                     boundaries of a character (but
  309. X                     HPLOT currently ignores this)
  310. X            Height(y)    to define the height of characters
  311. X                     above the base line
  312. X            x Height(y)    to define the height of character
  313. X                     bodies above the base line
  314. X            Base(y)        to define the distance of the base
  315. X                     line below y-coordinate 0
  316. X            Depth(y)    to define the depth of a character
  317. X                     below the baseline
  318. X            Bearings(x,y)    to define the amount of white space
  319. X                     at the left and right of the inked
  320. X                     portion of the character
  321. X            S(x,y)        for a point of a big serif
  322. X            s(x,y)        for a point of a small serif
  323. X
  324. X        Any stuff in the file which is not recognized as a point
  325. X        or any of the other items listed above is ignored, along
  326. X        with the remainder of the line in which it occurs.
  327. X
  328. X
  329. Xz    Zap -- delete all plotting points
  330. X
  331. X        Plotting data (in a compressed format) is kept in
  332. X        a buffer whose size depends on how much RAM happens to be
  333. X        available in your system. If you're about to run out of
  334. X        room, you'll want to clear out the buffer before reading
  335. X        in another file of data.
  336. X
  337. Xp    Plot a character
  338. X
  339. X        The plotted character is shown on the screen with the
  340. X        lines that were drawn identified as '1','2',...,'9','A',...,
  341. X        'Z','a',...,'z','"',....  This is some help in identifying
  342. X        plotting points that need to be changed. When the character
  343. X        crosses the base line, the latter is shown with '-'s.
  344. X
  345. X        The maximum size for a character plot is 160 by 160 dots
  346. X        but at most 80 dots of width can be displayed.
  347. X
  348. Xg    Generate a font by plotting all characters for which plotting
  349. X    points are available and save the font in the file named with the
  350. X    'n' command.
  351. X
  352. Xc    Read a .fn2 font. A subsequent 'g' generates a vfont file with
  353. X    equivalent rasters.
  354. X
  355. Xv    Display the last character plotted.
  356. X
  357. Xb    set the Base line adjust value
  358. X
  359. X        The base lines of characters are considered to be at this
  360. X        value below y-coordinate 0.
  361. X
  362. Xh    set the Height value
  363. X
  364. X        The top of the character is considered to be at this
  365. X        value above the base line. The height and the base line
  366. X        will determine which vertical portion of the plotted character
  367. X        is placed in the font.
  368. X
  369. Xd    set the Depth value
  370. X
  371. Xf    set the magnification Factors
  372. X
  373. X        As characters are plotted, they are stretched or shrunk
  374. X        by X1/X2 horizontally, and they are stretched or shrunk
  375. X        by Y1/Y2 vertically. Negative fractions cause reflections
  376. X        about the y- or x- axis.
  377. X
  378. X2    set the magnification Factors for other plot
  379. X
  380. X        If XX1 and XX2 or YY1 and YY2 are given non-zero values,
  381. X        each character is plotted twice, once with the 2nd set
  382. X        of magnification factors.
  383. X
  384. X^A    set factors for magnifying Ascenders
  385. X
  386. X        Ascenders of lower case letters are stretched or shrunk
  387. X        by A1/A2. For this to work, commands 'Base(n)' and
  388. X        'x Height(n)' must be present in the file of plotting
  389. X        points.
  390. X
  391. X^D    set factors for magnifying Descenders
  392. X
  393. X        Descenders of lower case letters are stretched or shrunk
  394. X        by D1/D2. For this to work, commands 'Base(n)' and
  395. X        'x Height(n)' must be present in the file of plotting
  396. X        points.
  397. X
  398. X^I    set factors for Italic slant
  399. X
  400. X        Positive I1/I2 back-slants characters to the left. This
  401. X        is mainly useful for removing the rightward slant given
  402. X        to some of the Hershey characters. If the font characters
  403. X        are slanted, this produces ugly variations in spacing.
  404. X
  405. Xt    toggle Tall switch
  406. X
  407. X        Tall makes the font duplex, so that characters can be
  408. X        up to 48 dots high.
  409. X
  410. X^P    set Pen style
  411. X
  412. X        The imaginary pen that draws the lines between pairs of
  413. X        plotting points can be widened and tilted. Its width is
  414. X        one plus the value assigned to Width. Thinking of it as
  415. X        a brush for a moment, the x- and y-distances between
  416. X        bristles are given as Delta X and Delta Y. If Square Pen
  417. X        has the value 3, the pen takes on the shape of a hollow
  418. X        square (or diamond), but for values of 1 or 2, only two or
  419. X        three sides of the square are drawn.
  420. X
  421. X        The width of the pen can be varied with Blob and Delta
  422. X        Blob. Each time the pen goes down it is widened by one
  423. X        eighth of the value of Blob, but this is decreased by
  424. X        Delta Blob for each dot that is drawn in the course of
  425. X        the stroke. (The stroke begins at the end of the line
  426. X        that is furthest from the x-axis.)
  427. X
  428. X        The pen style parameters are all treated as signed
  429. X        values. The width of the blob goes toward 0, but it
  430. X        may oscillate if Delta Blob is large.
  431. X
  432. X^H    sHade
  433. X
  434. X        Characters can be shaded on the lower right side with a
  435. X        series of diagonals, whose length is defined by the
  436. X        value of Shading. The separation from the body of the
  437. X        character is given by Y Shade, and the spacing of the
  438. X        lines from each other is controlled by X Shade.
  439. X
  440. X^L    set Line style
  441. X
  442. X        The values of X Heavy, X Light, and Y Heavy, Y Light modify
  443. X        the action of the line drawing algorithm. This is not
  444. X        very useful.
  445. X
  446. X^R    Retrace
  447. X
  448. X        Causes the next plotted character to overlay the last.
  449. X
  450. X^O    toggle Open switch
  451. X
  452. X        Open causes interior dots to be deleted.
  453. X
  454. Xl    toggle Light switch
  455. X
  456. X        Light causes every other interior dot to be deleted, and
  457. X        insures that there will be no two contiguous horizontal
  458. X        dots. This improves the appearance of fonts when used at
  459. X        low resolution.
  460. X
  461. X^F    set Fill pattern
  462. X
  463. X        When ^O has been used to open up the interiors of characters,
  464. X        the inside space can be filled with various patterns. The
  465. X        pattern is configured by assigning values to the seven
  466. X        parameters below. Except for Width, the number assigned
  467. X        determines the periodicity of the pattern. Except for Width
  468. X        and Grey, negative values give white-on-black instead of
  469. X        black-on-white. For combinations of patterns, only dots
  470. X        belonging to all the requested patterns are drawn.
  471. X
  472. X        Grey -- Fill with spaced dots. Values 0 and 1 have no effect.
  473. X        A negative value prevents the outside of the character from
  474. X        being drawn, and -1 does only this.
  475. X
  476. X        Vertical -- Vertical stripes.
  477. X
  478. X        Horizontal -- Horizontal stripes.
  479. X
  480. X        Checked -- Checkerboard pattern.
  481. X
  482. X        Hatched -- Cross-hatching.
  483. X
  484. X        Diagonal -- Diagonal stripes going from upper left to to
  485. X        lower right. But if the value is negative, the stripes
  486. X        go from lower left to upper right.
  487. X
  488. X        Width -- Controls the width of the stripes drawn for the
  489. X        previous five types of pattern (Vertical, Horizontal,
  490. X        Checked, Hatched, and Diagonal). If the value is 0, nothing
  491. X        is drawn. Value 1 gives one dot wide lines, and value 2
  492. X        gives stripes of width 1/2 the periodicity. Higher values
  493. X        give wider stripes.
  494. X
  495. X^B    Box
  496. X
  497. X        Options for creating characters in boxes.
  498. X
  499. X        Width -- Sets the width of the box. Any non-zero value
  500. X        causes a clearance of at least two dot-spaces to be left
  501. X        on either side of each character.
  502. X
  503. X        Edge -- Sets the thickness of the edge.
  504. X
  505. X        Reverse -- A non-zero value causes a fill pattern for open
  506. X        characters to be placed outside the character, rather than
  507. X        inside.
  508. X
  509. X^S    set serif level
  510. X
  511. X        This has an effect only when a file of plotting points
  512. X        is read in, and then only if the plotting points responsible
  513. X        for drawing serifs have been identified with a prefix 'S'
  514. X        or 's'. When the serif level is 0, points 'S(x,y)' and
  515. X        's(x,y)' are ignored. When the level is 1, only points
  516. X        'S(x,y)' are ignored.  For higher levels, all points are
  517. X        used.
  518. X
  519. Xn    assign Name to font file
  520. X
  521. Xs    Save plotted characters in font file
  522. X
  523. X?    list commands and show room in buffers
  524. X
  525. X        Store room is what is left in the plotting point buffer.
  526. X        Font room is what is left in the font buffer.
  527. X
  528. X\    debug
  529. X
  530. X        Shows more stuff on screen as characters are being plotted.
  531. X
  532. Xx    eXit to unix
  533. X
  534. X
  535. X
  536. X
  537. X
  538. XHTRANS utility
  539. X
  540. XThe Hershey data base of occidental characters is available in the National
  541. XBureau of Standards Special Publication 424, but the machine-readable form
  542. Xas supplied by the NBS (or with the Fancy Font system) is in a compressed,
  543. Xnon-editable format. HPLOT, however, needs its plotting data in an editable
  544. Xtext file. HTRANS will extract a continuous range of characters from the
  545. Xcompressed file occidental.hsy and create the requisite text file. The
  546. Xcompressed Hershey file is not in the same format as distributed by the NTIS.
  547. X
  548. XFour items of information are asked for by HTRANS:
  549. X
  550. X(1) the name of the text file to be made (the extension .CHR will be added)
  551. X
  552. X(2) the sequential number of the starting character in the Hershey data base,
  553. X    from 0 to 1593 (these numbers are not the same as those given in the
  554. X    NBS publication mentioned above)
  555. X
  556. X(3) the first letter to associate plotting data with --- you can answer
  557. X    this query with a CR if you want the lists of points labeled by
  558. X    Hershey number
  559. X
  560. X(4) the last letter in the range of letters to associate plotting data
  561. X    or (if you answered the 3rd question with a CR)
  562. X    the last sequential number in the Hershey data base
  563. X
  564. X
  565. XWhen the points are labeled by Hershey number, you will have to edit the
  566. Xfile later to replace the number labels with character labels, since HPLOT
  567. Xneeds the latter.
  568. \Rogue\Monster\
  569. else
  570.   echo "will not over write ./plot.doc"
  571. fi
  572. if [ `wc -c ./plot.doc | awk '{printf $1}'` -ne 13136 ]
  573. then
  574. echo `wc -c ./plot.doc | awk '{print "Got " $1 ", Expected " 13136}'`
  575. fi
  576. if `test ! -s ./src.chr`
  577. then
  578. echo "writing ./src.chr"
  579. sed 's/^X//' > ./src.chr << '\Rogue\Monster\'
  580. X'A': Bounds(-9,9)(0,-12)(-8,9) Pen Up
  581. X    (0,-12)(8,9) Pen Up
  582. X    (-5,2)(5,2) End Char
  583. X'B': Bounds(-11,10)(-7,-12)(-7,9) Pen Up
  584. X    (-7,-12)(2,-12)(5,-11)(6,-10)(7,-8)(7,-6)(6,-4)(5,-3)(2,-2) Pen Up
  585. X    (-7,-2)(2,-2)(5,-1)(6,0)(7,2)(7,5)(6,7)(5,8)(2,9)
  586. X    (-7,9) End Char
  587. X'C': Bounds(-10,11)(8,-7)(7,-9)(5,-11)(3,-12)(-1,-12)(-3,-11)(-5,-9)(-6,-7)
  588. X    (-7,-4)(-7,1)(-6,4)(-5,6)(-3,8)(-1,9)(3,9)(5,8)(7,6)
  589. X    (8,4) End Char
  590. X'D': Bounds(-11,10)(-7,-12)(-7,9) Pen Up
  591. X    (-7,-12)(0,-12)(3,-11)(5,-9)(6,-7)(7,-4)(7,1)(6,4)(5,6)
  592. X    (3,8)(0,9)(-7,9) End Char
  593. X'E': Bounds(-10,9)(-6,-12)(-6,9) Pen Up
  594. X    (-6,-12)(7,-12) Pen Up
  595. X    (-6,-2)(2,-2) Pen Up
  596. X    (-6,9)(7,9) End Char
  597. X'F': Bounds(-10,8)(-6,-12)(-6,9) Pen Up
  598. X    (-6,-12)(7,-12) Pen Up
  599. X    (-6,-2)(2,-2) End Char
  600. X'G': Bounds(-10,11)(8,-7)(7,-9)(5,-11)(3,-12)(-1,-12)(-3,-11)(-5,-9)(-6,-7)
  601. X    (-7,-4)(-7,1)(-6,4)(-5,6)(-3,8)(-1,9)(3,9)(5,8)(7,6)
  602. X    (8,4)(8,1) Pen Up
  603. X    (3,1)(8,1) End Char
  604. X'H': Bounds(-11,11)(-7,-12)(-7,9) Pen Up
  605. X    (7,-12)(7,9) Pen Up
  606. X    (-7,-2)(7,-2) End Char
  607. X'I': Bounds(-4,4)(0,-12)(0,9) End Char
  608. X'J': Bounds(-8,8)(4,-12)(4,4)(3,7)(2,8)(0,9)(-2,9)(-4,8)(-5,7)
  609. X    (-6,4)(-6,2) End Char
  610. X'K': Bounds(-11,10)(-7,-12)(-7,9) Pen Up
  611. X    (7,-12)(-7,2) Pen Up
  612. X    (-2,-3)(7,9) End Char
  613. X'L': Bounds(-10,7)(-6,-12)(-6,9) Pen Up
  614. X    (-6,9)(6,9) End Char
  615. X'M': Bounds(-12,12)(-8,-12)(-8,9) Pen Up
  616. X    (-8,-12)(0,9) Pen Up
  617. X    (8,-12)(0,9) Pen Up
  618. X    (8,-12)(8,9) End Char
  619. X'N': Bounds(-11,11)(-7,-12)(-7,9) Pen Up
  620. X    (-7,-12)(7,9) Pen Up
  621. X    (7,-12)(7,9) End Char
  622. X'O': Bounds(-11,11)(-2,-12)(-4,-11)(-6,-9)(-7,-7)(-8,-4)(-8,1)(-7,4)(-6,6)
  623. X    (-4,8)(-2,9)(2,9)(4,8)(6,6)(7,4)(8,1)(8,-4)(7,-7)
  624. X    (6,-9)(4,-11)(2,-12)(-2,-12) End Char
  625. X'P': Bounds(-11,10)(-7,-12)(-7,9) Pen Up
  626. X    (-7,-12)(2,-12)(5,-11)(6,-10)(7,-8)(7,-5)(6,-3)(5,-2)(2,-1)
  627. X    (-7,-1) End Char
  628. X'Q': Bounds(-11,11)(-2,-12)(-4,-11)(-6,-9)(-7,-7)(-8,-4)(-8,1)(-7,4)(-6,6)
  629. X    (-4,8)(-2,9)(2,9)(4,8)(6,6)(7,4)(8,1)(8,-4)(7,-7)
  630. X    (6,-9)(4,-11)(2,-12)(-2,-12) Pen Up
  631. X    (1,5)(7,11) End Char
  632. X'R': Bounds(-11,10)(-7,-12)(-7,9) Pen Up
  633. X    (-7,-12)(2,-12)(5,-11)(6,-10)(7,-8)(7,-6)(6,-4)(5,-3)(2,-2)
  634. X    (-7,-2) Pen Up
  635. X    (0,-2)(7,9) End Char
  636. X'S': Bounds(-10,10)(7,-9)(5,-11)(2,-12)(-2,-12)(-5,-11)(-7,-9)(-7,-7)(-6,-5)
  637. X    (-5,-4)(-3,-3)(3,-1)(5,0)(6,1)(7,3)(7,6)(5,8)(2,9)
  638. X    (-2,9)(-5,8)(-7,6) End Char
  639. X'T': Bounds(-8,8)(0,-12)(0,9) Pen Up
  640. X    (-7,-12)(7,-12) End Char
  641. X'U': Bounds(-11,11)(-7,-12)(-7,3)(-6,6)(-4,8)(-1,9)(1,9)(4,8)(6,6)
  642. X    (7,3)(7,-12) End Char
  643. X'V': Bounds(-9,9)(-8,-12)(0,9) Pen Up
  644. X    (8,-12)(0,9) End Char
  645. X'W': Bounds(-12,12)(-10,-12)(-5,9) Pen Up
  646. X    (0,-12)(-5,9) Pen Up
  647. X    (0,-12)(5,9) Pen Up
  648. X    (10,-12)(5,9) End Char
  649. X'X': Bounds(-10,10)(-7,-12)(7,9) Pen Up
  650. X    (7,-12)(-7,9) End Char
  651. X'Y': Bounds(-9,9)(-8,-12)(0,-2)(0,9) Pen Up
  652. X    (8,-12)(0,-2) End Char
  653. X'Z': Bounds(-10,10)(7,-12)(-7,9) Pen Up
  654. X    (-7,-12)(7,-12) Pen Up
  655. X    (-7,9)(7,9) End Char
  656. X
  657. X)(-2,9)(2,9)(4,8)(6,6)(7,4)(8,1)(8,-4)(7,-7)
  658. X    (6,-9)(4,-11)(2,-12)(-2,-12) Pen Up
  659. \Rogue\Monster\
  660. else
  661.   echo "will not over write ./src.chr"
  662. fi
  663. if [ `wc -c ./src.chr | awk '{printf $1}'` -ne 2992 ]
  664. then
  665. echo `wc -c ./src.chr | awk '{print "Got " $1 ", Expected " 2992}'`
  666. fi
  667. if `test ! -s ./srd.chr`
  668. then
  669. echo "writing ./srd.chr"
  670. sed 's/^X//' > ./srd.chr << '\Rogue\Monster\'
  671. X'0': Bounds(-10,10)(-1,-12)(-4,-11)(-6,-8)(-7,-3)(-7,0)(-6,5)(-4,8)(-1,9)
  672. X    (1,9)(4,8)(6,5)(7,0)(7,-3)(6,-8)(4,-11)(1,-12)(-1,-12) End Char
  673. X'1': Bounds(-10,10)(-4,-8)(-2,-9)(1,-12)(1,9) End Char
  674. X'2': Bounds(-10,10)(-6,-7)(-6,-8)(-5,-10)(-4,-11)(-2,-12)(2,-12)(4,-11)(5,-10)
  675. X    (6,-8)(6,-6)(5,-4)(3,-1)(-7,9)(7,9) End Char
  676. X'3': Bounds(-10,10)(-5,-12)(6,-12)(0,-4)(3,-4)(5,-3)(6,-2)(7,1)(7,3)
  677. X    (6,6)(4,8)(1,9)(-2,9)(-5,8)(-6,7)(-7,5) End Char
  678. X'4': Bounds(-10,10)(3,-12)(-7,2)(8,2) Pen Up
  679. X    (3,-12)(3,9) End Char
  680. X'5': Bounds(-10,10)(5,-12)(-5,-12)(-6,-3)(-5,-4)(-2,-5)(1,-5)(4,-4)(6,-2)
  681. X    (7,1)(7,3)(6,6)(4,8)(1,9)(-2,9)(-5,8)(-6,7)(-7,5) End Char
  682. X'6': Bounds(-10,10)(6,-9)(5,-11)(2,-12)(0,-12)(-3,-11)(-5,-8)(-6,-3)(-6,2)
  683. X    (-5,6)(-3,8)(0,9)(1,9)(4,8)(6,6)(7,3)(7,2)(6,-1)
  684. X    (4,-3)(1,-4)(0,-4)(-3,-3)(-5,-1)(-6,2) End Char
  685. X'7': Bounds(-10,10)(7,-12)(-3,9) Pen Up
  686. X    (-7,-12)(7,-12) End Char
  687. X'8': Bounds(-10,10)(-2,-12)(-5,-11)(-6,-9)(-6,-7)(-5,-5)(-3,-4)(1,-3)(4,-2)
  688. X    (6,0)(7,2)(7,5)(6,7)(5,8)(2,9)(-2,9)(-5,8)(-6,7)
  689. X    (-7,5)(-7,2)(-6,0)(-4,-2)(-1,-3)(3,-4)(5,-5)(6,-7)(6,-9)
  690. X    (5,-11)(2,-12)(-2,-12) End Char
  691. X'9': Bounds(-10,10)(6,-5)(5,-2)(3,0)(0,1)(-1,1)(-4,0)(-6,-2)(-7,-5)
  692. X    (-7,-6)(-6,-9)(-4,-11)(-1,-12)(0,-12)(3,-11)(5,-9)(6,-5)(6,0)
  693. X    (5,5)(3,8)(0,9)(-2,9)(-5,8)(-6,6) End Char
  694. \Rogue\Monster\
  695. else
  696.   echo "will not over write ./srd.chr"
  697. fi
  698. if [ `wc -c ./srd.chr | awk '{printf $1}'` -ne 1311 ]
  699. then
  700. echo `wc -c ./srd.chr | awk '{print "Got " $1 ", Expected " 1311}'`
  701. fi
  702. if `test ! -s ./srp.chr`
  703. then
  704. echo "writing ./srp.chr"
  705. sed 's/^X//' > ./srp.chr << '\Rogue\Monster\'
  706. X*
  707. X*    Simplex Roman punctuation
  708. X*
  709. X*21
  710. X'!': Bounds(-5,5)(0,-12)(0,2) Pen Up
  711. X    (0,7)(-1,8)(0,9)(1,8)(0,7) End Char
  712. X*22
  713. X'"': Bounds(-8,8)(-4,-12)(-4,-5) Pen Up
  714. X    (4,-12)(4,-5) End Char
  715. X*23
  716. X'#': Bounds(-10,11)(1,-12)(-6,16) Pen Up
  717. X    (7,-12)(0,16) Pen Up
  718. X    (-6,-1)(8,-1) Pen Up
  719. X    (-7,5)(7,5) End Char
  720. X*24
  721. X'$': Bounds(-10,10)(-2,-12)(-2,11) Pen Up
  722. X    (2,-12)(2,11) Pen Up
  723. X    (7,-7)(5,-9)(2,-10)(-2,-10)(-5,-9)(-7,-7)(-7,-6)(-6,-4)(-5,-3)
  724. X    (-3,-2)(3,0)(5,1)(6,2)(7,4)(7,6)(5,8)(2,9)(-2,9)
  725. X    (-5,8)(-7,6) End Char
  726. X*25    918    %
  727. X'%': Bounds(-12,12)(9,-12)(-9,9) Pen Up
  728. X    (-4,-12)(-2,-10)(-2,-8)(-3,-6)(-5,-5)(-7,-5)(-9,-7)(-9,-9)(-8,-11)
  729. X    (-6,-12)(-4,-12)(-2,-11)(1,-10)(4,-10)(7,-11)(9,-12) Pen Up
  730. X    (5,2)(3,3)(2,5)(2,7)(4,9)(6,9)(8,8)(9,6)(9,4)
  731. X    (7,2)(5,2) End Char
  732. X*26
  733. X'&': Bounds(-13,13)(10,-3)(10,-4)(9,-5)(8,-5)(7,-4)(6,-2)(4,3)(2,6)
  734. X    (0,8)(-2,9)(-6,9)(-8,8)(-9,7)(-10,5)(-10,3)(-9,1)(-8,0)
  735. X    (-1,-4)(0,-5)(1,-7)(1,-9)(0,-11)(-2,-12)(-4,-11)(-5,-9)(-5,-7)
  736. X    (-4,-4)(-2,-1)(3,6)(5,8)(7,9)(9,9)(10,8)(10,7) End Char
  737. X*27
  738. X''': Bounds(-4,4)(3,-12)(0,-5) End Char
  739. X*28
  740. X'(': Bounds(-7,7)(4,-12)(2,-10)(0,-8)(-2,-5)(-3,0)(-3,4)(-2,9)(0,12)
  741. X    (2,14)(4,16) End Char
  742. X*29
  743. X')': Bounds(-7,7)(-4,-12)(-2,-10)(0,-8)(2,-5)(3,0)(3,4)(2,9)(0,12)
  744. X    (-2,14)(-4,16) End Char
  745. X*2A
  746. X'*': Bounds(-8,8)(0,-6)(0,6) Pen Up
  747. X    (-5,-3)(5,3) Pen Up
  748. X    (5,-3)(-5,3) End Char
  749. X*2B
  750. X'+': Bounds(-13,13)(0,-9)(0,9) Pen Up
  751. X    (-9,0)(9,0) End Char
  752. X*2C
  753. X',': Bounds(-5,5)(1,8)(0,9)(-1,8)(0,7)(1,8)(1,10)(0,12)(-1,13) End Char
  754. X*2D
  755. X'-': Bounds(-13,13)(-4,0)(4,0) End Char
  756. X*2E
  757. X'.': Bounds(-5,5)(0,7)(-1,8)(0,9)(1,8)(0,7) End Char
  758. X*2F
  759. X'/': Bounds(-11,11)(9,-12)(-9,16) End Char
  760. X*3A
  761. X':': Bounds(-5,5)(0,-5)(-1,-4)(0,-3)(1,-4)(0,-5) Pen Up
  762. X    (0,7)(-1,8)(0,9)(1,8)(0,7) End Char
  763. X*3B
  764. X';': Bounds(-5,5)(0,-5)(-1,-4)(0,-3)(1,-4)(0,-5) Pen Up
  765. X    (1,8)(0,9)(-1,8)(0,7)(1,8)(1,10)(0,12)(-1,13) End Char
  766. X*3C    888    <
  767. X'<': Bounds(-12,12)(8,-9)(-8,0)(8,9) End Char
  768. X*3D
  769. X'=': Bounds(-13,13)(-9,-3)(9,-3) Pen Up
  770. X    (-9,3)(9,3) End Char
  771. X*3E    889    >
  772. X'>': Bounds(-12,12)(-8,-9)(8,0)(-8,9) End Char
  773. X*3F
  774. X'?': Bounds(-9,9)(-6,-7)(-6,-8)(-5,-10)(-4,-11)(-2,-12)(2,-12)(4,-11)(5,-10)
  775. X    (6,-8)(6,-6)(5,-4)(4,-3)(0,-1)(0,2) Pen Up
  776. X    (0,7)(-1,8)(0,9)(1,8)(0,7) End Char
  777. X*40    920    @
  778. X'@': Bounds(-13,14)(5,-4)(4,-6)(2,-7)(-1,-7)(-3,-6)(-4,-5)(-5,-2)(-5,1)
  779. X    (-4,3)(-2,4)(1,4)(3,3)(4,1) Pen Up
  780. X    (-1,-7)(-3,-5)(-4,-2)(-4,1)(-3,3)(-2,4) Pen Up
  781. X    (5,-7)(4,1)(4,3)(6,4)(8,4)(10,2)(11,-1)(11,-3)(10,-6)
  782. X    (9,-8)(7,-10)(5,-11)(2,-12)(-1,-12)(-4,-11)(-6,-10)(-8,-8)(-9,-6)
  783. X    (-10,-3)(-10,0)(-9,3)(-8,5)(-6,7)(-4,8)(-1,9)(2,9)(5,8)
  784. X    (7,7)(8,6) Pen Up
  785. X    (6,-7)(5,1)(5,3)(6,4) End Char
  786. X*5B
  787. X'[': Bounds(-7,7)(-3,-12)(-3,16) Pen Up
  788. X    (-3,-12)(4,-12) Pen Up
  789. X    (-3,16)(4,16) End Char
  790. X*5C
  791. X'/': Bounds(-11,11)(-9,-12)(9,16) End Char
  792. X*5D
  793. X']': Bounds(-7,7)(3,-12)(3,16) Pen Up
  794. X    (-4,-12)(3,-12) Pen Up
  795. X    (-4,16)(3,16) End Char
  796. X*5E    up arrow
  797. X'^': Bounds(-8,8)(-2,-6)(0,-9)(2,-6) Pen Up
  798. X    (-5,-3)(0,-8)(5,-3) Pen Up
  799. X    (0,-8)(0,9) End Char
  800. X*5F    _
  801. X'_': Bounds(-13,13)(-9,16)(9,16) End Char
  802. X*60    `
  803. X'`': Bounds(-4,4)(-3,-12)(0,-5) End Char
  804. X*7B
  805. X'{': Bounds(-7,7)(2,-12)(0,-11)(-1,-10)(-2,-9)(-2,-7)(-1,-6)(0,-5)(1,-3)
  806. X    (1,-1)(-1,1) Pen Up
  807. X    (0,-11)(-1,-9)(-1,-8)(0,-7)(1,-6)(2,-4)(2,-2)(1,0)(-3,2)
  808. X    (1,4)(2,6)(2,8)(1,10)(0,11)(-1,12)(-1,13)(0,15) Pen Up
  809. X    (-1,3)(1,5)(1,7)(0,9)(-1,10)(-2,11)(-2,13)(-1,14)(0,15)
  810. X    (2,16) End Char
  811. X*7C
  812. X'|': Bounds(-4,4)(0,-12)(0,16) End Char
  813. X*7D
  814. X'}': Bounds(-7,7)(-2,-12)(0,-11)(1,-10)(2,-9)(2,-7)(1,-6)(0,-5)(-1,-3)
  815. X    (-1,-1)(1,1) Pen Up
  816. X    (0,-11)(1,-9)(1,-8)(0,-7)(-1,-6)(-2,-4)(-2,-2)(-1,0)(3,2)
  817. X    (-1,4)(-2,6)(-2,8)(-1,10)(0,11)(1,12)(1,13)(0,15) Pen Up
  818. X    (1,3)(-1,5)(-1,7)(0,9)(1,10)(2,11)(2,13)(1,14)(0,15)
  819. X    (-2,16) End Char
  820. X*7E    893    low tilde
  821. X'~': Bounds(-12,12)(-9,3)(-9,1)(-8,-2)(-6,-3)(-4,-3)(-2,-2)(2,1)(4,2)
  822. X    (6,2)(8,1)(9,-1) Pen Up
  823. X    (-9,1)(-8,-1)(-6,-2)(-4,-2)(-2,-1)(2,2)(4,3)(6,3)(8,2)
  824. X    (9,-1)(9,-3) End Char
  825. X
  826. X*FROM SPECIAL
  827. X*from 894    low circumflex
  828. X^D': Bounds(-11,11)(-8,-8)(0,-12)(8,-8) End Char
  829. X*895    acute
  830. X^C': Bounds(-6,6)(2,-12)(-3,-6) Pen Up
  831. X    (2,-12)(3,-11)(-3,-6) End Char
  832. X*896    grave
  833. X^B': Bounds(-6,6)(-2,-12)(3,-6) Pen Up
  834. X    (-2,-12)(-3,-11)(3,-6) End Char
  835. X*897    short
  836. X^S': Bounds(-10,10)(-7,-12)(-6,-10)(-4,-8)(-1,-7)(1,-7)(4,-8)(6,-10)(7,-12) Pen Up
  837. X    (-7,-12)(-6,-9)(-4,-7)(-1,-6)(1,-6)(4,-7)(6,-9)(7,-12) End Char
  838. X*923    section
  839. X^M': Bounds(-8,8)(3,-9)(2,-8)(3,-7)(4,-8)(4,-9)(3,-11)(1,-12)(-1,-12)
  840. X    (-3,-11)(-4,-9)(-4,-7)(-3,-5)(-1,-3)(4,0) Pen Up
  841. X    (-3,-5)(2,-2)(4,0)(5,2)(5,4)(4,6)(2,8) Pen Up
  842. X    (-2,-4)(-4,-2)(-5,0)(-5,2)(-4,4)(-2,6)(3,9) Pen Up
  843. X    (-4,4)(1,7)(3,9)(4,11)(4,13)(3,15)(1,16)(-1,16)(-3,15)
  844. X    (-4,13)(-4,12)(-3,11)(-2,12)(-3,13) End Char
  845. X*924    dagger
  846. X^K': Bounds(-8,8)(0,-12)(-1,-10)(0,-8)(1,-10)(0,-12) Pen Up
  847. X    (0,-12)(0,16) Pen Up
  848. X    (0,-1)(-1,2)(0,16)(1,2)(0,-1) Pen Up
  849. X    (-6,-5)(-4,-4)(-2,-5)(-4,-6)(-6,-5) Pen Up
  850. X    (-6,-5)(6,-5) Pen Up
  851. X    (2,-5)(4,-4)(6,-5)(4,-6)(2,-5) End Char
  852. X*925    double dagger
  853. X^L': Bounds(-8,8)(0,-12)(-1,-10)(0,-8)(1,-10)(0,-12) Pen Up
  854. X    (0,-12)(0,2) Pen Up
  855. X    (0,-2)(-1,0)(1,4)(0,6)(-1,4)(1,0)(0,-2) Pen Up
  856. X    (0,2)(0,16) Pen Up
  857. X    (0,12)(-1,14)(0,16)(1,14)(0,12) Pen Up
  858. X    (-6,-5)(-4,-4)(-2,-5)(-4,-6)(-6,-5) Pen Up
  859. X    (-6,-5)(6,-5) Pen Up
  860. X    (2,-5)(4,-4)(6,-5)(4,-6)(2,-5) Pen Up
  861. X    (-6,9)(-4,10)(-2,9)(-4,8)(-6,9) Pen Up
  862. X    (-6,9)(6,9) Pen Up
  863. X    (2,9)(4,10)(6,9)(4,8)(2,9) End Char
  864. X
  865. X
  866. \Rogue\Monster\
  867. else
  868.   echo "will not over write ./srp.chr"
  869. fi
  870. if [ `wc -c ./srp.chr | awk '{printf $1}'` -ne 5410 ]
  871. then
  872. echo `wc -c ./srp.chr | awk '{print "Got " $1 ", Expected " 5410}'`
  873. fi
  874. if `test ! -s ./srs.chr`
  875. then
  876. echo "writing ./srs.chr"
  877. sed 's/^X//' > ./srs.chr << '\Rogue\Monster\'
  878. XHeight(22)
  879. Xx Height(15)
  880. XBase(9)
  881. X'a': Bounds(-9,10)(6,-5)(6,9) Pen Up
  882. X    (6,-2)(4,-4)(2,-5)(-1,-5)(-3,-4)(-5,-2)(-6,1)(-6,3)(-5,6)
  883. X    (-3,8)(-1,9)(2,9)(4,8)(6,6) End Char
  884. X'b': Bounds(-10,9)(-6,-12)(-6,9) Pen Up
  885. X    (-6,-2)(-4,-4)(-2,-5)(1,-5)(3,-4)(5,-2)(6,1)(6,3)(5,6)
  886. X    (3,8)(1,9)(-2,9)(-4,8)(-6,6) End Char
  887. X'c': Bounds(-9,9)(6,-2)(4,-4)(2,-5)(-1,-5)(-3,-4)(-5,-2)(-6,1)(-6,3)
  888. X    (-5,6)(-3,8)(-1,9)(2,9)(4,8)(6,6) End Char
  889. X'd': Bounds(-9,10)(6,-12)(6,9) Pen Up
  890. X    (6,-2)(4,-4)(2,-5)(-1,-5)(-3,-4)(-5,-2)(-6,1)(-6,3)(-5,6)
  891. X    (-3,8)(-1,9)(2,9)(4,8)(6,6) End Char
  892. X'e': Bounds(-9,9)(-6,1)(6,1)(6,-1)(5,-3)(4,-4)(2,-5)(-1,-5)(-3,-4)
  893. X    (-5,-2)(-6,1)(-6,3)(-5,6)(-3,8)(-1,9)(2,9)(4,8)(6,6) End Char
  894. X'f': Bounds(-5,7)(5,-12)(3,-12)(1,-11)(0,-8)(0,9) Pen Up
  895. X    (-3,-5)(4,-5) End Char
  896. X'g': Bounds(-9,10)(6,-5)(6,11)(5,14)(4,15)(2,16)(-1,16)(-3,15) Pen Up
  897. X    (6,-2)(4,-4)(2,-5)(-1,-5)(-3,-4)(-5,-2)(-6,1)(-6,3)(-5,6)
  898. X    (-3,8)(-1,9)(2,9)(4,8)(6,6) End Char
  899. X'h': Bounds(-9,10)(-5,-12)(-5,9) Pen Up
  900. X    (-5,-1)(-2,-4)(0,-5)(3,-5)(5,-4)(6,-1)(6,9) End Char
  901. X'i': Bounds(-4,4)(-1,-12)(0,-11)(1,-12)(0,-13)(-1,-12) Pen Up
  902. X    (0,-5)(0,9) End Char
  903. X'j': Bounds(-5,5)(0,-12)(1,-11)(2,-12)(1,-13)(0,-12) Pen Up
  904. X    (1,-5)(1,12)(0,15)(-2,16)(-4,16) End Char
  905. X'k': Bounds(-9,8)(-5,-12)(-5,9) Pen Up
  906. X    (5,-5)(-5,5) Pen Up
  907. X    (-1,1)(6,9) End Char
  908. X'l': Bounds(-4,4)(0,-12)(0,9) End Char
  909. X'm': Bounds(-15,15)(-11,-5)(-11,9) Pen Up
  910. X    (-11,-1)(-8,-4)(-6,-5)(-3,-5)(-1,-4)(0,-1)(0,9) Pen Up
  911. X    (0,-1)(3,-4)(5,-5)(8,-5)(10,-4)(11,-1)(11,9) End Char
  912. X'n': Bounds(-9,10)(-5,-5)(-5,9) Pen Up
  913. X    (-5,-1)(-2,-4)(0,-5)(3,-5)(5,-4)(6,-1)(6,9) End Char
  914. X'o': Bounds(-9,10)(-1,-5)(-3,-4)(-5,-2)(-6,1)(-6,3)(-5,6)(-3,8)(-1,9)
  915. X    (2,9)(4,8)(6,6)(7,3)(7,1)(6,-2)(4,-4)(2,-5)(-1,-5) End Char
  916. X'p': Bounds(-10,9)(-6,-5)(-6,16) Pen Up
  917. X    (-6,-2)(-4,-4)(-2,-5)(1,-5)(3,-4)(5,-2)(6,1)(6,3)(5,6)
  918. X    (3,8)(1,9)(-2,9)(-4,8)(-6,6) End Char
  919. X'q': Bounds(-9,10)(6,-5)(6,16) Pen Up
  920. X    (6,-2)(4,-4)(2,-5)(-1,-5)(-3,-4)(-5,-2)(-6,1)(-6,3)(-5,6)
  921. X    (-3,8)(-1,9)(2,9)(4,8)(6,6) End Char
  922. X'r': Bounds(-7,6)(-3,-5)(-3,9) Pen Up
  923. X    (-3,1)(-2,-2)(0,-4)(2,-5)(5,-5) End Char
  924. X's': Bounds(-8,9)(6,-2)(5,-4)(2,-5)(-1,-5)(-4,-4)(-5,-2)(-4,0)(-2,1)
  925. X    (3,2)(5,3)(6,5)(6,6)(5,8)(2,9)(-1,9)(-4,8)(-5,6) End Char
  926. X't': Bounds(-5,7)(0,-12)(0,5)(1,8)(3,9)(5,9) Pen Up
  927. X    (-3,-5)(4,-5) End Char
  928. X'u': Bounds(-9,10)(-5,-5)(-5,5)(-4,8)(-2,9)(1,9)(3,8)(6,5) Pen Up
  929. X    (6,-5)(6,9) End Char
  930. X'v': Bounds(-8,8)(-6,-5)(0,9) Pen Up
  931. X    (6,-5)(0,9) End Char
  932. X'w': Bounds(-11,11)(-8,-5)(-4,9) Pen Up
  933. X    (0,-5)(-4,9) Pen Up
  934. X    (0,-5)(4,9) Pen Up
  935. X    (8,-5)(4,9) End Char
  936. X'x': Bounds(-8,9)(-5,-5)(6,9) Pen Up
  937. X    (6,-5)(-5,9) End Char
  938. X'y': Bounds(-8,8)(-6,-5)(0,9) Pen Up
  939. X    (6,-5)(0,9)(-2,13)(-4,15)(-6,16)(-7,16) End Char
  940. X'z': Bounds(-8,9)(6,-5)(-5,9) Pen Up
  941. X    (-5,-5)(6,-5) Pen Up
  942. X    (-5,9)(6,9) End Char
  943. X
  944. \Rogue\Monster\
  945. else
  946.   echo "will not over write ./srs.chr"
  947. fi
  948. if [ `wc -c ./srs.chr | awk '{printf $1}'` -ne 2847 ]
  949. then
  950. echo `wc -c ./srs.chr | awk '{print "Got " $1 ", Expected " 2847}'`
  951. fi
  952. if `test ! -s ./termio.c`
  953. then
  954. echo "writing ./termio.c"
  955. sed 's/^X//' > ./termio.c << '\Rogue\Monster\'
  956. X#include "termio.h"
  957. X
  958. Xchar    *getenv(),        /* These are here so we can use termlib */
  959. X    *tgetstr(),
  960. X    PC;            /* global used for padding character */
  961. X#undef    putchar            /* need to undefine it so we can redefine it */
  962. Xint    putchar();
  963. Xshort    ospeed;            /* global used by tputs */
  964. Xchar    *term_name,
  965. X    str_buf[60],
  966. X    *ptr2ptr,
  967. X    *cl_str,
  968. X    *cm_str,
  969. X    *ce_str,
  970. X    terminfo_buff[1024];
  971. X    
  972. X
  973. Xint    timer();        /* pre-declare for signal setup in unblocked_io    */
  974. Xjmp_buf    env;            /* environment storage for setjmp/longjmp */
  975. X
  976. Xstruct    sgttyb    org_stty,    /* Global so that we can restore Exact state */
  977. X        cur_stty;
  978. X
  979. X/*
  980. X    Assign_tty: Attempts to open a tty device by pathname (ie.
  981. X    /dev/ttyi2). If successful, then return file descriptor, else
  982. X    return -1. Will also set terminal for exclusive use mode if
  983. X    open was successful.
  984. X
  985. X    On Entry: string pointer to tty pathname
  986. X    On Exit:  file descriptor or -1 for failure
  987. X*/
  988. X
  989. Xassign_tty(path)
  990. Xchar    *path;
  991. X{
  992. Xint    tty_fd;
  993. X
  994. X    if ( (tty_fd = open(path, O_RDWR)) >= 0 )
  995. X    {
  996. X        if ( ioctl(tty_fd, TIOCEXCL) == -1 )
  997. X        {
  998. X            tty_fd = -1;
  999. X        }
  1000. X    }
  1001. X    return((tty_fd < 0) ? -1 : tty_fd);
  1002. X}
  1003. X
  1004. X
  1005. X/*
  1006. X    Deassign_tty: Attempts to close a tty device by file descriptor.
  1007. X    First, will reset tty to non-exclusive use mode.
  1008. X
  1009. X    On Entry: int file descriptor
  1010. X    On Exit:  0 for success or -1 for failure
  1011. X*/
  1012. X
  1013. Xdeassign_tty(tty_fd)
  1014. Xint    tty_fd;
  1015. X{
  1016. X
  1017. X    ioctl(tty_fd, TIOCNXCL);
  1018. X    return(close(tty_fd));
  1019. X}
  1020. X
  1021. X
  1022. X/* 
  1023. X    Get_tty: Will return the current sgttyb structure information
  1024. X         for a previously assigned tty.
  1025. X
  1026. X    On Entry: tty file descriptor, and a pointer to a structure to
  1027. X          store the information in.
  1028. X    On Exit:  return -1 if error else tty info in structure if all ok
  1029. X*/
  1030. X
  1031. X
  1032. Xget_tty(tty_fd, tty_struct)
  1033. Xint    tty_fd;
  1034. Xstruct    sgttyb    *tty_struct;
  1035. X{
  1036. X    return(ioctl(tty_fd, TIOCGETP, tty_struct));
  1037. X}
  1038. X
  1039. X
  1040. X
  1041. X/* 
  1042. X    Set_tty: Will set a previously assigned tty to the parameters
  1043. X         passed in the sgttyb structure.
  1044. X
  1045. X    On Entry: tty file descriptor, and a pointer to a structure to
  1046. X          read the information from.
  1047. X    On Exit:  return -1 if error.
  1048. X*/
  1049. X
  1050. X
  1051. Xset_tty(tty_fd, tty_struct)
  1052. Xint    tty_fd;
  1053. Xstruct    sgttyb    *tty_struct;
  1054. X{
  1055. X    return(ioctl(tty_fd, TIOCSETP, tty_struct));
  1056. X}
  1057. X
  1058. X
  1059. X/*
  1060. X    Raw_tty: Attempts to open a tty device by pathname (ie.
  1061. X    /dev/ttyi2), and then will set terminal up for raw i/o
  1062. X    mode.
  1063. X
  1064. X    On Entry: string pointer to tty pathname
  1065. X    On Exit:  file descriptor or -1 for failure
  1066. X*/
  1067. X
  1068. Xraw_tty(terminal)
  1069. Xchar    *terminal;
  1070. X{
  1071. Xint    tty_fd;
  1072. X
  1073. X    if ( -1 == (tty_fd = assign_tty(terminal)) )
  1074. X    {
  1075. X        return(-1);        /* return with error code    */
  1076. X    }
  1077. X
  1078. X    if ( -1 == get_tty(tty_fd, &org_stty) )
  1079. X    {
  1080. X        deassign_tty(tty_fd);
  1081. X        return(-1);        /* return with error code    */
  1082. X    }
  1083. X
  1084. X    cur_stty = org_stty;        /* copy information    */
  1085. X    cur_stty.sg_flags |= RAW;    /* raw mode (all 8 bits pass)    */
  1086. X    cur_stty.sg_flags &= ~(TANDEM|ECHO|CRMOD);    /* remove all char processing */
  1087. X
  1088. X    if ( -1 == set_tty(tty_fd, &cur_stty) )
  1089. X    {
  1090. X        deassign_tty(tty_fd);
  1091. X        return(-1);        /* return with error code    */
  1092. X    }
  1093. X    return(tty_fd);        /* all went well, return tty file desc    */
  1094. X}
  1095. X
  1096. X
  1097. X/*
  1098. X    cbreak_tty: Attempts to open a tty device by pathname (ie.
  1099. X    /dev/ttyi2), and then will set terminal up for cbreak i/o
  1100. X    mode.
  1101. X
  1102. X    On Entry: string pointer to tty pathname
  1103. X    On Exit:  file descriptor or -1 for failure
  1104. X*/
  1105. X
  1106. Xcbreak_tty(terminal)
  1107. Xchar    *terminal;
  1108. X{
  1109. Xint    tty_fd;
  1110. X
  1111. X    if ( -1 == (tty_fd = assign_tty(terminal)) )
  1112. X    {
  1113. X        return(-1);        /* return with error code    */
  1114. X    }
  1115. X
  1116. X    if ( -1 == get_tty(tty_fd, &org_stty) )
  1117. X    {
  1118. X        deassign_tty(tty_fd);
  1119. X        return(-1);        /* return with error code    */
  1120. X    }
  1121. X
  1122. X    cur_stty = org_stty;        /* copy information    */
  1123. X    cur_stty.sg_flags |= CBREAK;    /* raw mode (all 8 bits pass)    */
  1124. X/*    cur_stty.sg_flags &= ~(TANDEM|ECHO|CRMOD); remove all char processing */
  1125. X
  1126. X    if ( -1 == set_tty(tty_fd, &cur_stty) )
  1127. X    {
  1128. X        deassign_tty(tty_fd);
  1129. X        return(-1);        /* return with error code    */
  1130. X    }
  1131. X    return(tty_fd);        /* all went well, return tty file desc    */
  1132. X}
  1133. X
  1134. X
  1135. X/*
  1136. X    cook_tty: Will set a terminal back to its original state by
  1137. X    file descriptor and will leave that descriptor open.
  1138. X
  1139. X    On Entry: tty file descriptor
  1140. X    On Exit:  returns 0 on success or -1 on failure
  1141. X*/
  1142. X
  1143. Xcook_tty(tty_fd)
  1144. Xint    tty_fd;
  1145. X{
  1146. X    if ( -1 == set_tty(tty_fd, &org_stty) )
  1147. X    {
  1148. X        return(-1);        /* return with error code    */
  1149. X    }
  1150. X
  1151. X    return(0);    /* return with no errors    */
  1152. X}
  1153. X
  1154. X
  1155. X/*
  1156. X    uncook_tty: Will set a terminal back to its raw state by
  1157. X    file descriptor and will leave that descriptor open.
  1158. X
  1159. X    On Entry: tty file descriptor
  1160. X    On Exit:  returns 0 on success or -1 on failure
  1161. X*/
  1162. X
  1163. Xuncook_tty(tty_fd)
  1164. Xint    tty_fd;
  1165. X{
  1166. X    if ( -1 == set_tty(tty_fd, &cur_stty) )
  1167. X    {
  1168. X        return(-1);        /* return with error code    */
  1169. X    }
  1170. X
  1171. X    return(0);    /* return with no errors    */
  1172. X}
  1173. X
  1174. X
  1175. X/*
  1176. X    reset_tty: Attempts to set a terminal back to its original state by
  1177. X    file descriptor and then will close tty file descriptor.
  1178. X
  1179. X    On Entry: tty file descriptor
  1180. X    On Exit:  returns 0 on success or -1 on failure
  1181. X*/
  1182. X
  1183. Xreset_tty(tty_fd)
  1184. Xint    tty_fd;
  1185. X{
  1186. X    if ( -1 == set_tty(tty_fd, &org_stty) )
  1187. X    {
  1188. X        deassign_tty(tty_fd);
  1189. X        return(-1);        /* return with error code    */
  1190. X    }
  1191. X
  1192. X    deassign_tty(tty_fd);
  1193. X    return(0);    /* return with no errors    */
  1194. X}
  1195. X
  1196. X
  1197. X/*
  1198. X    blocked_io: Attempts to set a terminal to blocked i/o mode by
  1199. X    file descriptor.
  1200. X
  1201. X    On Entry: tty file descriptor
  1202. X    On Exit:  returns fcntl value on success or -1 on failure
  1203. X*/
  1204. X
  1205. Xblocked_io(tty_fd)
  1206. Xint    tty_fd;
  1207. X{
  1208. Xint    f_flags;
  1209. X
  1210. X    f_flags = fcntl(tty_fd, F_GETFL, 0);    /* get current file flags */
  1211. X    if (f_flags == -1)
  1212. X    {
  1213. X        return(-1);
  1214. X    }
  1215. X    f_flags += FNDELAY;    /* no delay on read/write (no blocking i/o) */
  1216. X    return(fcntl(tty_fd, F_SETFL, f_flags));
  1217. X}
  1218. X
  1219. X
  1220. X/*
  1221. X    unblocked_io: Attempts to set a terminal to unblocked i/o mode by
  1222. X    file descriptor.
  1223. X
  1224. X    On Entry: tty file descriptor
  1225. X    On Exit:  returns fcntl value on success or -1 on failure
  1226. X*/
  1227. X
  1228. Xunblocked_io(tty_fd)
  1229. Xint    tty_fd;
  1230. X{
  1231. Xint    f_flags;
  1232. X
  1233. X    f_flags = fcntl(tty_fd, F_GETFL, 0);    /* get current file flags */
  1234. X    if (f_flags == -1)
  1235. X    {
  1236. X        return(-1);
  1237. X    }
  1238. X    f_flags -= FNDELAY;    /* delay on read/write (blocking i/o) */
  1239. X    return(fcntl(tty_fd, F_SETFL, f_flags));
  1240. X}
  1241. X
  1242. X
  1243. X/*    timer: Is an interrupt routine that will perform a longjmp     */
  1244. X/*        when it is called by the alarm interrupt.        */
  1245. X
  1246. Xtimer(signal)
  1247. Xint    signal;    /* variable to catch signal sent to routine.    */
  1248. X        /* we will just ignore it.            */
  1249. X{
  1250. X    longjmp(env, 1);
  1251. X}
  1252. X
  1253. X
  1254. X/*    timed_read: Will attempt to read from the terminal specified    */
  1255. X/*            by the tty file descriptor for a set period of time.*/
  1256. X/*                                    */
  1257. X/*    On Entry: tty file descriptor to read from, pointer to a byte    */
  1258. X/*          to return received char in number of bytes to read    */
  1259. X/*          and time in seconds.                    */
  1260. X/*    On Exit:  0 for ok read or -1 for no char received.        */
  1261. X/*                                    */
  1262. X
  1263. Xtimed_read(tty_fd, ch, count, seconds)
  1264. Xint    tty_fd,
  1265. X    count;
  1266. Xbyte    *ch;
  1267. Xunsigned    seconds;
  1268. X{
  1269. Xint    ret_code,
  1270. X    tim_code;
  1271. X
  1272. X
  1273. X    signal(SIGALRM, timer);
  1274. X    alarm(seconds);
  1275. X
  1276. X    ret_code = -1;    /* assume bad read */
  1277. X
  1278. X    tim_code = setjmp(env);
  1279. X    while ( (tim_code == 0) && (ret_code != 1) )
  1280. X    {
  1281. X        ret_code = read(tty_fd, ch, count);
  1282. X    }
  1283. X
  1284. X    alarm(0);    /* turn alarms off */
  1285. X    signal(SIGALRM, SIG_DFL);
  1286. X
  1287. X    return( ((ret_code != -1) && (ret_code == count)) ? 0 : -1 );
  1288. X}
  1289. X
  1290. X
  1291. X/*    stimed_read: Will attempt to read from the terminal specified    */
  1292. X/*            by the tty file descriptor for a set period of time.*/
  1293. X/*                                    */
  1294. X/*    On Entry: tty file descriptor to read from, pointer to a byte    */
  1295. X/*          to return received char in.                */
  1296. X/*          and time in seconds.                    */
  1297. X/*    On Exit:  0 for ok read or -1 for no char received.        */
  1298. X/*                                    */
  1299. X
  1300. Xstimed_read(tty_fd, ch, seconds)
  1301. Xint    tty_fd;
  1302. Xbyte    *ch;
  1303. Xunsigned    seconds;
  1304. X{
  1305. Xint    ret_code,
  1306. X    tim_code;
  1307. X
  1308. X
  1309. X    signal(SIGALRM, timer);
  1310. X    alarm(seconds);
  1311. X
  1312. X    ret_code = -1;    /* assume bad read */
  1313. X
  1314. X    tim_code = setjmp(env);
  1315. X    while ( (tim_code == 0) && (ret_code != 1) )
  1316. X    {
  1317. X        ret_code = read(tty_fd, ch, 1);
  1318. X    }
  1319. X
  1320. X    alarm(0);    /* turn alarms off */
  1321. X    signal(SIGALRM, SIG_DFL);
  1322. X
  1323. X    return( (ret_code != -1) ? 0 : ret_code );
  1324. X}
  1325. X
  1326. X
  1327. Xterm_setup()
  1328. X{
  1329. X    term_name = getenv("TERM");    /* get terminal type name */
  1330. X    if (term_name == (char *) 0)    /* see if TERM is defined */
  1331. X    {
  1332. X        return(-1);        /* no, so return error */
  1333. X    }
  1334. X
  1335. X    if (tgetent(terminfo_buff, term_name) != 1)    /* read termcap info */
  1336. X    {
  1337. X        return(-1);        /* if not in termcap then return error */
  1338. X    }
  1339. X
  1340. X    gtty(1, &org_stty);        /* get stdout info */
  1341. X    ospeed = org_stty.sg_ospeed;    /* set global for tputs to use */
  1342. X
  1343. X    ptr2ptr = str_buf;        /* setup pointer to a pointer */
  1344. X    cm_str = tgetstr("pc", &ptr2ptr); /* get pad character */
  1345. X    if (cm_str)            /* if any pad character */
  1346. X    {
  1347. X        PC = *cm_str;        /* set global to it */
  1348. X    }
  1349. X    else
  1350. X    {
  1351. X        PC = 0;            /* else say no padding needed */
  1352. X    }
  1353. X
  1354. X    cl_str = tgetstr("cl", &ptr2ptr);    /* get clear screen string */
  1355. X    cm_str = tgetstr("cm", &ptr2ptr);    /* get cursor motion string */
  1356. X    ce_str = tgetstr("ce", &ptr2ptr);    /* get clear to end of line */
  1357. X
  1358. X    return(0);        /* return all ok */
  1359. X}
  1360. X
  1361. X
  1362. Xcls()
  1363. X{
  1364. X    tputs(cl_str, tgetnum("li"), putchar);
  1365. X}
  1366. X
  1367. Xclr_eol()
  1368. X{
  1369. X    tputs(ce_str, tgetnum("li"), putchar);
  1370. X}
  1371. X
  1372. X
  1373. Xmov_cur(col, line)
  1374. Xint    col,
  1375. X    line;
  1376. X{
  1377. X    /*col--;*/        /* termlib starts screens at 0,0 so we */
  1378. X    /*line--;*/        /* need to normalize OUR coordinates */
  1379. X
  1380. X    tputs(tgoto(cm_str, col, line), 1, putchar);
  1381. X}
  1382. X
  1383. X
  1384. Xtolower(ch)
  1385. Xchar    ch;
  1386. X{
  1387. X    return( ( (ch >= 'A') && (ch <= 'Z') ) ? ch + ' ' : ch );
  1388. X}
  1389. \Rogue\Monster\
  1390. else
  1391.   echo "will not over write ./termio.c"
  1392. fi
  1393. if [ `wc -c ./termio.c | awk '{printf $1}'` -ne 8994 ]
  1394. then
  1395. echo `wc -c ./termio.c | awk '{print "Got " $1 ", Expected " 8994}'`
  1396. fi
  1397. echo "Finished archive 2 of 4"
  1398. # if you want to concatenate archives, remove anything after this line
  1399. exit
  1400.  
  1401.