1 .\" manual page for cawf(1)
4 .\" Copyright (c) 1991 Purdue University Research Foundation,
5 .\" West Lafayette, Indiana 47907. All rights reserved.
7 .\" Written by Victor A. Abell <abe@cc.purdue.edu>, Purdue
8 .\" University Computing Center. Not derived from licensed software;
9 .\" derived from awf(1) by Henry Spencer of the University of Toronto.
11 .\" Permission is granted to anyone to use this software for any
12 .\" purpose on any computer system, and to alter it and redistribute
13 .\" it freely, subject to the following restrictions:
15 .\" 1. The author is not responsible for any consequences of use of
16 .\" this software, even if they arise from flaws in it.
18 .\" 2. The origin of this software must not be misrepresented, either
19 .\" by explicit claim or by omission. Credits must appear in the
22 .\" 3. Altered versions must be plainly marked as such, and must not
23 .\" be misrepresented as being the original software. Credits must
24 .\" appear in the documentation.
26 .\" 4. This notice may not be removed or altered.
28 .\" Some of the stuff in this file is a bit contorted, because it's also
29 .\" the regression-test input.
42 .ie \\n(.$>1 .TP "\\$2"
48 .TH CAWF 1 "November, 1992"
49 .BY "Purdue University"
51 cawf, nroff \- C version of the nroff-like, Amazingly Workable (text) Formatter
67 formats the text from the input \fIfile\fR(s)
68 (standard input if none)
69 in an approximation of \*(Nr.
70 It comes closest to duplicating \*(Nr's
75 It has some limited support for \*(Nr's
79 Options must precede file names.
82 defines an alternate path to the device configuration file.
83 Normally the device configuration file is found in
91 The device configuration file contains device character strings for
92 selecting fonts and the bold or italic type faces.
95 section for more information.
98 specifies the name of the output device.
99 There are three built\-in devices \- ANSI, NONE and NORMAL \- and
100 other devices may be defined in the device configuration file.
103 section for more information.
105 The NORMAL device is the default.
110 to issue an eject (FF or ^L) after the last page.
113 specifies the one font for the device, declared with the
115 option, that is to be used for the
118 must match a font associated with the device's stanza in the device
122 section for more information.
126 may be specified for the built\-in devices ANSI, NONE or NORMAL.
129 requests a help display.
132 specifies the macro file to be used.
135 distribution supplies macro files to support ``\-man'', ``\-me'' or ``\-ms''.
137 finds a macro file by constructing its name from `m',
145 The default directory for macro files is defined when
147 is compiled; it's \fIC:\\SYS\\LIB\\CAWF\fP in the MS\-DOS environment;
149 in the UNIX environment.
152 are the names of files containing \*(Nr source text.
153 .SH NROFF COMPATIBILITY
155 accepts the following raw \*(Nr requests:
157 \&.\e" .ad .bp .br .ce .de .di .ds
158 \&.el .fi .fl .ft .i0 .ie .if .in
159 \&.it .lg .li .ll .ls .na .ne .nf
160 \&.nr .ns .pl .po .ps .rm .rn .rr
161 \&.rs .so .sp .ta .ti .tm .tr
163 and the following in-text codes:
165 \e$ \e% \e* \e" \ec \ef \eh \ek
168 plus the full list of \*(Nr/\c
170 special characters in
171 the original V7 \fItroff\fR manual.
173 Many restrictions are present; the behavior in general is a subset of
174 \*(Nr's. Of particular note are the following:
176 The fully supported nroff request control character is the period.
177 There is limited support for the non\-break, acute accent control
180 Point sizes do not exist;
184 Special vertical spacing \- the
186 request included \- is ignored.
188 Conditionals cover only the numeric comparisons >, =, <, >= and <= on
190 string com\%par\%isons between a macro parameter and a literal;
196 Only single line input is accepted from conditionals;
197 multi\-line input \- e.g., \\(\fIanything\fP\\) \- is not supported.
199 The handling of strings is generally primitive.
201 Horizontal motion via
203 must be supplied with a number register interpolation and must be
206 where the value in NN is >= 0.
210 function is reliable only after TAB characters, so it is useful only
211 for measuring table positions.
215 request only turns output on and off \- any macro name is ignored.
219 - are reasonably general, but the
224 operators do not exist, there must be white space between the end of the \*(Nr
225 function and the beginning of the expression, and
227 requires that quote (') be used as the delimiters.
229 counts the characters inside the quotes and scales the result in ens,
230 so that, for example, \ew'\e(bu' equals 4n, and \ew'\e(bu'/1n equals 4.
232 The only acceptable count for the
235 and it is effective only with
242 The default scaling factor is `v' for the
247 raw \*(Nr requests; it is `u' for
257 (A different scaling factor may be specified with a trailing character.)
259 Some obsolete or meaningless requests \-
264 \&\- are silently ignored.
266 White space at the beginning of lines,
267 and embedded white space within lines is dealt with properly.
268 Sentence terminators at ends of lines are understood to imply
269 extra space afterward in filled lines.
270 Tabs are im\%plemented crudely and not exactly, although
271 usually they work as expected.
272 Hyphenation is done only at explicit hyphens, em-dashes, and \*(Nr
273 discretionary hyphens.
274 By default bold and italic characters are emulated with backspacing and
275 overprinting, but the
279 options, combined with the contents of the device configuration file,
280 may be used to generate special codes for bold and italic characters.
283 section for more information.)
287 macro set replicates the full V7 manual macros,
288 plus a few semi-random oddballs.
291 \&.AT .B .BI .BR .BY .DE .DT .HP
292 \&.I .IB .IP .IR .IX .LP .NB .P
293 \&.PD .PP .RB .RE .RI .RS .SH .SM
299 each take a single string argument (respectively, an indi\%cation of
300 authorship and a note about the status of the manual page) and arrange
301 to place it in the page footer.
309 macro subset has been derived from the
312 macros by Chet Creider <creider@csd.uwo.ca>.
315 \&.(l .(q .)l .)q .b .bu .i .ip
316 \&.lp .np .pp .r .sh .sm .u .uh
318 The .(l C and .(l L options are supported.
319 In addition, the .AB, .AE, .AI, .AU, .DA, .ND, .TL and .UX macros have
320 been retained from the
322 set, and the .XP macro has been borrowed from the Berkeley additions to the
328 macro set is a substantial subset of the V7 manuscript macros.
331 \&.AB .AE .AI .AU .B .CD .DA .DE
332 \&.DS .I .ID .IP .LD .LG .LP .ND
333 \&.NH .NL .PP .QE .QP .QS .R .RE
334 \&.RP .RS .SH .SM .TL .TP .UL .UX
336 Size changes are recognized but ignored, as are
341 just prints its argument in italics.
344 nor do any of the other macros that normally imply keeps.
348 string variable is available.
354 number registers exist and can be changed.
355 .SH "HEADERS AND FOOTERS"
357 allows the placement of text into the five line header and
358 footer sections from the
366 string variables, via the control of the
372 \&.^b fh 1 enables header string placement on the first page
373 \&.^b fh 0 disables header string placement on the first page
374 \&.^b HF 1 enables header/footer string placement
375 \&.^b HF 0 disables header/footer string placement
378 There are appropriate
380 requests in the distribution
390 macro files use another
392 request, \fB.^b NH\fP, to enable numbered header processing.)
394 The default output format supported by
396 in its distributed form,
397 is that appropriate to a dumb terminal,
398 using overprinting for italics (via underlining) and bold.
399 The \*(Nr special characters are printed as some vague approximation
400 (it's sometimes extremely vague) to their correct appearance.
404 knowledge of the output device, related to the formation of characters,
405 is established by a device file, which is read before the user's input.
406 The search for it begins in
408 library directory, under the name \fIterm\fP.\fBdev\fP
409 (where \fIterm\fR is the value of the TERM environment variable).
410 Failing to find that,
416 section for a description of the path to
420 uses special internal requests
421 to set up resolution, special characters
422 and more normal \*(Nr functions to set up page length, etc.
425 has limited support for fonts special forms of bold and italic characters.
426 It is provided through the
435 section for more information.
437 Note the distinction between the device and the output device configuration
439 The device file typically defines characters and constant output parameters.
440 The output device configuration file defines font and type face codes.
441 It is usually not necessary to define a separate device file for each
442 device represented in the output device configuration file \- the
444 device file will suffice for almost all representations.
447 supports primitive output device configuration for font and type face
449 One font may be selected for the entire document by directing
451 to issue a font selection control character string at the beginning
452 of the document, and control character strings may be selected for
453 switching between the bold, italic and Roman type faces.
461 options direct the font and type face selections.
465 option specifies the name of the device.
467 has three built\-in devices \- ANSI, NONE and NORMAL.
468 When the ANSI device is selected,
470 issues the ANSI shadow mode control codes, ``ESC [ 7 m'', to represent
472 the ANSI underscore control codes, ``ESC [ 4 m'', to represent the italic
474 and the ANSI control codes, ``ESC [ 0 m'', to represent the ROMAN face.
477 specification is permitted with the ANSI device.
479 When the NONE device is selected,
481 uses no special output codes to represent the type faces.
484 specification is permitted with the ANSI device.
486 The NORMAL output device is the default.
489 overprints each bold character two times, using three issuances of each
490 bold character, separated by backspace characters;
491 it issues an underscore and backspace before each italic character.
494 specification is permitted with the ANSI device.
497 filter may be used to further process the backspace codes output for
500 All other devices named in the
502 option must be represented by a stanza in the device configuration file.
503 The device configuration file is usually contained in
507 library directory (see the
509 section for more information).
510 An alternate device configuration file path may be specified with the
515 .B DEVICE CONFIGURATION FILE
516 section describes the organization of the device configuration file.
517 It is easy to add devices to the
525 option may be used with the
527 option, when the appropriate stanza in the device configuration file
528 contains an entry for the named
531 .B DEVICE CONFIGURATION FILE
532 section describes how fonts are defined in device configuration file
534 .SH DEVICE CONFIGURATION FILE
535 The device configuration file defines the special character codes
536 necessary to direct output devices to select fonts and to produce
537 bold, italic and Roman type faces.
539 The configuration file is usually found in
543 library directory (see the
545 section for more information).
546 It is organized into two main parts \- comments and device stanzas.
547 Comments are any lines that begin with the pound sign (`#') character.
548 They are informational only and
552 also ignores empty lines, so they may be used as vertical white space.
554 Stanzas name devices and define their font and type face control strings.
555 A stanza begins with the name of the device, starting at the beginning
556 of a line and occupying the entire line.
557 The body of the stanza, defining fonts and type faces, is formed of
558 lines beginning with white space (a TAB or space characters) that
559 directly follow the device name.
561 Individual lines of the stanza body contain a key character, followed
562 by a equal sign, followed by the font name (if a font key) and the
563 output device control codes.
565 issues the font control codes once, at the beginning of output, so
566 only one font may be selected.
567 The type face control codes are issued at each change of type face.
569 The key characters are:
575 f for font definition
581 The `b', `i' and `r' key codes are followed by an equal sign (`=') and
582 their control code definition.
583 The `f' key code is followed by an equal sign (`='), the font name,
584 another equal sign and the font control code definition.
586 Control code definitions may contain any printable ASCII characters.
587 Non\-printable characters may be encoded in octal notation with the `\\nnn'
588 form or in hexadecimal with the `\\xnn' form.
589 The special code, `\\E' (or `\\e') represents the ESC control
590 character (\\033 or \\x1b).
592 Here's a sample showing the definition for the HP LaserJet III.
593 The stanza name is ``lj3''.
594 All its non\-printable characters are ESCs; the first is coded in
595 octal form; the second with '\\E'; the rest, in hexadecimal form.
596 TAB is used as the leading white space character for the stanza
607 f=c10=\\x1b&l0O\\x1b(8U\\x1b(s0p12h10v0s0b3T
608 f=c12ibm=\\x1b&l0O\\x1b(10U\\x1b(s0p10.00h12.0v0s0b3T
609 f=lg12=\\x1b&l0O\\x1b(8U\\x1b(s12h12v0s0b6T
615 file defines the following devices and fonts.
617 .ta \w'kxp1180'u+3n +\w'Italic:'u+3n +\w'bps10'u+6n
620 epson dot matrix printer in Epson FX-86e/FX-800 mode
625 ibmppds IBM Personal Printer Data Stream (PPDS) protocol
631 kxp1124 Panasonic KX\-P1124 dot matrix printer in PGM mode
633 Fonts: c10 10 Characters Per Inch (CPI) Courier
641 ss10 10 CPI Sans Serif
642 ss12 12 CPI Sans Serif
645 kxp1180 Panasonic KX\-P1180 dot matrix printer in PGM mode
647 Fonts: c10 10 Characters Per Inch (CPI) Courier
653 ss10 10 CPI Sans Serif
654 ss12 12 CPI Sans Serif
658 Fonts: c10 10 point, 12 Characters Per Inch (CPI)
660 c12ibm 12 point, 10 CPI Courier, IBM\-PC
662 lg12 12 point, 12 CPI Letter Gothic
665 vgamono VGA monochrome monitor for MS\-DOS
666 (ANSI.SYS driver required for MS\-DOS)
667 Italic: Reverse-video
671 resource files are located in the
673 library directory \- \fI C:\\SYS\\LIB\\CAWF\fP, the MS\-DOS environment
677 the UNIX environment default.
678 These defaults can be overridden by the CAWFLIB environment variable,
679 or changed in the cawflib.h header file.
681 .ta \w'device.cf'u+3n
683 common common device-independent initialization
684 device.cf output device configurations
685 *.dev device-specific initialization
686 m*.mac macro package files
691 complains whenever it sees unknown requests.
692 All diagnostics appear on the standard error file.
695 Vic Abell of Purdue University <abe@cc.purdue.edu> derived
699 \&``the Amazingly Workable (text) Formatter,''
700 written by Henry Spencer of the University of Toronto.
701 The Toronto work was a supplement to the C News project.
702 The Purdue effort was aimed at producing a C language version that
703 would run on small systems, particularly MS\-DOS ones.
704 The adaptation of the
706 macros was done by Chet Creider <creider@csd.uwo.ca>.
707 Chet also contributed ideas for device, font and type face support.
709 The MS\-DOS version of
711 has been compiled with version 2.5 of Microsoft's Quick-C compiler.
712 It runs under the Mortis Kern Systems Toolkit KornShell,
716 Nroff and troff mavens will have many complaints.
717 Some may even represent bugs and not deliberate omissions.
719 Watch out for scaling factors - especially on requests like
722 The overprinting required to create bold and italicized characters is
723 tiresome on a slow printer.
726 post\-filter from this distribution may be used to alleviate that
727 nuisance by managing the backspacing codes from
729 NORMAL device output.
731 The printing of bold and italic characters is sometimes better handled by
732 special printer codes.
740 options to produce special font and device output control codes.
743 has a small amount of built-in code for the
748 macro packages, but none for any others.