home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume24 / psroff3.0 / part06 / dt.c
Encoding:
C/C++ Source or Header  |  1991-10-09  |  13.2 KB  |  505 lines

  1. /*
  2.     Copyright 1985, 1986, 1987, 1988, 1989, 1990, 1991 Chris Lewis
  3.         All Rights Reserved
  4.  
  5.     See the LICENSE file for a full description of restrictions under which
  6.     this software is provided.
  7.  
  8.     Function:        Ditroff driver
  9.  */
  10.  
  11. #include "defs.h"
  12.  
  13. #ifndef    lint
  14. static char SCCSid[] =
  15.     "@(#)dt.c: 2.6 Copyright 91/03/10 03:12:46 Chris Lewis";
  16. #endif
  17.  
  18. /*    These two tables are always included so that we have the
  19.     official character mapping tables.
  20.  */
  21.  
  22. struct troff2befont dtStdFont[108] = {
  23.  
  24. /*    Note on X-shift, Y-shift and point scale factor:
  25.     The first two are shifts in the baseline position of the
  26.     character, and the third is a multiplier of the point size.
  27.     If they are zero, nothing happens.  If they are non-zero,
  28.     they are first multiplied by .01, then (in the case of the
  29.     shifts), multiplied by the current points to get a shift
  30.     value in TROFF2PS[XY] coordinates.  In the case of point scale
  31.     factor, it is multiplied by <currentpointsize> * .01 and becomes
  32.     the pointsize of the sequence to be emitted.
  33.  */
  34. /*          +-------------------------------- Troff character number
  35.         |
  36.             |    +--------------------------- N: standard fonts
  37.             |    |                            S: symbol font
  38.             |    |                            D: draw macro
  39.             |    |                            n: new font
  40.             |    |
  41.             |    |  +------------------------ X-shift (scaled by point)
  42.             |    |  |                         Note: positive is right.
  43.             |    |  |
  44.             |    |  |  +--------------------- Y-shift (scaled by point)
  45.             |    |  |  |                      Note: positive is up.
  46.             |    |  |  |
  47.             |    |  |  |  +------------------ Point scale factor
  48.             |    |  |  |  |
  49.             |    |  |  |  |   +-------------- Sequence
  50.             |    |  |  |  |   |
  51.             v    v  v  v  v   v */
  52.     /*  0*/    {N, 0, 0, 0, "h"},
  53.     /*  1*/    {N, 0, 0, 0, "t"},
  54.     /*  2*/    {N, 0, 0, 0, "n"},
  55.     /*  3*/    {N, 0, 0, 0, "m"},
  56.     /*  4*/    {N, 0, 0, 0, "l"},
  57.     /*  5*/    {N, 0, 0, 0, "i"},
  58.     /*  6*/    {N, 0, 0, 0, "z"},
  59.     /*  7*/    {N, 0, 0, 0, "s"},
  60.     /*  8*/    {N, 0, 0, 0, "d"},
  61.     /*  9*/    {N, 0, 0, 0, "b"},
  62.     /* 10*/    {N, 0, 0, 0, "x"},
  63.     /* 11*/    {N, 0, 0, 0, "f"},
  64.     /* 12*/    {N, 0, 0, 0, "j"},
  65.     /* 13*/    {N, 0, 0, 0, "u"},
  66.     /* 14*/    {N, 0, 0, 0, "k"},
  67.     /* 15*/    {N, 0, 0, 0, NOC},
  68.     /* 16*/    {N, 0, 0, 0, "p"},
  69.     /* 17*/    {N, 0, 0, 0, "em"},
  70.     /* 18*/    {N, 0, 0, 0, ";"},
  71.     /* 19*/    {N, 0, 0, 0, NOC},
  72.     /* 20*/    {N, 0, 0, 0, "a"},
  73.     /* 21*/    {N, 0, 0, 0, "ru"},
  74.     /* 22*/    {N, 0, 0, 0, "c"},
  75.     /* 23*/    {N, 0, 0, 0, "`"},
  76.     /* 24*/    {N, 0, 0, 0, "e"},
  77.     /* 25*/    {N, 0, 0, 0, "'"},
  78.     /* 26*/    {N, 0, 0, 0, "o"},
  79.     /* 27*/    {N, 0, 0, 0, "14"},
  80.     /* 28*/    {N, 0, 0, 0, "r"},
  81.     /* 29*/    {N, 0, 0, 0, "12"},
  82.     /* 30*/    {N, 0, 0, 0, "v"},
  83.     /* 31*/    {N, 0, 0, 0, "hy"},
  84.     /* 32*/    {N, 0, 0, 0, "w"},
  85.     /* 33*/    {N, 0, 0, 0, "q"},
  86.     /* 34*/    {N, 0, 0, 0, "/"},
  87.     /* 35*/    {N, 0, 0, 0, "."},
  88.     /* 36*/    {N, 0, 0, 0, "g"},
  89.     /* 37*/    {N, 0, 0, 0, "34"},
  90.     /* 38*/    {N, 0, 0, 0, ","},
  91.     /* 39*/    {N, 0, 0, 0, "&"},
  92.     /* 40*/    {N, 0, 0, 0, "y"},
  93.     /* 41*/    {N, 0, 0, 0, NOC},
  94.     /* 42*/    {N, 0, 0, 0, "%"},
  95.     /* 43*/    {N, 0, 0, 0, NOC},
  96.     /* 44*/    {N, 0, 0, 0, "Q"},
  97.     /* 45*/    {N, 0, 0, 0, "T"},
  98.     /* 46*/    {N, 0, 0, 0, "O"},
  99.     /* 47*/    {N, 0, 0, 0, "H"},
  100.     /* 48*/    {N, 0, 0, 0, "N"},
  101.     /* 49*/    {N, 0, 0, 0, "M"},
  102.     /* 50*/    {N, 0, 0, 0, "L"},
  103.     /* 51*/    {N, 0, 0, 0, "R"},
  104.     /* 52*/    {N, 0, 0, 0, "G"},
  105.     /* 53*/    {N, 0, 0, 0, "I"},
  106.     /* 54*/    {N, 0, 0, 0, "P"},
  107.     /* 55*/    {N, 0, 0, 0, "C"},
  108.     /* 56*/    {N, 0, 0, 0, "V"},
  109.     /* 57*/    {N, 0, 0, 0, "E"},
  110.     /* 58*/    {N, 0, 0, 0, "Z"},
  111.     /* 59*/    {N, 0, 0, 0, "D"},
  112.     /* 60*/    {N, 0, 0, 0, "B"},
  113.     /* 61*/    {N, 0, 0, 0, "S"},
  114.     /* 62*/    {N, 0, 0, 0, "Y"},
  115.     /*from here on are actually code 1-45, upper half of font */
  116.     /* 63*/    {N, 0, 0, 0, "F"},
  117.     /* 64*/    {N, 0, 0, 0, "X"},
  118.     /* 65*/    {N, 0, 0, 0, "A"},
  119.     /* 66*/    {N, 0, 0, 0, "W"},
  120.     /* 67*/    {N, 0, 0, 0, "J"},
  121.     /* 68*/    {N, 0, 0, 0, "U"},
  122.     /* 69*/    {N, 0, 0, 0, "K"},
  123.     /* 70*/    {N, 0, 0, 0, "0"},
  124.     /* 71*/    {N, 0, 0, 0, "1"},
  125.     /* 72*/    {N, 0, 0, 0, "2"},
  126.     /* 73*/    {N, 0, 0, 0, "3"},
  127.     /* 74*/    {N, 0, 0, 0, "4"},
  128.     /* 75*/    {N, 0, 0, 0, "5"},
  129.     /* 76*/    {N, 0, 0, 0, "6"},
  130.     /* 77*/    {N, 0, 0, 0, "7"},
  131.     /* 78*/    {N, 0, 0, 0, "8"},
  132.     /* 79*/    {N, 0, 0, 0, "9"},
  133.     /* 80*/    {N, 0, 0, 0, "*"},
  134.     /* 81*/    {N, 0, 0, 0, "-"},
  135.     /* 82*/    {N, 0, 0, 0, "fi"},
  136.     /* 83*/    {N, 0, 0, 0, "fl"},
  137.     /* 84*/    {N, 0, 0, 0, "ff"},
  138.     /* 85*/    {N, 0, 0, 0, "ct"},
  139.     /* 86*/    {N, 0, 0, 0, "Fl"},
  140.     /* 87*/    {N, 0, 0, 0, "Fi"},
  141.     /* 88*/    {N, 0, 0, 0, "("},
  142.     /* 89*/    {N, 0, 0, 0, ")"},
  143.     /* 90*/    {N, 0, 0, 0, "["},
  144.     /* 91*/    {N, 0, 0, 0, "]"},
  145.     /* 92*/    {N, 0, 0, 0, "de"},
  146.     /* 93*/    {N, 0, 0, 0, "dg"},
  147.     /* 94*/    {N, 0, 0, 0, "="},
  148.     /* 95*/    {N, 0, 0, 0, "rg"},
  149.     /* 96*/    {N, 0, 0, 0, ":"},
  150.     /* 97*/    {N, 0, 0, 0, "+"},
  151.     /* 98*/    {N, 0, 0, 0, NOC},
  152.     /* 99*/    {N, 0, 0, 0, "!"},
  153.     /*100*/    {N, 0, 0, 0, "bu"},
  154.     /*101*/    {N, 0, 0, 0, "?"},
  155.     /*102*/    {N, 0, 0, 0, "fm"},
  156.     /*103*/    {N, 0, 0, 0, "|"},
  157.     /*104*/    {N, 0, 0, 0, NOC},
  158.     /*105*/    {N, 0, 0, 0, "co"},
  159.     /*106*/    {N, 0, 0, 0, "sq"},
  160.     /*107*/    {N, 0, 0, 0, "$"}
  161. };
  162.  
  163. struct troff2befont dtSymFont[] = {
  164. /*          +-------------------------------- Troff character number
  165.         |
  166.             |    +--------------------------- N: standard fonts
  167.             |    |                            S: symbol font
  168.             |    |                            D: draw macro
  169.             |    |
  170.             |    |  +------------------------ X-shift (scaled by point)
  171.             |    |  |                         Note: positive is right.
  172.             |    |  |
  173.             |    |  |  +--------------------- Y-shift (scaled by point)
  174.             |    |  |  |                      Note: positive is up.
  175.             |    |  |  |
  176.             |    |  |  |  +------------------ Point scale factor
  177.             |    |  |  |  |
  178.             |    |  |  |  |   +-------------- Sequence
  179.             |    |  |  |  |   |
  180.             |    |  |  |  |   |
  181.             v    v  v  v  v   v */
  182.     /*  0*/    {S, 0, 0, 0, "*q"},
  183.     /*  1*/    {S, 0, 0, 0, "*h"},
  184.     /*  2*/    {S, 0, 0, 0, "*n"},
  185.     /*  3*/    {S, 0, 0, 0, "*m"},
  186.     /*  4*/    {S, 0, 0, 0, "*l"},
  187.     /*  5*/    {S, 0, 0, 0, "*i"},
  188.     /*  6*/    {S, 0, 0, 0, "*z"},
  189.     /*  7*/    {S, 0, 0, 0, "*s"},
  190.     /*  8*/    {S, 0, 0, 0, "*d"},
  191.     /*  9*/    {S, 0, 0, 0, "*b"},
  192.     /* 10*/    {S, 0, 0, 0, "*c"},
  193.     /* 11*/    {S, 0, 0, 0, "*y"},
  194.     /* 12*/    {S, 0, 0, 0, "*f"},
  195.     /* 13*/    {S, 0, 0, 0, "*u"},
  196.     /* 14*/    {S, 0, 0, 0, "*k"},
  197.     /* 15*/    {S, 0, 0, 0, NOC},
  198.     /* 16*/    {S, 0, 0, 0, "*p"},
  199.     /* 17*/    {S, 0, 0, 0, "@"},
  200.     /* 18*/    {S, 0, 0, 0, "da"},
  201.     /* 19*/    {S, 0, 0, 0, NOC},
  202.     /* 20*/    {S, 0, 0, 0, "*a"},
  203.     /* 21*/    {S, 0, 0, 0, "or"},
  204.     /* 22*/    {S, 0, 0, 0, "*x"},
  205.     /* 23*/    {N, 0, 0, 0, "\""},
  206.     /* 24*/    {S, 0, 0, 0, "*e"},
  207.     /* 25*/    {S, 0, 0, 0, "eq"},
  208.     /* 26*/    {S, 0, 0, 0, "*o"},
  209.     /* 27*/    {S, 0, 0, 0, "<-"},
  210.     /* 28*/    {S, 0, 0, 0, "*r"},
  211.     /* 29*/    {S, 0, 0, 0, "ua"},
  212.     /* 30*/    {S, 0, 0, 0, "*t"},
  213.     /* 31*/    {S, 0, 0, 0, "ul"},
  214.     /* 32*/    {N, 0, 0, 0, "\\"},
  215.     /* 33*/    {S, 0, 0, 0, "*Q"},
  216.     /* 34*/    {S, 0, 0, 0, "bs"},
  217.     /* 35*/    {S, 0, 0, 0, "if"},
  218.     /* 36*/    {S, 0, 0, 0, "*g"},
  219.     /* 37*/    {S, 0, 0, 0, "ip"},
  220.     /* 38*/    {S, 0, 0, 0, "pt"},
  221.     /* 39*/    {S, 0, 0, 0, "rh"},
  222.     /* 40*/    {S, 0, 0, 0, "*w"},
  223.     /* 41*/    {S, 0, 0, 0, NOC},
  224.     /* 42*/    {S, 0, 0, 0, "gr"},
  225.     /* 43*/    {S, 0, 0, 0, NOC},
  226.     /* 44*/    {S, 0, 0, 0, "*F"},
  227.     /* 45*/    {S, 0, 0, 0, "*H"},
  228.     /* 46*/    {S, 0, 0, 0, "*W"},
  229.     /* 47*/    {S, 0, 0, 0, "cu"},
  230.     /* 48*/    {S, 0, 0, 0, "rn"},
  231.     /* 49*/    {S, 0, 0, 0, "ts"},
  232.     /* 50*/    {S, 0, 0, 0, "*L"},
  233.     /* 51*/    {S, 0, 0, 0, "mi"},
  234.     /* 52*/    {S, 0, 0, 0, "*G"},
  235.     /* 53*/    {S, 0, 0, 0, "is"},
  236.     /* 54*/    {S, 0, 0, 0, "*P"},
  237.     /* 55*/    {S, 0, 0, 0, "sb"},
  238.     /* 56*/    {S, 0, 0, 0, "sp"},
  239.     /* 57*/    {S, 0, 0, 0, "ap"},
  240.     /* 58*/    {S, 0, 0, 0, "pd"},
  241.     /* 59*/    {S, 0, 0, 0, "*D"},
  242.     /* 60*/    {S, 0, 0, 0, "sr"},
  243.     /* 61*/    {S, 0, 0, 0, "*S"},
  244.     /* 62*/    {S, 0, 0, 0, "~="},
  245.     /* 63*/    {S, 0, 0, 0, ">"},
  246.     /* 64*/    {S, 0, 0, 0, "*C"},
  247.     /* 65*/    {S, 0, 0, 0, "<"},
  248.     /* 66*/    {S, 0, 0, 0, "/"},
  249.     /* 67*/    {S, 0, 0, 0, "ca"},
  250.     /* 68*/    {S, 0, 0, 0, "*U"},
  251.     /* 69*/    {S, 0, 0, 0, "no"},
  252.     /* 70*/    {S, 0, 0, 0, "rc"},
  253.     /* 71*/    {S, 0, 0, 0, "lt"},
  254.     /* 72*/    {S, 0, 0, 0, "bv"},
  255.     /* 73*/    {S, 0, 0, 0, "lk"},
  256.     /* 74*/    {S, 0, 0, 0, "lb"},
  257.     /* 75*/    {S, 0, 0, 0, "rt"},
  258.     /* 76*/    {S, 0, 0, 0, "rk"},
  259.     /* 77*/    {S, 0, 0, 0, "rb"},
  260.     /* 78*/    {S, 0, 0, 0, "rf"},
  261.     /* 79*/    {S, 0, 0, 0, "lf"},
  262.     /* 80*/    {S, 0, 0, 0, "lc"},
  263.     /* 81*/    {S, 0, 0, 0, "mu"},
  264.     /* 82*/    {S, 0, 0, 0, "di"},
  265.     /* 83*/    {S, 0, 0, 0, "+-"},
  266.     /* 84*/    {S, 0, 0, 0, "<="},
  267.     /* 85*/    {S, 0, 0, 0, ">="},
  268.     /* 86*/    {S, 0, 0, 0, "=="},
  269.     /* 87*/    {S, 0, 0, 0, "!="},
  270.     /* 88*/    {S, 0, 0, 0, "{"},
  271.     /* 89*/    {S, 0, 0, 0, "}"},
  272.     /* 90*/    {N, 0, 0, 0, "aa"},
  273.     /* 91*/    {N, 0, 0, 0, "ga"},
  274.     /* 92*/    {S, 0, 0, 0, "^"},
  275.     /* 93*/    {S, 0, 0, 0, "#"},
  276.     /* 94*/    {S, 0, 0, 0, "lh"},
  277.     /* 95*/    {S, 0, 0, 0, "mo"},
  278.     /* 96*/    {N, 0, 0, 0, "~"},
  279.     /* 97*/    {S, 0, 0, 0, "es"},
  280.     /* 98*/    {S, 0, 0, 0, NOC},
  281.     /* 99*/    {N, 0, 0, 0, "dd"},
  282.     /*100*/    {S, 0, 0, 0, "br"},
  283.     /*101*/    {S, 0, 0, 0, "**"},
  284.     /*102*/    {S, 0, 0, 0, "ib"},
  285.     /*103*/    {S, 0, 0, 0, "ci"},
  286.     /*104*/    {S, 0, 0, 0, NOC},
  287.     /*105*/    {S, 0, 0, 0, "pl"},
  288.     /*106*/    {S, 0, 0, 0, "->"},
  289.     /*107*/    {N, 0, 0, 0, "sc"}
  290. };
  291.  
  292. #ifdef    DT
  293. #include "dt.h"
  294.  
  295. #define    USED    01
  296.  
  297. int dtresolution = DTRESOLUTION;
  298.  
  299. dtPage() {
  300.     pagePending = 1;
  301. }
  302.  
  303. static
  304. doPageStart() {
  305.     currentPage++;
  306.     pagePending = 0;
  307.     printf("p%d\n", currentPage);
  308. }
  309.  
  310.  
  311. dtSetFont(font, points)
  312. int font, points; {
  313.     if (lastPoints != points || font != lastFont) {
  314.     if (!(fonttable[font].flags)&USED)
  315.         printf("x font %d %s\n", font+1, fonttable[font].troffName);
  316.     fonttable[font].flags |= USED;
  317.     printf("f%d\n", font+1);
  318.     printf("s%d\n", points);
  319.     lastPoints = points;
  320.     lastFont = font;
  321.     }
  322. }
  323.  
  324. dtChar(x, y, font, points, troffChar, sequence)
  325. long x, y;
  326. int font, points, troffChar;
  327. char *sequence; {
  328.     register int nx = TROFF2DTX(x), ny = TROFF2DTY(y);
  329.     register struct troff2befont *rp;
  330.     if (pagePending) {
  331.     resetState();
  332.     doPageStart();
  333.     }
  334.  
  335.     DBP((D_BEND,"x,y=%d,%d; font=%d, points=%d, tc=%d\n",
  336.     x, y, font, points, troffChar));
  337.  
  338.     if (font < 0) {
  339.     font = -font-1;
  340.     rp = &extchars[troffChar];
  341.     } else if (font == symidx)
  342.     rp = &be->besymfont[troffChar];
  343.     else
  344.     rp = &be->bestdfont[troffChar];
  345.  
  346.     switch(rp->t2b_font) {
  347.     /* Only fonts with "N" are subject to font translation */
  348.     case N:
  349.         if (font == symidx)
  350.         font = 0;    /* Special chars are Courier */
  351.         else {
  352.         DBP((D_BEND, "dtSetChar %d->%s (%s)\n", font,
  353.             xlatetable[font]->troffName,
  354.             xlatetable[font]->fontName));
  355.         font = xlatetable[font] - fonttable;
  356.         }
  357.         break;
  358.     case S:
  359.         font = 3;
  360.         break;
  361.     case D:
  362.         break;
  363.     default:
  364.     /* Typically used when the R and S fonts don't have the
  365.        character desired, so select the font via the index
  366.        in the fonts.?? file */
  367.         font = rp->t2b_font;
  368.         break;
  369.     }
  370.  
  371.     if (!sequence)
  372.     sequence = rp->t2b_charseq;
  373.  
  374.     if (!sequence) {
  375.     fprintf(stderr, "No coding for %d\n", troffChar);
  376.     return;
  377.     }
  378.  
  379.     /*    We're committed now - the "if" statements avoid floating
  380.     arithmetic on slow machines */
  381.  
  382.     if (rp->t2b_scale) points *= (.01 * rp->t2b_scale);
  383.     if (rp->t2b_xc) nx += points * (.01 * rp->t2b_xc);
  384.     if (rp->t2b_yc) ny += points * (.01 * rp->t2b_yc);
  385.  
  386.     dtSetFont(font, points);
  387. #ifdef    NOTYET
  388.     if (rp->t2b_font == D)
  389.     printf("H%d\nV%d\nc%s\n", nx, ny, sequence);
  390.     else {
  391. #endif
  392.     /* print an nnc sequence if we can...may even be able to avoid
  393.        the newline. */
  394.  
  395.     if (lastYPos == ny &&
  396.         sequence[1] == 0 &&
  397.         lastXPos != -1 &&
  398.         (nx - lastXPos) > 0 && (nx - lastXPos) < 100) {
  399.  
  400.         printf("%02d%c\n",(nx - lastXPos), sequence[0]);
  401.  
  402.     } else {
  403.  
  404.         printf("H%d\n", nx);
  405.  
  406.         if (lastYPos != ny) {
  407.         printf("V%d\n", ny);
  408.         lastYPos = ny;
  409.         }
  410.         if (sequence[1])
  411.         printf("C%s\n", sequence);
  412.         else
  413.         printf("c%s\n", sequence);
  414.     }
  415.     lastXPos = nx;
  416. #ifdef    NOTYET
  417.     }
  418. #endif
  419. }
  420.  
  421. dtProlog() {
  422.     extern char *ctime();
  423.     extern char *strchr();
  424.     extern char nodename[];
  425.     extern char *device;
  426.     char buffer[30];
  427.     long curtime;
  428. #ifdef    OPT
  429.     extern int optimize;
  430.  
  431.     optimize = 0;
  432. #endif
  433.  
  434.     currentPage = 0;
  435.     pagePending = 1;
  436.  
  437.     time(&curtime);
  438.     strcpy(buffer, ctime(&curtime));
  439.     *strchr(buffer, '\n') = '\0';
  440.  
  441.     getnodename();
  442.  
  443. #ifndef    NOCHATTER
  444.     printf("#Title: (stdin)\n");
  445.     printf("#Creator: %s %s\n", progname, shortversion);
  446.     printf("#PsroffVersion: %s\n", version);
  447.     printf("#CreationDate: %s\n", buffer);
  448.     printf("#For: %s\n", username);
  449.     printf("#Pages: (atend)\n");
  450.     printf("#DocumentFonts: (atend)\n");
  451.     printf("#EndComments\n");
  452. #endif
  453.     printf("x T %s\n", device);
  454.     printf("x res %d %d %d\n", dtresolution, 1, 1);
  455.     printf("x init\n");
  456.     doprologs();
  457.  
  458. }
  459.  
  460. dtPassthru(s)
  461. register char *s; {
  462.     printf("x X %s\n", s);
  463. }
  464.  
  465. dtEpilog() {
  466.     printf("x trailer\n");
  467.     printf("x stop\n");
  468. }
  469.  
  470. #ifdef    INSPECIAL
  471. dtDraw(origX, origY, s)
  472. int origX, origY;
  473. register char *s; {
  474.     register int temp, t2;
  475.     DBP((D_CAT, "dtDraw: (%d,%d): %s\n", origX, origY, s));
  476.     printf("H%d\n", TROFF2DTX(origX));
  477.     printf("V%d\n", TROFF2DTY(origY));
  478.     putchar('D');
  479.     putchar(*s);
  480.     s++;
  481.     /* We just pass these thru, scaling them to output resolution */
  482.     for (;*s;s++) {
  483.     if (isspace(*s))
  484.         putchar(' ');
  485.     else if (!isdigit(*s))
  486.         putchar(*s);
  487.     else {
  488.         extern int indtres;
  489.         temp = *s - '0';
  490.  
  491.         while(isdigit(*(s+1)))
  492.         temp = temp * 10 + (*++s - '0');
  493.  
  494.         t2 = temp * dtresolution / (ditroff? indtres:
  495.         TROFFRESOLUTION);
  496.         DBP((D_CAT, "dtDraw (scale): %d -> %d\n", temp, t2));
  497.         printf("%d", t2);
  498.     }
  499.     }
  500.     putchar('\n');
  501. }
  502. #endif
  503.  
  504. #endif /* DT */
  505.