aboutsummaryrefslogtreecommitdiffstats
path: root/doc/expert/pre_bend
blob: 8f742a948d3e994b1a7d89ee0364dcd32b53b034 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@Section
   @Tag { backend }
   @Title { "@BackEnd" and the PlainText and PDF back ends }
@Begin
@PP
backend.sym @Index { @@BackEnd symbol }
The @@BackEnd symbol, which takes no parameters, has for its result a
string naming the back end currently in use.  Three back ends are available,
PostScript, PDF and PlainText.  The symbol is generally used like this:
@ID @Code {
"@BackEnd @Case {"
"    PlainText @Yield { ... }"
"    PostScript @Yield { ... }"
"    PDF @Yield { ... }"
"}"
}
to obtain different objects depending on the back end.  No @Code else
is required since these are the only possible values.
@PP
When a @Code "@Case" symbol has @Code "@BackEnd" for its left parameter
and the left parameter of each @Code "@Yield" symbol within it consists
of a sequence of one or more literal words (including {@Code else}), Lout
will optimize by evaluating the @Code "@Case" symbol at the time it is
read.  This optimization ensures that there is only a small once-only
performance penalty for multiple back ends, and it permits these
@Code "@Case" symbols (but no other symbols) to appear within the object
following @Code "@Include" and @Code "@PrependGraphic" symbols.
@PP
The PlainText back end differs from the PostScript one in two main
respects.  First, there is effectively just one font:  although all
the font commands work exactly as usual, they don't actually change
anything.  Each character in this font is taken to be one tenth
of one inch wide and 20 points high.  Second, the output is an
ordinary text file, not a PostScript file.
@PP
Clearly, with ordinary text output the possibility of advanced graphics
features such as rotation and scaling is curtailed.  Nevertheless, all
symbols have well-defined (possibly null) effects in the PlainText
back end, so there is no additional danger of crashing the system or
obtaining grossly unreasonable output by a change to PlainText.
@PP
The PlainText back end is obtained by the @Code "-p" option to Basser
Lout.  The character size can be changed by adding two lengths to
the @Code "-p" option, like this:
@ID @Code "lout -p0.1i12p ..."
which invokes the PlainText back end with each character being 0.1
inches wide and 12 points high.  However, experience suggests that
the best approach is to define all horizontal lengths as multiples of
the @Code "s" unit (the width of a space, hence the width of all
characters) and to define all vertical lengths as multiples of the
@Code "f" unit (the font size, equal to the height of every character),
and not to change the character size in the command line.
@PP
There is a @Code "-P" option which is identical with the @Code "-p"
option except that it inserts a form-feed character between each two
components of the output, but not before the first or after the last.
@PP
The PDF back end is obtained by typing {@Code "lout -Z"}.  It is similar
to PostScript but much more limited in functionality.  Consult a separate
document distributed with Lout for further information.
@End @Section