Merge branch 'topic/sync-to-go-2'
[s-roff.git] / man / l_roff-out.5.in
blob719ad098eb933f7d166df7c55fd1bad9b0a6d1c8
1 '\" e -- preprocess: eqn(1)
2 .ig
3 @ @L_ROFF@-out.5
5 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
7 Copyright (C) 1989, 2001 - 2008
8 Free Software Foundation, Inc.
9 rewritten from scrach 2001 by Bernd Warken <bwarken@mayn.de>
11 Permission is granted to copy, distribute and/or modify this document
12 under the terms of the GNU Free Documentation License, Version 1.1 or
13 any later version published by the Free Software Foundation; with the
14 Invariant Sections being this .ig-section and AUTHORS, with no
15 Front-Cover Texts, and with no Back-Cover Texts.
17 You should have received a copy of the Free Documentation License
18 as part of the file COPYING; also located in the main directory of the
19 source package of this program.
22 .\" ----------------- Document configuration
24 .\" Number register to decide whether the commands `{' and `}' are used
25 .\" 0: disable (actual default); 1: enable
26 .nr @USE_ENV_STACK 0
28 .ig
29 Unfortunately, old versions of groff used an illogical position change
30 after some D\~commands (Dp, DP, Dt).  If the number register
31 @STUPID_DRAWING_POSITIONING is 1 (actual default) then change position
32 after these commands, otherwise the position is not changed.
34 .nr @STUPID_DRAWING_POSITIONING 1
36 .\" ----------------- Semantical definitions
38 .nr @maxcolor 65536
39 .ds @backslash \[rs]\"
40 .ds @linebreak \fR\[la]line-break\[ra]\fP\"
42 .\" Begin of macro definitions
44 .de offset
45 .RI ( \,\\$1\/ ,\  \,\\$2\/ )\\$3
47 .de indexed_offset
48 .offset \fI\\$1\/\fP\d\s-3\\$2\s+3\u\x'\n[.v]/4' \fI\\$3\/\fP\d\s-3\\$4\s+3\u\x'\n[.v]/4' \\$5\x'\n[.v]/4'
50 .\" format: .command <name> "<arguments>" <punctuation>
51 .de command
52 \fB\\$1\fP\ \fI\,\\$2\/\fP\\$3
54 .\" format: .D-command <subcommand> "<arguments>"
55 .de D-command
56 \fBD\\$1\fP\ \fI\,\\$2\/\fP\|\*[@linebreak]
59 .\" We set these as troff micromotions rather than eqn because \d and \u
60 .\" can be lifted to XML subscript/superscript tags.  Don't change
61 .\" these to a parameterized string, man2html won't handle that.
62 .ds hv1 \fIh\d\s-3\&1\s+3\u\~v\d\s-3\&1\s+3\u\fP\x'\n[.v]/4'
63 .ds hv2 \fIh\d\s-3\&2\s+3\u\~v\d\s-3\&2\s+3\u\fP\x'\n[.v]/4'
64 .ds hvn \fIh\d\s-3\&n\s+3\u\~v\d\s-3\&n\s+3\u\fP\x'\n[.v]/4'
66 .de Da-command
67 \fBDa\fP\ \*[hv1] \*[hv2]\|\*[@linebreak]
69 .\" graphics command .D with a variable number of arguments
70 .\" format: .D-multiarg <subcommand>
71 .de D-multiarg
72 \fBD\\$1\fP\ \*[hv1] \*[hv2] .\|.\|. \*[hvn]\|\*[@linebreak]
74 .\" format: .x-command <subname> "<arguments>"
75 .de x-command
76 \fBx\\$1\fP\ \fI\\$2\fP\|\*[@linebreak]
78 .de xsub
79 .RI "(" "\\$1" " control command)"
80 .br
82 .\" End of macro definitions
85 .TH @U_ROFF@-OUT @MAN5EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
87 .SH NAME
88 @L_ROFF@-out \- @T_ROFF@ intermediate output format
91 .SH DESCRIPTION
93 This manual page describes the
94 .I intermediate output
95 format of the
96 .BR @L_ROFF@ (@MAN7EXT@)
97 text processing system
98 .BR @L_ROFF@ (@MAN1EXT@),
99 as produced by a run of the
100 .BR @L_TROFF@ (@MAN1EXT@)
101 program.
103 It contains already all device-specific information, but it is not yet
104 fed into a device postprocessor program.
105 Because of this it is called intermediate.
108 .B @L_ROFF@
109 program provides the option
110 .B \-Z
111 to inhibit postprocessing, such that the produced
112 .I intermediate output
113 is sent to standard output just like calling
114 .B @L_TROFF@
115 manually.
119 In this document, the term
120 .I @L_TROFF@ output
121 describes what is output by the
122 .B @L_TROFF@
123 program, whereas
124 .I intermediate output
125 refers to the language that is accepted by the parser that prepares
126 this output for the postprocessors.
128 This parser is smarter on whitespace and implements obsolete elements
129 for compatibility, otherwise both formats are the same.
133 The main purpose of the
134 .I intermediate output
135 concept is to facilitate the development of postprocessors by
136 providing a common programming interface for all devices.
138 It has a language of its own that is completely different from the
139 .BR @L_ROFF@ (@MAN7EXT@)
140 language.
142 While the
143 .I @T_ROFF@
144 language is a high-level programming language for text processing, the
145 .I intermediate output
146 language is a kind of low-level assembler language by specifying all
147 positions on the page for writing and drawing.
152 .RI pre- groff
153 .I roff
154 versions are denoted as
155 .I classical
156 .IR troff .
158 .I intermediate output
159 produced by
160 .I classical troff
161 output was hard to understand because of strange habits.
164 .SH "LANGUAGE CONCEPTS"
166 During the run of
167 .BR @L_TROFF@ ,
169 .I roff
170 input is cracked down to the information on what has to be printed at
171 what position on the intended device.
173 So the language of the
174 .I intermediate output
175 format can be quite small.
177 Its only elements are commands with or without arguments.
179 In this document, the term \[lq]command\[rq] always refers to the
180 .I intermediate output
181 language, never to the
182 .I roff
183 language used for document formatting.
185 There are commands for positioning and text writing, for drawing, and
186 for device controlling.
189 .SS "Separation"
191 .I Classical troff output
192 had strange requirements on whitespace.
195 .B @T_ROFF@
196 output parser, however, is smart about whitespace by making it
197 maximally optional.
199 The whitespace characters, i.e., the
200 .IR tab ,
201 .IR space ,
203 .I newline
204 characters, always have a syntactical meaning.
206 They are never printable because spacing within the output is always
207 done by positioning commands.
211 Any sequence of
212 .I space
214 .I tab
215 characters is treated as a single
216 .I syntactical
217 .IR space .
219 It separates commands and arguments, but is only required when there
220 would occur a clashing between the command code and the arguments
221 without the space.
223 Most often, this happens when variable length command names,
224 arguments, argument lists, or command clusters meet.
226 Commands and arguments with a known, fixed length need not be
227 separated by
228 .I syntactical
229 .IR space .
233 A line break is a syntactical element, too.
235 Every command argument can be followed by whitespace, a comment, or a
236 newline character.
238 Thus a
239 .I syntactical line break
240 is defined to consist of optional
241 .I syntactical space
242 that is optionally followed by a comment, and a newline character.
246 The normal commands, those for positioning and text, consist of a
247 single letter taking a fixed number of arguments.
249 For historical reasons, the parser allows to stack such commands on
250 the same line, but fortunately, in
251 .I @T_ROFF@ intermediate
252 .IR output ,
253 every command with at least one argument is followed by a line break,
254 thus providing excellent readability.
257 The other commands \[em] those for drawing and device controlling \[em]
258 have a more complicated structure; some recognize long command names,
259 and some take a variable number of arguments.
261 So all
262 .B D
264 .B x
265 commands were designed to request a
266 .I syntactical line break
267 after their last argument.
269 Only one command,
270 .RB ` x\ X '
271 has an argument that can stretch over several lines, all other
272 commands must have all of their arguments on the same line as the
273 command, i.e., the arguments may not be split by a line break.
276 Empty lines, i.e., lines containing only space and/or a comment, can
277 occur everywhere.
279 They are just ignored.
283 .SS "Argument Units"
286 Some commands take integer arguments that are assumed to represent
287 values in a measurement unit, but the letter for the corresponding
288 .I scale indicator
289 is not written with the output command arguments; see
290 .BR @L_ROFF@ (@MAN7EXT@)
291 for more on this topic.
293 Most commands assume the scale indicator\~\c
294 .BR u ,
295 the basic unit of the device, some use\~\c
296 .BR z ,
298 .I scaled point unit
299 of the device, while others, such as the color commands expect plain
300 integers.
302 Note that these scale indicators are relative to the chosen device.
304 They are defined by the parameters specified in the device's
305 .I DESC
306 file; see
307 .BR @L_ROFF@-font (@MAN5EXT@).
311 Note that single characters can have the eighth bit set, as can the
312 names of fonts and special characters (this is, glyphs).
314 The names of glyphs and fonts can be of arbitrary length.
316 A glyph that is to be printed will always be in the current font.
320 A string argument is always terminated by the next whitespace
321 character (space, tab, or newline); an embedded
322 .B #
323 character is regarded as part of the argument, not as the beginning of
324 a comment command.
326 An integer argument is already terminated by the next non-digit
327 character, which then is regarded as the first character of the next
328 argument or command.
332 .SS "Document Parts"
334 A correct
335 .I intermediate output
336 document consists of two parts, the
337 .I prologue
338 and the
339 .IR body .
342 The task of the
343 .I prologue
344 is to set the general device parameters using three exactly specified
345 commands.
348 .I @T_ROFF@ prologue
349 is guaranteed to consist of the following three lines (in that order):
352 .B x\ T
353 .I device
355 .B x\ res
356 .I n\ h\ v
358 .B x init
361 with the arguments set as outlined in the section
362 .BR "Device Control Commands" .
364 However, the parser for the
365 .I intermediate output
366 format is able to swallow additional whitespace and comments as well.
371 .I body
372 is the main section for processing the document data.
374 Syntactically, it is a sequence of any commands different from the
375 ones used in the
376 .IR prologue .
378 Processing is terminated as soon as the first
379 .B x\ stop
380 command is encountered; the last line of any
381 .I @T_ROFF@ intermediate output
382 always contains such a command.
386 Semantically, the
387 .I body
388 is page oriented.
390 A new page is started by a
391 .BR p \~command.
393 Positioning, writing, and drawing commands are always done within the
394 current page, so they cannot occur before the first
395 .BR p \~command.
397 Absolute positioning (by the
398 .B H
400 .BR V \~commands)
401 is done relative to the current page, all other positioning
402 is done relative to the current location within this page.
405 .SH "COMMAND REFERENCE"
407 This section describes all
408 .I intermediate output
409 commands, the classical commands as well as the
410 .I @T_ROFF@
411 extensions.
414 .SS "Comment Command"
417 .BI # anything \[la]end-of-line\[ra]
418 A comment.
420 Ignore any characters from the
421 .BR # \~\c
422 character up to the next newline character.
425 This command is the only possibility for commenting in the
426 .I intermediate
427 .IR output .
429 Each comment can be preceded by arbitrary
430 .I syntactical
431 .IR space ;
432 every command can be terminated by a comment.
436 .SS "Simple Commands"
439 The commands in this subsection have a command code consisting of a
440 single character, taking a fixed number of arguments.
442 Most of them are commands for positioning and text writing.
444 These commands are smart about whitespace.
446 Optionally,
447 .I syntactical space
448 can be inserted before, after, and between the command letter and its
449 arguments.
451 All of these commands are stackable, i.e., they can be preceded by
452 other simple commands or followed by arbitrary other commands on the
453 same line.
455 A separating
456 .I syntactical space
457 is only necessary when two integer arguments would clash or if the
458 preceding argument ends with a string argument.
461 .if \n[@USE_ENV_STACK]=1 \{\
463 .command {
464 Open a new environment by copying the actual device configuration data
465 to the environment stack.
467 The current environment is setup by the device specification and
468 manipulated by the setting commands.
472 .command }
473 Close the actual environment (opened by a preceding
474 .BR { \~command)
475 and restore the previous environment from the environment
476 stack as the actual device configuration data.
478 .\}              \" endif @USE_ENV_STACK
482 .command C xxx \[la]white-space\[ra]
483 Print a glyph (special character) named
484 .IR xxx .
486 The trailing
487 .I syntactical space
489 .I line break
490 is necessary to allow glyph names of arbitrary length.
492 The glyph is printed at the current print position; the
493 glyph's size is read from the font file.
495 The print position is not changed.
499 .command c c
500 Print glyph with single-letter name\~\c
501 .I c
502 at the current print position;
503 the glyph's size is read from the font file.
505 The print position is not changed.
509 .command f n
510 Set font to font number\~\c
511 .I n
512 (a non-negative integer).
516 .command H n
517 Move right to the absolute vertical position\~\c
518 .I n
519 (a non-negative integer in basic units\~\c
520 .BR u )
521 relative to left edge of current page.
525 .command h n
526 Move
527 .I n
528 (a non-negative integer) basic units\~\c
529 .B u
530 horizontally to the right.
532 .I [CSTR\~#54]
533 allows negative values for
534 .I n
535 also, but
536 .I @T_ROFF@
537 doesn't use this.
541 .command m "color-scheme \fR[\fPcomponent .\|.\|.\fR]\fP"
542 Set the color for text (glyphs), line drawing, and the outline of
543 graphic objects using different color schemes; the analoguous command
544 for the filling color of graphic objects is
545 .BR DF .
547 The color components are specified as integer arguments between 0 and
548 \n[@maxcolor].
550 The number of color components and their meaning vary for the
551 different color schemes.
553 These commands are generated by the escape sequence
554 .BR \*[@backslash]m .
556 No position changing.
558 These commands are a
559 .I @T_ROFF@
560 extension.
566 .command mc "cyan magenta yellow"
567 Set color using the CMY color scheme, having the 3\~color components
568 cyan, magenta, and yellow.
572 .command md
573 Set color to the default color value
574 (black in most cases).
576 No component arguments.
580 .command mg "gray"
581 Set color to the shade of gray given by the argument, an integer
582 between 0 (black) and \n[@maxcolor] (white).
586 .command mk "cyan magenta yellow black"
587 Set color using the CMYK color scheme, having the 4\~color components
588 cyan, magenta, yellow, and black.
591 .command mr "red green blue"
592 Set color using the RGB color scheme, having the 3\~color components
593 red, green, and blue.
599 .command N n
600 Print glyph with index\~\c
601 .I n
602 (an integer, normally non-negative) of the current font.
604 The print position is not changed.
607 .B \-T\~html
609 .B \-T\~xhtml
610 is used, negative values are emitted also to indicate an unbreakable space
611 with given width.
613 For example,
614 .B N\~\-193
615 represents an unbreakable space which has a width of 193\|u.
617 This command is a
618 .I @T_ROFF@
619 extension.
623 .command n b\ a
624 Inform the device about a line break, but no positioning is done by
625 this command.
628 .I classical
629 .IR troff ,
630 the integer arguments
631 .I b
632 and\~\c
633 .I a
634 informed about the space before and after the current line to
635 make the
636 .I intermediate output
637 more human readable without performing any action.
640 .IR @T_ROFF@
641 they are just ignored, but they must be provided for compatibility
642 reasons.
646 .command p n
647 Begin a new page in the outprint.
649 The page number is set to\~\c
650 .IR n .
652 This page is completely independent of pages formerly processed even
653 if those have the same page number.
655 The vertical position on the outprint is automatically set to\~0.
657 All positioning, writing, and drawing is always done relative to a
658 page, so a
659 .BR p \~command
660 must be issued before any of these commands.
664 .command s n
665 Set point size to
666 .I n
667 scaled points
668 (this is unit\~\c
669 .B z
671 .BR @L_TROFF@ ).
673 .I Classical troff
674 used the unit
675 .I points
677 .BR p )
678 instead; see section
679 .BR COMPATIBILITY .
683 .command t xyz\|.\|.\|. \[la]white-space\[ra]
685 .command t "xyz\|.\|.\|.\& dummy-arg" \[la]white-space\[ra]
686 Print a word, i.e., a sequence of glyphs with single-letter names
687 .IR x ,
688 .IR y ,
689 .IR z ,
690 etc., terminated by a space character or a line break; an optional
691 second integer argument is ignored (this allows the formatter to
692 generate an even number of arguments).
694 The first glyph should be printed at the current position, the
695 current horizontal position should then be increased by the width of
696 the first glyph, and so on for each glyph.
698 The widths of the glyph are read from the font file, scaled for the
699 current point size, and rounded to a multiple of the horizontal
700 resolution.
702 Special characters (glyphs with names longer than a single letter)
703 cannot be printed using this command; use the
704 .B C
705 command for those glyphs.
707 This command is a
708 .I @T_ROFF@
709 extension; it is only used for devices whose
710 .I DESC
711 file contains the
712 .B tcommand
713 keyword; see
714 .BR @L_ROFF@-font (@MAN5EXT@).
718 .command u "n xyz\|.\|.\|." \[la]white-space\[ra]
719 Print word with track kerning.
721 This is the same as the
722 .B t
723 command except that after printing each glyph, the current
724 horizontal position is increased by the sum of the width of that
725 glyph and\~\c
726 .I n
727 (an integer in
728 basic units\~\c
729 .BR u ).
730 This command is a
731 .I @T_ROFF@
732 extension; it is only used for devices whose
733 .I DESC
734 file contains the
735 .B tcommand
736 keyword; see
737 .BR @L_ROFF@-font (@MAN5EXT@).
741 .command V n
742 Move down to the absolute vertical position\~\c
743 .I n
744 (a non-negative integer in basic units\~\c
745 .BR u )
746 relative to upper edge of current page.
750 .command v n
751 Move
752 .I n
753 basic units\~\c
754 .B u
755 down
756 .RI ( n
757 is a non-negative integer).
759 .I [CSTR\~#54]
760 allows negative values for
761 .I n
762 also, but
763 .I @T_ROFF@
764 doesn't use this.
768 .command w
769 Informs about a paddable whitespace to increase readability.
771 The spacing itself must be performed explicitly by a move command.
775 .SS "Graphics Commands"
778 Each graphics or drawing command in the
779 .I intermediate output
780 starts with the letter\~\c
781 .B D
782 followed by one or two characters that specify a subcommand; this
783 is followed by a fixed or variable number of integer arguments that
784 are separated by a single space character.
787 .B D\c
788 \~command
789 may not be followed by another command on the same line (apart from a
790 comment), so each
791 .B D\c
792 \~command
793 is terminated by a
794 .I syntactical line
795 .IR break .
799 .B @L_TROFF@
800 output follows the classical spacing rules (no space between command
801 and subcommand, all arguments are preceded by a single space
802 character), but the parser allows optional space between the command
803 letters and makes the space before the first argument optional.
805 As usual, each space can be any sequence of tab and space characters.
809 Some graphics commands can take a variable number of arguments.
811 In this case, they are integers representing a size measured in basic
812 units\~\c
813 .BR u .
816 .I h
817 arguments
818 stand for horizontal distances where positive means right, negative
819 left.
822 .I v
823 arguments
824 stand for vertical distances where positive means down, negative up.
826 All these distances are offsets relative to the current location.
830 Unless indicated otherwise, each graphics command directly corresponds
831 to a similar
832 .B \*[@backslash]D
833 escape sequence; see
834 .BR @L_ROFF@ (@MAN7EXT@).
838 Unknown
839 .B D\c
840 \~commands are assumed to be device-specific.
842 Its arguments are parsed as strings; the whole information is then
843 sent to the postprocessor.
847 In the following command reference, the syntax element
848 .I \[la]line-break\[ra]
849 means a
850 .I syntactical line break
851 as defined in section
852 .BR Separation .
856 .D-multiarg \[ti]
857 Draw B-spline from current position to offset
858 .indexed_offset h 1 v 1 ,
859 then to offset
860 .indexed_offset h 2 v 2
861 if given, etc., up to
862 .indexed_offset h n v n .
863 This command takes a variable number of argument pairs; the current
864 position is moved to the terminal point of the drawn curve.
868 .Da-command
869 Draw arc from current position to
870 .indexed_offset h 1 v 1 \|+\|\c
871 .indexed_offset h 2 v 2
872 with center at
873 .indexed_offset h 1 v 1 ;
874 then move the current position to the final point of the arc.
878 .D-command C d
880 .D-command C "d dummy-arg"
881 Draw a solid circle using the current fill color with diameter\~\c
882 .I d
883 (integer in basic units\~\c
884 .BR u )
885 with leftmost point at the current position; then move the current
886 position to the rightmost point of the circle.
888 An optional second integer argument is ignored (this allows to the
889 formatter to generate an even number of arguments).
891 This command is a
892 .I @T_ROFF@
893 extension.
897 .D-command c d
898 Draw circle line with diameter\~\c
899 .I d
900 (integer in basic units\~\c
901 .BR u )
902 with leftmost point at the current position; then move the current
903 position to the rightmost point of the circle.
907 .D-command E "h v"
908 Draw a solid ellipse in the current fill color with a horizontal
909 diameter of\~\c
910 .I h
911 and a vertical diameter of\~\c
912 .I v
913 (both integers in basic units\~\c
914 .BR u )
915 with the leftmost point at the current position; then move to the
916 rightmost point of the ellipse.
918 This command is a
919 .I @T_ROFF@
920 extension.
924 .D-command e "h v"
925 Draw an outlined ellipse with a horizontal diameter of\~\c
926 .I h
927 and a vertical diameter of\~\c
928 .I v
929 (both integers in basic units\~\c
930 .BR u )
931 with the leftmost point at current position; then move to the
932 rightmost point of the ellipse.
936 .D-command F "color-scheme \fR[\fPcomponent .\|.\|.\fR]\fP"
937 Set fill color for solid drawing objects using different color
938 schemes; the analoguous command for setting the color of text, line
939 graphics, and the outline of graphic objects is
940 .BR m .
942 The color components are specified as integer arguments between 0 and
943 \n[@maxcolor].
945 The number of color components and their meaning vary for the
946 different color schemes.
948 These commands are generated by the
949 escape sequences
950 .BR \*[@backslash]D'F\  .\|.\|. '
952 .B \*[@backslash]M
953 (with no other corresponding graphics commands).
955 No position changing.
957 This command is a
958 .I @T_ROFF@
959 extension.
965 .D-command Fc "cyan magenta yellow"
966 Set fill color for solid drawing objects using the CMY color scheme,
967 having the 3\~color components cyan, magenta, and yellow.
971 .D-command Fd
972 Set fill color for solid drawing objects to the default fill color value
973 (black in most cases).
975 No component arguments.
979 .D-command Fg "gray"
980 Set fill color for solid drawing objects to the shade of gray given by
981 the argument, an integer between 0 (black) and \n[@maxcolor] (white).
985 .D-command Fk "cyan magenta yellow black"
986 Set fill color for solid drawing objects using the CMYK color scheme,
987 having the 4\~color components cyan, magenta, yellow, and black.
990 .D-command Fr "red green blue"
991 Set fill color for solid drawing objects using the RGB color scheme,
992 having the 3\~color components red, green, and blue.
998 .D-command f n
999 The argument
1000 .I n
1001 must be an integer in the range \-32767 to 32767.
1005 .RI 0\|\[<=]\| n \|\[<=]\|1000
1006 Set the color for filling solid drawing objects to a shade of gray,
1007 where 0 corresponds to solid white, 1000 (the default) to solid black,
1008 and values inbetween to intermediate shades of gray; this is
1009 obsoleted by command
1010 .BR DFg .
1013 .IR n "\|<\|0 or " n \|>\|1000
1014 Set the filling color to the color that is currently being used for
1015 the text and the outline, see command
1016 .BR m .
1017 For example, the command sequence
1022 mg 0 0 \n[@maxcolor]
1023 Df -1
1028 sets all colors to blue.
1031 No position changing.
1033 This command is a
1034 .I @T_ROFF@
1035 extension.
1041 .D-command l "h v"
1042 Draw line from current position to offset
1043 .offset h v
1044 (integers in basic units\~\c
1045 .BR u );
1046 then set current position to the end of the drawn line.
1050 .D-multiarg p
1051 Draw a polygon line from current position to offset
1052 .indexed_offset h 1 v 1 ,
1053 from there to offset
1054 .indexed_offset h 2 v 2 ,
1055 etc., up to offset
1056 .indexed_offset h n v n ,
1057 and from there back to the starting position.
1059 .ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1060 For historical reasons, the position is changed by adding the sum of
1061 all arguments with odd index to the actual horizontal position and the
1062 even ones to the vertical position.
1064 Although this doesn't make sense it is kept for compatibility.
1067 .el \{\
1068 As the polygon is closed, the end of drawing is the starting point, so
1069 the position doesn't change.
1072 This command is a
1073 .I @T_ROFF@
1074 extension.
1078 .D-multiarg P
1079 The same macro as the corresponding
1080 .B Dp
1081 command with the same arguments, but draws a solid polygon in the
1082 current fill color rather than an outlined polygon.
1084 .ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1085 The position is changed in the same way as with
1086 .BR Dp .
1088 .el \
1089 No position changing.
1091 This command is a
1092 .I @T_ROFF@
1093 extension.
1097 .D-command t n
1098 Set the current line thickness to\~\c
1099 .I n
1100 (an integer in basic units\~\c
1101 .BR u )
1103 .IR n \|>\|0;
1105 .IR n \|=\|0
1106 select the smallest available line thickness; if
1107 .IR n \|<\|0
1108 set the line thickness proportional to the point size (this is the
1109 default before the first
1110 .B Dt
1111 command was specified).
1113 .ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1114 For historical reasons, the horizontal position is changed by adding
1115 the argument to the actual horizontal position, while the vertical
1116 position is not changed.
1118 Although this doesn't make sense it is kept for compatibility.
1121 .el \
1122 No position changing.
1124 This command is a
1125 .I @T_ROFF@
1126 extension.
1130 .SS "Device Control Commands"
1133 Each device control command starts with the letter
1134 .B x
1135 followed by a space character (optional or arbitrary space/\:tab in
1136 .IR @T_ROFF@ )
1137 and a subcommand letter or word; each argument (if any) must be
1138 preceded by a
1139 .I syntactical
1140 .IR space .
1143 .B x
1144 commands are terminated by a
1145 .IR "syntactical line break" ;
1146 no device control command can be followed by another command on the same
1147 line (except a comment).
1150 The subcommand is basically a single letter, but to increase
1151 readability, it can be written as a word, i.e., an arbitrary sequence
1152 of characters terminated by the next tab, space, or newline character.
1154 All characters of the subcommand word but the first are simply ignored.
1156 For example,
1157 .B @L_TROFF@
1158 outputs the initialization command
1159 .B x\ i
1161 .B x\ init
1162 and the resolution command
1163 .B x\ r
1165 .BR "x\ res" .
1167 But writings like
1168 .B x\ i_like_roff
1169 are accepted as well to mean the same commands.
1172 In the following, the syntax element
1173 .I \[la]line-break\[ra]
1174 means a
1175 .I syntactical line break
1176 as defined in section
1177 .BR Separation .
1180 .x-command F name
1181 .xsub Filename
1183 .I name
1184 as the intended name for the current file in error reports.
1186 This is useful for remembering the original file name when
1187 an internal piping mechanism is used.
1188 The input file is not changed by this command.
1190 This command is a
1191 .I @T_ROFF@
1192 extension.
1196 .x-command f "n\ s"
1197 .xsub font
1198 Mount font position\~\c
1199 .I n
1200 (a non-negative integer) with font named\~\c
1201 .I s
1202 (a text word),
1204 .BR @L_ROFF@-font (@MAN5EXT@).
1208 .x-command H n
1209 .xsub Height
1210 Set character height to\~\c
1211 .I n
1212 (a positive integer in scaled points\~\c
1213 .BR z ).
1215 .I Classical troff
1216 used the unit points (\c
1217 .BR p )
1218 instead; see section
1219 .BR COMPATIBILITY .
1223 .x-command i
1224 .xsub init
1225 Initialize device.
1227 This is the third command of the
1228 .IR prologue .
1232 .x-command p
1233 .xsub pause
1234 Parsed but ignored.
1236 The classical documentation reads
1237 .I pause device, can be
1238 .IR restarted .
1242 .x-command r "n\ h\ v"
1243 .xsub resolution
1244 Resolution is\~\c
1245 .IR n ,
1246 while
1247 .I h
1248 is the minimal horizontal motion, and
1249 .I v
1250 the minimal vertical motion possible with this device; all arguments
1251 are positive integers in basic units\~\c
1252 .B u
1253 per inch.
1255 This is the second command of the
1256 .IR prologue .
1260 .x-command S n
1261 .xsub Slant
1262 Set slant to\~\c
1263 .I n
1264 degrees (an integer in basic units\~\c
1265 .BR u ).
1269 .x-command s
1270 .xsub stop
1271 Terminates the processing of the current file; issued as the last
1272 command of any
1273 .I intermediate @L_TROFF@
1274 .IR output .
1278 .x-command t
1279 .xsub trailer
1280 Generate trailer information, if any.
1283 .BR @T_ROFF@ ,
1284 this is actually just ignored.
1288 .x-command T xxx
1289 .xsub Typesetter
1290 Set name of device to word
1291 .IR xxx ,
1292 a sequence of characters ended by the next whitespace character.
1294 The possible device names coincide with those from the @L_ROFF@
1295 .B \-T
1296 option.
1298 This is the first command of the
1299 .IR prologue .
1303 .x-command u n
1304 .xsub underline
1305 Configure underlining of spaces.
1308 .I n
1309 is\~1, start underlining of spaces;
1311 .I n
1312 is\~0, stop underlining of spaces.
1314 This is needed for the
1315 .B cu
1316 request in
1317 .B @L_NROFF@
1318 mode and is ignored otherwise.
1320 This command is a
1321 .I @T_ROFF@
1322 extension.
1326 .x-command X anything
1327 .xsub X-escape
1328 Send string
1329 .I anything
1330 uninterpreted to the device.
1332 If the line following this command starts with a
1333 .B +
1334 character this line is interpreted as a continuation line in the
1335 following sense.
1338 .B +
1339 is ignored, but a newline character is sent instead to the device, the
1340 rest of the line is sent uninterpreted.
1342 The same applies to all following lines until the first character of a
1343 line is not a
1344 .B +
1345 character.
1347 This command is generated by the escape sequence
1348 .BR \*[@backslash]X .
1350 The line-continuing feature is a
1351 .I @T_ROFF@
1352 extension.
1356 .SS "Obsolete Command"
1360 .I classical troff
1361 output, emitting a single glyph was mostly done by a very
1362 strange command that combined a horizontal move and the printing of a
1363 glyph.
1365 It didn't have a command code, but is represented by a 3-character
1366 argument consisting of exactly 2\~digits and a character.
1369 .I ddc
1370 Move right
1371 .I dd
1372 (exactly two decimal digits) basic units\~\c
1373 .BR u ,
1374 then print glyph with single-letter name\~\c
1375 .IR c .
1381 .IR @T_ROFF@ ,
1382 arbitrary
1383 .I syntactical space
1384 around and within this command is allowed to be added.
1386 Only when a preceding command on the same line ends with an argument
1387 of variable length a separating space is obligatory.
1390 .I classical
1391 .IR troff ,
1392 large clusters of these and other commands were used, mostly without
1393 spaces; this made such output almost unreadable.
1399 For modern high-resolution devices, this command does not make sense
1400 because the width of the glyphs can become much larger than two
1401 decimal digits.
1402 The commands
1403 .B t
1404 and\~\c
1405 .B u
1406 provide a better functionality.
1409 .SH "POSTPROCESSING"
1412 .I roff
1413 postprocessors are programs that have the task to translate the
1414 .I intermediate output
1415 into actions that are sent to a device.
1417 A device can be some piece of hardware such as a printer, or a software
1418 file format suitable for graphical or text processing.
1421 .I @T_ROFF@
1422 system provides powerful means that make the programming of such
1423 postprocessors an easy task.
1425 There is a library function that parses the
1426 .I intermediate output
1427 and sends the information obtained to the device via methods of a
1428 class with a common interface for each device.
1430 So a postprocessor must only redefine the methods of this class.
1432 For details, see the reference in section
1433 .BR FILES .
1436 .SH "EXAMPLES"
1438 This section presents the
1439 .I intermediate output
1440 generated from the same input for three different devices.
1442 The input is the sentence
1443 .I hell world
1444 fed into
1445 .B @L_ROFF@
1446 on the command line.
1449 .IP \[bu] 2m
1450 High-resolution device
1451 .I ps
1457 \fBshell>\fP echo "hell world" | @L_ROFF@ \-Z \-T ps
1463 .ft CB
1464 x T ps
1465 x res 72000 1 1
1466 x init
1468 x font 5 TR
1470 s10000
1471 V12000
1472 H72000
1473 thell
1474 wh2500
1476 H96620
1477 torld
1478 n12000 0
1479 x trailer
1480 V792000
1481 x stop
1482 .ft P
1488 This output can be fed into the postprocessor
1489 .BR @L_D_PS@ (@MAN1EXT@)
1490 to get its representation as a PostScript file.
1493 .IP \[bu] 2m
1494 Low-resolution device
1495 .I latin1
1500 This is similar to the high-resolution device except that the
1501 positioning is done at a minor scale.
1503 Some comments (lines starting with
1504 .IR # )
1505 were added for clarification; they were not generated by the
1506 formatter.
1511 \fBshell>\fP "hell world" | @L_ROFF@ \-Z \-T latin1
1517 .I "# prologue"
1518 .ft CB
1519 x T latin1
1520 x res 240 24 40
1521 x init
1522 .I "# begin a new page"
1523 .ft CB
1525 .I "# font setup"
1526 .ft CB
1527 x font 1 R
1530 .I "# initial positioning on the page"
1531 .ft CB
1534 .I "# write text `hell'"
1535 .ft CB
1536 thell
1537 .I "# inform about a space, and do it by a horizontal jump"
1538 .ft CB
1539 wh24
1540 .I "# write text `world'"
1541 .ft CB
1542 tworld
1543 .I "# announce line break, but do nothing because ..."
1544 .ft CB
1545 n40 0
1546 .I "# ... the end of the document has been reached"
1547 .ft CB
1548 x trailer
1549 V2640
1550 x stop
1551 .ft P
1557 This output can be fed into the postprocessor
1558 .BR @L_D_TTY@ (@MAN1EXT@)
1559 to get a formatted text document.
1564 Due to the obsolete jump-and-write command, the text clusters in the
1565 classical output are almost unreadable.
1568 .SH "COMPATIBILITY"
1571 .I intermediate output
1572 language of the
1573 .I classical troff
1574 was first documented in
1575 .IR [CSTR\~#97] .
1578 .I @T_ROFF@ intermediate output
1579 format is compatible with this specification except for the following
1580 features.
1583 .IP \[bu] 2m
1584 The classical quasi device independence is not yet implemented.
1587 .IP \[bu] 2m
1588 The old hardware was very different from what we use today.
1590 So the
1591 .I @T_ROFF@
1592 devices are also fundamentally different from the ones in
1593 .I classical
1594 .IR troff .
1596 For example, the classical PostScript device was called
1597 .I post
1598 and had a resolution of 720 units per inch,
1599 whereas
1600 .IR @T_ROFF@ 's
1601 .I ps
1602 device has a resolution of 72000 units per inch.
1604 Maybe, by implementing some rescaling mechanism similar to the
1605 classical quasi device independence, these could be integrated into
1606 modern
1607 .IR @T_ROFF@ .
1610 .IP \[bu] 2m
1611 The B-spline command
1612 .B D\[ti]
1613 is correctly handled by the
1614 .I intermediate output
1615 parser, but the drawing routines aren't implemented in some of the
1616 postprocessor programs.
1619 .IP \[bu] 2m
1620 The argument of the commands
1621 .B s
1623 .B x H
1624 has the implicit unit scaled point\~\c
1625 .B z
1627 .IR @T_ROFF@ ,
1628 while
1629 .I classical troff
1630 had point (\c
1631 .BR p ).
1633 This isn't an incompatibility, but a compatible extension, for both
1634 units coincide for all devices without a
1635 .I sizescale
1636 parameter, including all classical and the
1637 .I @T_ROFF@
1638 text devices.
1640 The few
1641 .I @T_ROFF@
1642 devices with a sizescale parameter either did not exist, had a
1643 different name, or seem to have had a different resolution.
1645 So conflicts with classical devices are very unlikely.
1648 .ie \n[@STUPID_DRAWING_POSITIONING]=1 \{\
1649 .IP \[bu] 2m
1650 The position changing after the commands
1651 .BR Dp ,
1652 .BR DP ,
1654 .B Dt
1655 is illogical, but as old versions of GNU troff used this feature it is
1656 kept for compatibility reasons.
1657 .\}             \" @STUPID_DRAWING_POSITIONING
1658 .el \{\
1659 .IP \[bu] 2m
1660 Temporarily, there existed some confusion on the positioning after the
1661 .B D
1662 commands that are
1663 .I @T_ROFF@
1664 extensions.
1666 This has been clarified by establishing the classical rule for all
1667 @T_ROFF@ drawing commands:
1672 .ft I
1673 The position after a graphic object has been drawn is at its end;
1674 for circles and ellipses, the "end" is at the right side.
1680 From this, the positionings specified for the drawing commands above
1681 follow quite naturally.
1682 .\}             \" @STUPID_DRAWING_POSITIONING
1685 The differences between
1686 .I @T_ROFF@
1688 .I classical troff
1689 are documented in
1690 .BR @L_ROFF@-diff (@MAN7EXT@).
1693 .SH "FILES"
1696 .BI @FONTDIR@/dev name /DESC
1697 Device description file for device
1698 .IR name .
1701 .IB \[la]@T_ROFF@-source-dir\[ra] /src/libs/driver/input.cpp
1702 Defines the parser and postprocessor for the
1703 .I intermediate
1704 .IR output .
1706 It is located relative to the top directory of the
1707 .I @T_ROFF@
1708 source tree.
1710 This parser is the definitive specification of the
1711 .I @T_ROFF@ intermediate output
1712 format.
1715 .SH "SEE ALSO"
1717 A reference like
1718 .BR @L_ROFF@ (@MAN7EXT@)
1719 refers to a manual page; here
1720 .B @L_ROFF@
1721 in section\~\c
1722 .I @MAN7EXT@
1723 of the man-page documentation system.
1725 To read the example, look up section\~@MAN7EXT@ in your desktop help
1726 system or call from the shell prompt
1731 \fBshell>\fP man @MAN7EXT@ @L_ROFF@
1737 For more details, see
1738 .BR man (1).
1742 .BR @L_ROFF@ (@MAN1EXT@)
1743 option
1744 .B \-Z
1745 and further readings.
1749 .BR @L_ROFF@ (@MAN7EXT@)
1750 for details of the language such as numerical units and escape sequences.
1754 .BR @L_ROFF@-font (@MAN5EXT@)
1755 for details on the device scaling parameters of the
1756 .B DESC
1757 file.
1761 .BR @L_TROFF@ (@MAN1EXT@)
1762 generates the device-independent intermediate output.
1766 .BR @L_ROFF@-history (@MAN7EXT@)
1767 for historical aspects and the general structure of roff systems.
1771 .BR @L_ROFF@-diff (@MAN7EXT@)
1772 The differences between the intermediate output in groff and classical
1773 troff.
1776 .BR \%@L_D_DVI@ (@MAN1EXT@),
1777 .BR \%@L_D_HTML@ (@MAN1EXT@),
1778 .BR \%@L_D_PS@ (@MAN1EXT@),
1779 .BR \%@L_D_TTY@ (@MAN1EXT@)
1782 the @T_ROFF@ postprocessor programs.
1788 .I classical troff output language
1789 is described in two AT&T Bell Labs CSTR documents available on-line at
1790 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr.html
1791 Bell Labs CSTR site
1792 .UE .
1796 .I [CSTR #97]
1797 .I A Typesetter-independent TROFF
1799 .I Brian Kernighan
1800 is the original and most comprehensive documentation on the output
1801 language; see
1802 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:97.ps.gz
1803 CSTR\~#97
1804 .UE .
1808 .I [CSTR\~#54]
1809 The 1992 revision of the
1810 .I Nroff/\:Troff User's Manual
1812 .I J.\& F.\& Ossanna
1814 .I Brian Kernighan
1815 isn't as comprehensive as
1816 .I [CSTR\~#97]
1817 regarding the output language; see
1818 .UR http://\:cm.bell-labs.com/\:cm/\:cs/\:cstr/\:54.ps.gz
1819 CSTR\~#54
1820 .UE .
1823 .SH "AUTHORS"
1825 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
1827 Copyright (C) 1989, 2001 - 2008
1828 Free Software Foundation, Inc.
1831 This document is distributed under the terms of the FDL (GNU Free
1832 Documentation License) version 1.1 or later.
1834 You should have received a copy of the FDL with this package; it is also
1835 available on-line at the
1836 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
1837 GNU copyleft site
1838 .UE .
1842 This document was rewritten in 2002 by Bernd Warken.
1844 .\" s-ts-mode