1*48306Sbostic /*- 2*48306Sbostic * %sccs.include.proprietary.c% 3*48306Sbostic * 4*48306Sbostic * @(#)tabitoh.c 4.2 (Berkeley) 04/18/91 5*48306Sbostic */ 6*48306Sbostic 714364Ssam #define INCH 240 814364Ssam /* 914364Ssam * C:Itoh Prowriter (dot matrix) 10 pitch 1014364Ssam * nroff driving table 1114364Ssam * by G. Rochlin, 15feb83 1214364Ssam * Because the c:itoh will backspace only in incremental mode, 1314364Ssam * need to write a program to place commands Esc[ and Esc] around ^H. 1414364Ssam * If you want true underline mode instead of _^Hx_^Hy, etc., 1514364Ssam * have the script first replace _^Hx with EscXxEscY, etc. 1614364Ssam * Further refinements are possible to clean up files and 1714364Ssam * minimize throughput (e.g., delete all EscYEscX pairs). 1814364Ssam * In the terminal initialization (twinit) and exit (twrest) 1914364Ssam * strings, EscN sets 10-pitch. Twrest clears by commanding 2014364Ssam * Esc Y, Esc", and Esc$ to clear ul, bold, and "greek", 2114364Ssam * Esc] to restore logic-seek print, Escf and EscT24 to restore 2214364Ssam * forward linefeed at 6 lines/inch, Esc< for bidirectional 2314364Ssam * print, EscN, and ^M (\015) to clear the print buffer. 2414364Ssam * Since the itoh has no keyboard, you have to run it through 2514364Ssam * a video terminal or micro printer port. 2614364Ssam * The first twinit code (Esc`) and the last twrest code 2714364Ssam * (Esca) set the (proper) "transparent" or "buffered" print 2814364Ssam * mode for tvi950 and tvi925 and Freedom 100. This mode 2914364Ssam * is necessary on intelligent terminals to keep all the Esc 3014364Ssam * codes in the driver tables from scrambling the terminal's 3114364Ssam * brains. (If you have a dumb terminal, almost any print 3214364Ssam * mode should be safe. Smart terminals without buffered print, 3314364Ssam * such as the tvi920, present problems.) 3414364Ssam * If you have a different terminal, 3514364Ssam * the shell script should also replace these codes with those 3614364Ssam * appropriate for your machine. If you are using an sed 3714364Ssam * stream for the script, make sure to use single quotes to 3814364Ssam * isolate the ` from the shell. 3914364Ssam */ 4014364Ssam struct { 4114364Ssam int bset; 4214364Ssam int breset; 4314364Ssam int Hor; 4414364Ssam int Vert; 4514364Ssam int Newline; 4614364Ssam int Char; 4714364Ssam int Em; 4814364Ssam int Halfline; 4914364Ssam int Adj; 5014364Ssam char *twinit; 5114364Ssam char *twrest; 5214364Ssam char *twnl; 5314364Ssam char *hlr; 5414364Ssam char *hlf; 5514364Ssam char *flr; 5614364Ssam char *bdon; 5714364Ssam char *bdoff; 5814364Ssam char *ploton; 5914364Ssam char *plotoff; 6014364Ssam char *up; 6114364Ssam char *down; 6214364Ssam char *right; 6314364Ssam char *left; 6414364Ssam char *codetab[256-32]; 6514364Ssam int zzz; 6614364Ssam } t = { 6714364Ssam /*bset*/ 0, 6814364Ssam /*breset*/ 0177420, 6914364Ssam /*Hor*/ INCH/20, 7014364Ssam /*Vert*/ INCH/48, 7114364Ssam /*Newline*/ INCH/6, 7214364Ssam /*Char*/ INCH/10, 7314364Ssam /*Em*/ INCH/10, 7414364Ssam /*Halfline*/ INCH/12, 7514364Ssam /*Adj*/ INCH/10, 7614364Ssam /*twinit*/ "\033`\015\033N", 7714364Ssam /*twrest*/ "\033Y\033\042\033$\033]\033f\033T24\033<\033N\015\033a\n", 7814364Ssam /*twnl*/ "\015\n", 7914364Ssam /*hlr*/ "\033[\033T12\033r\n\033T24\033]\033f", 8014364Ssam /*hlf*/ "\033[\033T12\n\033T24\033]", 8114364Ssam /*flr*/ "\033[\033r\n\033f\033]", 8214364Ssam /*bdon*/ "\033!", 8314364Ssam /*bdoff*/ "\033\042", 8414364Ssam /*ploton*/ "\033>\033T03", 8514364Ssam /*plotoff*/ "\033<\033T24", 8614364Ssam /*up*/ "\033[\033r\n\033f\033]", 8714364Ssam /*down*/ "\033[\n\033]", 8814364Ssam /*right*/ "\033P \033N", 8914364Ssam /*left*/ "\b\033Q \033N", 9014364Ssam /*codetab*/ 9114364Ssam #include "code.itoh" 92