xref: /csrg-svn/old/roff/nroff_term/tabitoh.c (revision 14364)
1*14364Ssam /*	tabitoh.c	4.1	83/08/05	*/
2*14364Ssam #define INCH 240
3*14364Ssam /*
4*14364Ssam  * C:Itoh Prowriter (dot matrix) 10 pitch
5*14364Ssam  * nroff driving table
6*14364Ssam  * by G. Rochlin, 15feb83
7*14364Ssam  * Because the c:itoh will backspace only in incremental mode,
8*14364Ssam  * need to write a program to place commands Esc[ and Esc] around ^H.
9*14364Ssam  * If you want true underline mode instead of _^Hx_^Hy, etc.,
10*14364Ssam  * have the script first replace _^Hx with EscXxEscY, etc.
11*14364Ssam  * Further refinements are possible to clean up files and
12*14364Ssam  * minimize throughput (e.g., delete all EscYEscX pairs).
13*14364Ssam  * In the terminal initialization (twinit) and exit (twrest)
14*14364Ssam  * strings, EscN sets 10-pitch. Twrest clears by commanding
15*14364Ssam  * Esc Y, Esc", and Esc$ to clear ul, bold, and "greek",
16*14364Ssam  * Esc] to restore logic-seek print, Escf and EscT24 to restore
17*14364Ssam  * forward linefeed at 6 lines/inch, Esc< for bidirectional
18*14364Ssam  * print, EscN, and ^M (\015) to clear the print buffer.
19*14364Ssam  * Since the itoh has no keyboard, you have to run it through
20*14364Ssam  * a video terminal or micro printer port.
21*14364Ssam  * The first twinit code (Esc`) and the last twrest code
22*14364Ssam  * (Esca) set the (proper) "transparent" or "buffered" print
23*14364Ssam  * mode for tvi950 and tvi925 and Freedom 100. This mode
24*14364Ssam  * is necessary on intelligent terminals to keep all the Esc
25*14364Ssam  * codes in the driver tables from scrambling the terminal's
26*14364Ssam  * brains.  (If you have a dumb terminal, almost any print
27*14364Ssam  * mode should be safe. Smart terminals without buffered print,
28*14364Ssam  * such as the tvi920, present problems.)
29*14364Ssam  * If you have a different terminal,
30*14364Ssam  * the shell script should also replace these codes with those
31*14364Ssam  * appropriate for your machine.  If you are using an sed
32*14364Ssam  * stream for the script, make sure to use single quotes to
33*14364Ssam  * isolate the ` from the shell.
34*14364Ssam  */
35*14364Ssam struct {
36*14364Ssam 	int bset;
37*14364Ssam 	int breset;
38*14364Ssam 	int Hor;
39*14364Ssam 	int Vert;
40*14364Ssam 	int Newline;
41*14364Ssam 	int Char;
42*14364Ssam 	int Em;
43*14364Ssam 	int Halfline;
44*14364Ssam 	int Adj;
45*14364Ssam 	char *twinit;
46*14364Ssam 	char *twrest;
47*14364Ssam 	char *twnl;
48*14364Ssam 	char *hlr;
49*14364Ssam 	char *hlf;
50*14364Ssam 	char *flr;
51*14364Ssam 	char *bdon;
52*14364Ssam 	char *bdoff;
53*14364Ssam 	char *ploton;
54*14364Ssam 	char *plotoff;
55*14364Ssam 	char *up;
56*14364Ssam 	char *down;
57*14364Ssam 	char *right;
58*14364Ssam 	char *left;
59*14364Ssam 	char *codetab[256-32];
60*14364Ssam 	int zzz;
61*14364Ssam 	} t = {
62*14364Ssam /*bset*/	0,
63*14364Ssam /*breset*/	0177420,
64*14364Ssam /*Hor*/		INCH/20,
65*14364Ssam /*Vert*/	INCH/48,
66*14364Ssam /*Newline*/	INCH/6,
67*14364Ssam /*Char*/	INCH/10,
68*14364Ssam /*Em*/		INCH/10,
69*14364Ssam /*Halfline*/	INCH/12,
70*14364Ssam /*Adj*/		INCH/10,
71*14364Ssam /*twinit*/	"\033`\015\033N",
72*14364Ssam /*twrest*/	"\033Y\033\042\033$\033]\033f\033T24\033<\033N\015\033a\n",
73*14364Ssam /*twnl*/	"\015\n",
74*14364Ssam /*hlr*/		"\033[\033T12\033r\n\033T24\033]\033f",
75*14364Ssam /*hlf*/		"\033[\033T12\n\033T24\033]",
76*14364Ssam /*flr*/         "\033[\033r\n\033f\033]",
77*14364Ssam /*bdon*/	"\033!",
78*14364Ssam /*bdoff*/	"\033\042",
79*14364Ssam /*ploton*/	"\033>\033T03",
80*14364Ssam /*plotoff*/	"\033<\033T24",
81*14364Ssam /*up*/		"\033[\033r\n\033f\033]",
82*14364Ssam /*down*/	"\033[\n\033]",
83*14364Ssam /*right*/	"\033P \033N",
84*14364Ssam /*left*/	"\b\033Q \033N",
85*14364Ssam /*codetab*/
86*14364Ssam #include "code.itoh"
87