home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / APPS / lout2.lzh / LOUT2 / DOC / TR.LOUT / ch2.05 < prev    next >
Text File  |  1994-01-25  |  5KB  |  132 lines

  1. @Section
  2.    @Title { The style and size of objects }
  3.    @Tag { size }
  4. @Begin
  5. @PP
  6. This section explains how Lout determines the style and size of each
  7. object.  Together, these attributes determine the object's final
  8. appearance in the output.
  9. style @Index { Style of an object }
  10. @PP
  11. The style of an object comprises the following:
  12. @BulletList
  13. @ListItem { Which font family, face and size to use (also defining the
  14. @Code f unit); }
  15. @ListItem { What gap to replace a single space between two objects by (also
  16. defining the @Code s unit); }
  17. @ListItem { The kind of paragraph breaking to employ ({@Code adjust},
  18. {@Code ragged}, etc.) }
  19. @ListItem { What gap to insert between the lines of paragraphs
  20. (also defining the @Code v unit); }
  21. @ListItem { Whether to permit hyphenation or not. }
  22. @EndList
  23. The style of an object depends on where it appears in the final
  24. document.  For example, the style of a parameter depends on where it is
  25. used; the style of a galley is the style of the first target that it
  26. attempts to attach itself to.  Of course, the style of any object can be
  27. changed by using the @@Font, @@Space, and @@Break symbols.
  28. @PP
  29. There are no standard default values for style.  Instead one must ensure
  30. that the root galley or each of its components is enclosed in @@Font
  31. and @@Break symbols.  From there the style is passed to incoming galleys
  32. and the objects within them.
  33. @PP
  34. width. @Index { Width of an object }
  35. height. @Index { Height of an object }
  36. size. @Index { Size of an object }
  37. The remainder of this section explains how the size of each object (its
  38. width and height on the printed page) is determined.  We will treat width
  39. only, since height is determined in exactly the same way, except that the
  40. complications introduced by paragraph breaking are absent.
  41. @PP
  42. With three exceptions (see below), the width of an object is as large as
  43. it possibly could be without violating a @@Wide symbol or intruding into
  44. the space occupied by neighbouring gaps or objects.  As an aid to
  45. investigating this rule, we will use the definition
  46. @ID @Code {
  47. "def @Box right x"
  48. "{"
  49. "  \"0 0 moveto xsize 0 lineto xsize ysize lineto 0 ysize lineto closepath stroke\""
  50. "  @Graphic x"
  51. "}"
  52. }
  53. which draws a box around the boundary of its right parameter (Section
  54. {@NumberOf graphic}).  The result of
  55. @ID @Code {
  56. "5c @Wide @Box metempsychosis"
  57. }
  58. is
  59. @ID {
  60. 5c @Wide @Box metempsychosis
  61. }
  62. The widest that @Code "@Box metempsychosis" could possibly be is five
  63. centimetres, and accordingly that is its width.  The same applies to
  64. {@Code metempsychosis}, which is five centimetres wide as well.  Note
  65. carefully that there is no object in this example whose width is equal
  66. to the sum of the widths of the letters of {@Code metempsychosis}.
  67. @PP
  68. The first of the three exceptions to the `as wide as possible' rule is the
  69. @@HContract symbol, which causes the width of its right parameter to be
  70. reduced to a reasonable minimum (a formal definition will not be attempted):
  71. @ID @Code {
  72. "5c @Wide @HContract @Box metempsychosis"
  73. }
  74. produces
  75. @ID {
  76. 5c @Wide @HContract @Box metempsychosis
  77. }
  78. The object @Code "@HContract @Box metempsychosis" is still five centimetres
  79. wide, but the object @Code "@Box metempsychosis" has been reduced.
  80. @PP
  81. The second of the three exceptions is the horizontal concatenation symbol
  82. @Code "|" (and also {@Code "&"}).  Consider this example:
  83. @ID @Code {
  84. "5c @Wide @Box { A  |1c  B  |1c  C }"
  85. }
  86. As usual, the right parameter of @@Wide is five centimetres wide, and
  87. the result looks like this:
  88. @ID {
  89. 5c @Wide @Box { A  |1c  B  |1c  C }
  90. }
  91. Lout has to apportion the size minus inter-column gaps among the three
  92. columns.
  93. @PP
  94. If the columns are wide enough to require paragraph breaking, Lout will
  95. assign sizes to the columns in such a way as to leave narrow columns
  96. unbroken and break wider columns to equal width, occupying the full
  97. size.  Otherwise, paragraph breaking is not required, and each column
  98. will be assigned a reasonable minimum size in the manner of @@HContract,
  99. except that the last column receives all the leftover width.  For example,
  100. @ID @Code {
  101. "5c @Wide { @Box A  |1c  @Box B  |1c  @Box C }"
  102. }
  103. has result
  104. @ID {
  105. 5c @Wide { @Box A  |1c  @Box B  |1c  @Box C }
  106. }
  107. If it is desired that the leftover width remain unused, rather than
  108. going into the last column, an empty column can be appended, or the last
  109. column can be enclosed in @@HContract.  Two other ways to apportion the
  110. leftover width are provided by the @@HExpand and @@HAdjust symbols
  111. (Sections {@NumberOf hexpand} and {@NumberOf hadjust}).
  112. @PP
  113. The third and final exception to the `as wide as possible' rule concerns
  114. the components of the root galley.  Each is considered to be enclosed
  115. root.galley.size @SubIndex { size of components of }
  116. in @@HContract and @@VContract symbols.
  117. @PP
  118. Up to this point we have treated width as a single quantity, but of
  119. course it has two parts:  width to left and right of the mark.  The
  120. `as wide as possible' rule applies to both directions:
  121. @ID @Code {
  122. "@HContract { @Box 953^.05 /0.5c @Box 2^.8286 }"
  123. }
  124. has result
  125. @ID {
  126. @HContract { @Box 953^.05 /0.5c @Box 2^.8286 }
  127. }
  128. Leftover width usually goes to the right, as we have seen, but here some
  129. width was available only to the left of {@Code "2.8286"} owing to the
  130. column mark alignment.
  131. @End @Section
  132.