aboutsummaryrefslogtreecommitdiffstats
path: root/doc/user/bgr_scal
blob: 37b65821d66a699d4d71eb4579a5ecd965f2a3c6 (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
62
63
64
65
66
67
68
69
@Section
   @Title { Scaling }
   @Tag { scaling }
@Begin
@PP
The @Code "@Scale" symbol performs a geometrical scaling of the
scale. @Index @Code "@Scale"
following object:
@ID @Code {
"0.5 @Scale @Box WARNING!"
}
produces
@ID {
0.5 @Scale @Box WARNING!
}
A scale factor of 0.5 means half the original size, 2.0 means double size,
and so on.  No unit of measurement appears in the scale factor, because
it makes no sense to have one.  As usual, the object to be scaled may be
arbitrary.
@PP
It is also possible to supply two scale factors, in which case the
first is applied horizontally and the second vertically:
@ID @Code "{0.5 2.0} @Scale @Box WARNING!"
has result
@ID {0.5 2.0} @Scale @Box WARNING!
Practical uses for this kind of scaling are rare.
@PP
If an empty object is given instead of a scale factor, like this:
@ID @Code "{} @Scale @Box WARNING!"
the @Code "@Scale" symbol will choose the largest scale factor that
does not overrun the available horizontal space.  It is often possible
to omit the {@Code "{}"}, since Lout inserts an empty object
automatically whenever an object is clearly missing (see Section
{@NumberOf objects}).  For example,
@ID @Code "@QuotedDisplay @Scale @Box WARNING!"
produces
@QuotedDisplay @Scale @Box WARNING!
@Code "@QuotedDisplay" and @Code "@LeftDisplay" go well with this form
of {@Code "@Scale"}.  However, some care is needed because Lout foolishly
takes no account of the available @I vertical space when choosing the
scale factor.  The chosen scale factor could enlarge the vertical size so
much that the object no longer fits on the page, with disastrous results.
@PP
By using a @Code "@Wide" symbol to restrict the available horizontal
space, this form of scaling can also be used to scale to a nominated
width.  For example,
wide @RawIndex { @Code "@Wide" }
wide.scale @SubIndex { with @Code "@Scale" }
@ID @Code "5c @Wide @Scale @Box WARNING!"
produces
@ID { 5c @Wide @Scale @Box WARNING! }
which is 5 centimetres wide.
@PP
The @Code "@Scale" symbol will scale either up or down, whichever
is required to fit the available space.  There is also a way to make
it scale down if necessary but never scale up, by giving the
@Code "downifneeded" keyword instead of an empty object:
@ID @Code "5c @Wide downifneeded @Scale @Box WARNING!"
produces no scaling:
@ID 5c @Wide downifneeded @Scale @Box WARNING!
but
@ID @Code "1c @Wide downifneeded @Scale @Box WARNING!"
does produce scaling:
@ID 1c @Wide downifneeded @Scale @Box WARNING!
This is a good option if scaling is being used when a display is
around the same width as the page; it scales only if this is
needed to fit the display into the column, not otherwise.
slig
@End @Section