home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume37 / lout / part22 < prev    next >
Text File  |  1993-06-20  |  84KB  |  1,996 lines

  1. Newsgroups: comp.sources.misc
  2. From: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  3. Subject: v37i120:  lout - Lout document formatting system, v2, Part22/30
  4. Message-ID: <1993Jun2.030409.28605@sparky.imd.sterling.com>
  5. X-Md4-Signature: a784ff22441983ebad7a8b5cf997095b
  6. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Wed, 2 Jun 1993 03:04:09 GMT
  9. Approved: kent@sparky.imd.sterling.com
  10.  
  11. Submitted-by: jeff@joyce.cs.su.oz.au (Jeff Kingston)
  12. Posting-number: Volume 37, Issue 120
  13. Archive-name: lout/part22
  14. Environment: UNIX
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # Contents:  lout/doc/tr.impl/s5.2 lout/font0/TimesBolIta.AFM
  21. #   lout/gnu.gpl lout/z09.c lout/z21.c lout/z26.c
  22. # Wrapped by kent@sparky on Sun May 30 19:44:00 1993
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 22 (of 30)."'
  26. if test -f 'lout/doc/tr.impl/s5.2' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'lout/doc/tr.impl/s5.2'\"
  28. else
  29.   echo shar: Extracting \"'lout/doc/tr.impl/s5.2'\" \(14105 characters\)
  30.   sed "s/^X//" >'lout/doc/tr.impl/s5.2' <<'END_OF_FILE'
  31. X@SubSection
  32. X    @Tag { flushing }
  33. X    @Title { The galley flushing algorithm }
  34. X@Begin
  35. X@PP
  36. XGalley components are promoted one by one into the point of appearance in
  37. Xthe dynamic parent galley, then carried along with it, ultimately to the
  38. Xroot galley and the output file.  This process is called @I galley
  39. X{@I flushing}: the galleys are rivers running together to the sea, and
  40. Xeach component is a drop of water.
  41. X@PP
  42. XHere is a snapshot of a small dynamic tree, based on the @Code "@PageList"
  43. Xdefinitions of Section {@NumberOf recursion}:
  44. X@ID @Fig {
  45. X
  46. X@I 10p @Font { output file } A:: @Box linestyle { noline } margin { 0c }
  47. X
  48. X||2c
  49. X
  50. X{
  51. X@I 10p @Font { root galley }
  52. X//0.2c
  53. XB:: @Box margin { 0c } linestyle { noline }
  54. X//
  55. X@LittlePage {
  56. X|0.5rt - 1 -
  57. X//1.2vx &2m A small
  58. X//1.2vx @Code "@Galley" * C:: @Box margin { 0.01c } linestyle { noline }
  59. X//1rt @Code "@FootSect"
  60. X}
  61. X//
  62. X@Box margin { 0.3c } 2.8c @Wide 8p @Font @Code "@PageList 2"
  63. X}
  64. X
  65. X||2c
  66. X
  67. X{
  68. X//0.9c  @I 10p @Font { body text }
  69. X//0.2c  D:: @Box margin { 0.3c } 2.8c @Wide 8p @Font paragraph
  70. X//      @Box margin { 0.3c } 2.8c @Wide 8p @Font { of text. }
  71. X//      @Box margin { 0.3c } 2.8c @Wide @Code 8p @Font "@Input"
  72. X}
  73. X
  74. X// @Arrow from { B@W } to { A@E }
  75. X// @Arrow from { D@W } to { C@E }
  76. X
  77. X}
  78. XThe components of the body text galley are lines, except for the special
  79. Xreceptive symbol @Code "@Input" which is a placeholder for as yet unread
  80. Xinput (Section {@NumberOf lookahead}).  The components of the root galley are
  81. Xpages, except for the concluding unexpanded invocation of {@Code "@PageList"},
  82. Xwhich is an inexhaustible source of more pages, expanded on demand.
  83. X@PP
  84. XThe concrete data structure used by Basser Lout permits the galley
  85. Xflushing algorithm to navigate the dynamic tree and find significant
  86. Xfeatures quickly:
  87. X@ID 10p @Font @Fig maxlabels { 100 } {
  88. X
  89. XA:: @Ellipse @I { HEAD }
  90. X
  91. X||1.5c
  92. X
  93. X@OneCol @OneRow {
  94. XB:: @Ellipse @I { RECEIVING * }
  95. X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W  A@CIRCUM} } to { B@W  }
  96. X//0.6c
  97. XC:: @Ellipse @I { RECEPTIVE }
  98. X// @Arrow from { A@CTR ++ {A@CTR @Angle C@W  A@CIRCUM} } to { C@W  }
  99. X//0.6c
  100. XD:: @Box margin { 0c } linestyle { noline }
  101. X// @Arrow from { A@CTR ++ {A@CTR @Angle D@NW  A@CIRCUM} } to { D@NW  }
  102. X//
  103. X@LittlePage {
  104. X|0.5rt - 1 -
  105. X//1.2vx &2m A small
  106. X//1.2vx  E:: @Box margin { 0c } linestyle { noline } @Code "@Galley "
  107. X//1rt    F:: @Box margin { 0c } linestyle { noline } @Code "@FootSect "
  108. X}
  109. X// @FunnyArrow arrow { forward } from { B@E } to { E@E }
  110. X// @FunnyArrow arrow { forward } from { C@E } to { F@E }
  111. X//0.6c
  112. XC:: @Ellipse @I { GAP }
  113. X// @Arrow from { A@CTR ++ {A@CTR @Angle C@W  A@CIRCUM} } to { C@W  }
  114. X//0.6c
  115. XC:: @Ellipse @I { RECEPTIVE }
  116. X// @Arrow from { A@CTR ++ {A@CTR @Angle C@W  A@CIRCUM} } to { C@W  }
  117. X//0.6c
  118. XD:: @Box margin { 0.3c } 2.8c @Wide 8p @Font @Code "@PageList 2"
  119. X//  @Arrow from { A@CTR ++ {A@CTR @Angle D@NW  A@CIRCUM} } to { D@NW  }
  120. X//  @FunnyArrow from { C@E } to { D@W ++ { 1.8 cm 0 } }
  121. X}
  122. X
  123. X||1.0c
  124. X
  125. XA:: @Ellipse @I { HEAD }
  126. X& @Arrow from { B@E } to { A@W }
  127. X
  128. X||1.5c
  129. X
  130. X@OneCol @OneRow {
  131. XB:: @Box margin { 0.3c } 2.8c @Wide 8p @Font paragraph
  132. X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
  133. X//0.6c
  134. XB:: @Ellipse @I { GAP }
  135. X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
  136. X//0.6c
  137. XB:: @Box margin { 0.3c } 2.8c @Wide 8p @Font { of text. }
  138. X// @Arrow from { A@CTR ++ {A@CTR @Angle B@NW A@CIRCUM} } to { B@NW }
  139. X//0.6c
  140. XB:: @Ellipse @I { GAP }
  141. X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
  142. X//0.6c
  143. XB:: @Ellipse @I { RECEPTIVE }
  144. X// @Arrow from { A@CTR ++ {A@CTR @Angle B@W A@CIRCUM} } to { B@W }
  145. X//0.6c
  146. XC:: @Box margin { 0.3c } 2.8c @Wide 8p @Font @Code "@Input"
  147. X// @Arrow from { A@CTR ++ {A@CTR @Angle C@NW A@CIRCUM} } to { C@NW }
  148. X// @FunnyArrow from { B@E } to { C@W ++ { 1.2 cm 0 } }
  149. X}
  150. X
  151. X}
  152. XEach galley has a @Eq { HEAD } node whose children are its component
  153. Xobjects, separated by @Eq { GAP } nodes recording the inter-component
  154. Xgaps.
  155. X@PP
  156. XEach component is preceded by zero or more @I {galley index nodes} of
  157. Xvarious types.  Every receptive symbol has a @Eq { RECEPTIVE } index pointing
  158. Xto it, so that it can be found without searching through its
  159. Xcomponent.  If the symbol is currently the target of a galley, it has a
  160. X@Eq { RECEIVING } index instead which is also linked to the incoming
  161. Xgalley.  Galleys that are currently without a target are linked to the
  162. Xdynamic tree by @Eq { UNATTACHED } galley indexes, either just after their
  163. Xmost recent target if there has been one, or else at their point of
  164. Xinvocation.
  165. X@PP
  166. XEach galley should be thought of as a concurrent process, although the
  167. Ximplementation in C uses coroutines implemented by procedures.  A galley
  168. Xmay promote its first component only if it has a target, sufficient space
  169. Xis available at the target to receive the component, and the component
  170. Xcontains no receptive symbols.  This last condition seems to be the key
  171. Xto galley synchronization:  it forces a bottom-up promotion regime,
  172. Xpreventing pages from flushing to output before text flushes into them,
  173. Xfor example.
  174. X@PP
  175. XEach galley contains a number of binary semaphores, shown as asterisks
  176. Xin our snapshots when set.  At any given moment, a galley process is
  177. Xeither running or else is suspended on one of its own semaphores.  The
  178. X@Eq { HEAD } node contains a semaphore which is set when the galley has tried
  179. Xto find a target and failed.  Each receptive symbol has a semaphore
  180. Xwhich is set when that symbol is preventing the first component from
  181. Xbeing promoted.
  182. X@PP
  183. XFor example, in the snapshot at the beginning of this section, the root
  184. Xgalley is suspended on the @Code "@Galley" symbol, but the text galley
  185. Xis running.  It will suspend on the @Code "@Input" symbol after the
  186. Xfirst two components are promoted.
  187. X@PP
  188. XEvery galley {@I G}, be it a list of pages, body text, a footnote, or
  189. Xwhatever, executes the following algorithm in parallel with every other
  190. Xgalley:
  191. X@DP
  192. X1.  Initially @I G is unattached.  Search forwards or backwards from its
  193. X@Eq { UNATTACHED } index as required, to find a receptive symbol @I S which
  194. Xcan expand to reveal a target for {@I G}.
  195. X@DP
  196. X2.  If no @I S can be found, suspend on the attachment semaphore.  Resume
  197. Xlater from step 1.
  198. X@DP
  199. X3.  Expand @I S to reveal the target of {@I G}.  Preserve {@I S}'s
  200. Xsemaphore by moving it to the first receptive symbol within the
  201. Xexpansion of {@I S}.
  202. X@DP
  203. X4.  Calculate the available width and height at the target, and if
  204. X@I G is still a pure parse tree, use the environment attached to @I G
  205. Xand the style information from the target to evaluate @I G as in
  206. XSection {@NumberOf functional}.
  207. X@DP
  208. X5.  Examine the components of @I G one by one.  For each component there
  209. Xare three possibilities:
  210. X@PP
  211. X@I ACCEPT.  If the component fits into the available space, and has
  212. Xno other problems, then promote it into the target.  If this is the
  213. Xfirst component promoted into this target, and @I G is a forcing
  214. Xgalley (Section {@NumberOf lookahead}), delete every receptive symbol
  215. Xpreceding the target in the parent galley.  If @I G is the root galley,
  216. Xrender the component on the output file and dispose it;
  217. X@PP
  218. X@I REJECT.  If the component is too large for the available space, or a
  219. X@Eq { FOLLOWS } index (described below) forbids its promotion into this
  220. Xtarget, then detach @I G from the target.  If this was the first component
  221. Xat this target, @I S has been a complete failure, so undo step 3 (Basser
  222. XLout is not able to undo step 4); otherwise delete the target.  Return to
  223. Xstep 1 and continue immediately;
  224. X@PP
  225. X@I SUSPEND.  If the component contains a receptive symbol, it cannot be
  226. Xpromoted yet.  If this symbol is the target of a galley that was written
  227. Xto an auxiliary file on a previous run, read in that galley and flush
  228. Xit.  Otherwise suspend on the receptive symbol's semaphore; resume later
  229. Xfrom step 4.
  230. X@DP
  231. X6.  Terminate when the galley is empty.
  232. X@DP
  233. XAt various points in this algorithm, receptive symbols (and their
  234. Xsemaphores) are deleted in the dynamic parent galley, possibly
  235. Xpermitting it to resume flushing.  When this happens, Basser Lout resumes
  236. Xthe parent immediately after @I G suspends or terminates.  Also,
  237. Xwhenever a component is promoted, any child galleys connected to
  238. Xit by @Eq { UNATTACHED } indexes must be resumed, since these
  239. Xgalleys may be able to find a target now.  A good example of this
  240. Xsituation occurs when a line of body text with one or more footnotes
  241. Xis promoted onto a page.  Basser Lout gives priority to such children,
  242. Xsuspending @I G while each is given a chance to flush.
  243. X@PP
  244. XBasser Lout searches for the first target of @I G only in regions of the
  245. Xdynamic tree that will clearly precede or follow {@I G}'s invocation
  246. Xpoint in the final printed document, whichever is specified in the
  247. X@Code into clause; subsequent targets are sought later in the same
  248. Xgalley as the first.  An exception to this rule, whose necessity will
  249. Xbe made clear later, is that a first @Code following target will be
  250. Xsought within a dynamic sibling galley preceding {@I G}'s invocation
  251. Xpoint:
  252. X@ID 10p @Font @Fig {
  253. X
  254. X{
  255. X@I { dynamic parent }
  256. X//0.2c
  257. X@Box 2.8c @Wide 4.5c @High
  258. X{
  259. X   //0.5c A:: @Box margin { 0c } linestyle { noline } @Code "@XTarget"
  260. X   //1.0c C:: @Box margin { 0c } linestyle { noline } @Eq { UNATTACHED }
  261. X   //1.3c @Code "@XTarget"
  262. X}
  263. X}
  264. X
  265. X||1.5c
  266. X
  267. X{
  268. X//0.6c
  269. XB:: @Box margin {0c} linestyle {noline} @Code "X into { @XTarget&&following }"
  270. X//0.2c
  271. X@Box 2.8c @Wide 1.5c @High { //0.8c @Code "@GTarget" }
  272. X//1.0c
  273. XD:: @Box margin {0c} linestyle {noline} @Code "G into { @GTarget&&following }"
  274. X//0.2c
  275. X@Box 2.8c @Wide 2.5c @High {}
  276. X}
  277. X
  278. X// @Arrow from { A@E ++ {0.2 cm 0} } to { B@W -- {0.2 cm 0} }
  279. X// @Arrow from { C@E ++ {0.2 cm 0} } to { D@W -- {0.2 cm 0} }
  280. X
  281. X}
  282. XHere @I G will find the @Code "@GTarget" target within {@I X}.  This is
  283. Xdangerous, since if the first component of @I G is then promoted via
  284. X@I X into the first {@Code "@XTarget"} rather than into the second,
  285. X{@I G}'s target will not appear later in the final printed document than
  286. Xits invocation point, as required by the @Code into clause.
  287. X@PP
  288. XAccordingly, when such a target is chosen, two special galley indexes
  289. Xare inserted and linked together: a @Eq { PRECEDES } index at {@I G}'s
  290. Xinvocation point, and a @Eq { FOLLOWS } index at the first component of
  291. X{@I G}.  The algorithm checks before promoting any @Eq { FOLLOWS } index
  292. Xthat its promotion would not place it earlier than the corresponding
  293. X@Eq { PRECEDES } index in the same galley, and rejects the component if
  294. Xit would.  Since @Eq { PRECEDES } and @Eq { FOLLOWS } indexes are rarely used,
  295. Xthis check can be implemented by linear search.
  296. X@PP
  297. XWhen two components are separated by {@Code "/"}, as opposed to the more
  298. Xusual {@Code "//"}, each influences the horizontal position of the
  299. Xother.  Because of this, the @I SUSPEND action is in fact taken if a
  300. Xreceptive symbol occurs in any component separated from the first by
  301. X{@Code "/"} operators only.  Again, linear search forwards to the first
  302. X{@Code "//"} suffices for this check.
  303. X@PP
  304. XA good illustration of these unusual cases is afforded by the
  305. X@Code "@Align" symbols from the standard DocumentLayout package.  These
  306. Xare used to produce displayed equations, aligned on their equals signs
  307. Xdespite being separated by arbitrary body text.
  308. X@PP
  309. XThe @Code "@Align" symbols are packaged neatly for the convenience of
  310. Xthe non-expert user, but we will show just the essence of the
  311. Ximplementation here.  First, an @Code "@AlignList" galley is created
  312. Xwhich contains an infinite supply of @Code "@AlignPlace" receptive
  313. Xsymbols separated by @Code "/" operators:
  314. X@ID @Fig {
  315. X
  316. X{
  317. X@I { body text galley }
  318. X//0.2c
  319. X@Box 2.8c @Wide 4.0c @High
  320. X{ //1.5c
  321. X  A:: @Box margin { 0c } linestyle { noline } @Code "@Galley"
  322. X}
  323. X}
  324. X
  325. X||1.5c
  326. X
  327. X{
  328. X//2.4c
  329. XB:: @Box margin { 0c } linestyle { noline } @Code "@AlignList"
  330. X//0.2c
  331. X@Box {
  332. X      @Code "@AlignPlace"
  333. X//1vx @Code "@AlignPlace"
  334. X//1vx @Code "..."
  335. X//1vx @Code "@EndAlignList"
  336. X}
  337. X
  338. X}
  339. X
  340. X// @Arrow from { A@E ++ {0.2 cm 0} } to { B@W -- {0.2 cm 0} }
  341. X}
  342. XThen equations like
  343. X@ID @ShowMarks @Eq { f(x) ^= g(x) + 2 }
  344. Xare created and sent to @Code "@AlignPlace&&following" targets.  They
  345. Xcollect in the @Code "@AlignList" galley and are aligned there:
  346. X@ID @Fig {
  347. X
  348. X{
  349. X@I { body text galley }
  350. X//0.2c
  351. X@Box 2.8c @Wide 4.0c @High
  352. X{ //1.5c
  353. X  A:: @Box margin { 0c } linestyle { noline } @Code "@Galley"
  354. X}
  355. X}
  356. X
  357. X||1.5c
  358. X
  359. X{
  360. X//2.4c
  361. XB:: @Box margin { 0c } linestyle { noline } @Code "@AlignList"
  362. X//0.2c
  363. X@Box {
  364. X   @Line linestyle { dashed } from { xmark ysize } to { xmark 0 }
  365. X   {
  366. X         @Eq { f(x) ^= g(x) + 2 }
  367. X    /1vx @Eq { f(x) - g(x) ^= 2 }
  368. X    /1vx @Code "..."
  369. X    /1vx @Code "@EndAlignList"
  370. X   }
  371. X}
  372. X
  373. X}
  374. X
  375. X// @Arrow from { A@E ++ {0.2 cm 0} } to { B@W -- {0.2 cm 0} }
  376. X}
  377. XThe @Code "@AlignList" galley does not flush, because its first
  378. Xcomponent is connected to a receptive symbol by @Code "/" operators.
  379. X@PP
  380. XAfter the last equation, an empty forcing galley is sent to
  381. X{@Code "@EndAlignList"}, deleting the two remaining receptive symbols from
  382. Xthe @Code "@AlignList" galley and permitting it to flush.  @Eq { FOLLOWS }
  383. Xindexes ensure that each equation finds a target placed in the body text
  384. Xjust after its point of invocation, so the equations return, aligned, to
  385. Xapproximately the points where they were invoked.  Notice that the flushing
  386. Xof body text is suspended until the list of equations is completed, as it
  387. Xmust be, since the horizontal position of the first equation cannot
  388. Xbe known until the last equation is added to the list.
  389. X@PP
  390. XLayout quality can occasionally be improved by rejecting a component
  391. Xthat could be promoted -- for example, a component of body text that
  392. Xcarries a footnote too large to fit on the current page.  Since Lout
  393. Xdoes not specify how breaking decisions are made, beyond the basic
  394. Xconstraints imposed by available space and @Code into clauses, in
  395. Xprinciple such high quality breaking could be added to the
  396. Ximplementation with no change to the language.  However, the
  397. Xgenerality of the galley flushing algorithm, and its already
  398. Xconsiderable complexity, make this a daunting problem in practice,
  399. Xalthough a fascinating one.  @TeX [9], with its unnested
  400. Xset of `floating insertions' clearly identifiable as each page is begun,
  401. Xhas the advantage in this respect.
  402. X@End @SubSection
  403. END_OF_FILE
  404.   if test 14105 -ne `wc -c <'lout/doc/tr.impl/s5.2'`; then
  405.     echo shar: \"'lout/doc/tr.impl/s5.2'\" unpacked with wrong size!
  406.   fi
  407.   # end of 'lout/doc/tr.impl/s5.2'
  408. fi
  409. if test -f 'lout/font0/TimesBolIta.AFM' -a "${1}" != "-c" ; then 
  410.   echo shar: Will not clobber existing file \"'lout/font0/TimesBolIta.AFM'\"
  411. else
  412.   echo shar: Extracting \"'lout/font0/TimesBolIta.AFM'\" \(14435 characters\)
  413.   sed "s/^X//" >'lout/font0/TimesBolIta.AFM' <<'END_OF_FILE'
  414. XStartFontMetrics 2.0
  415. XComment Copyright (c) 1984 Adobe Systems Incorporated.  All Rights Reserved.
  416. XComment Creation Date:Wed May 27 16:42:35 PDT 1987
  417. XFontName Times-BoldItalic
  418. XEncodingScheme AdobeStandardEncoding
  419. XFullName Times Bold Italic
  420. XFamilyName Times
  421. XWeight Bold
  422. XItalicAngle -15.0
  423. XIsFixedPitch false
  424. XUnderlinePosition -98
  425. XUnderlineThickness 54
  426. XVersion 001.004
  427. XNotice Times is a registered trademark of Allied Corporation.
  428. XFontBBox -168 -232 1014 894
  429. XCapHeight 662
  430. XXHeight 458
  431. XDescender -203
  432. XAscender 682
  433. XStartCharMetrics 228
  434. XC 32 ; WX 250 ; N space ; B 0 0 0 0 ;
  435. XC 33 ; WX 389 ; N exclam ; B 66 -13 367 676 ;
  436. XC 34 ; WX 555 ; N quotedbl ; B 142 367 549 693 ;
  437. XC 35 ; WX 500 ; N numbersign ; B 4 0 496 662 ;
  438. XC 36 ; WX 500 ; N dollar ; B -20 -101 492 723 ;
  439. XC 37 ; WX 833 ; N percent ; B 39 -8 784 685 ;
  440. XC 38 ; WX 778 ; N ampersand ; B 41 -19 727 676 ;
  441. XC 39 ; WX 333 ; N quoteright ; B 80 362 282 675 ;
  442. XC 40 ; WX 333 ; N parenleft ; B 28 -179 340 676 ;
  443. XC 41 ; WX 333 ; N parenright ; B -44 -179 268 676 ;
  444. XC 42 ; WX 500 ; N asterisk ; B 56 244 445 676 ;
  445. XC 43 ; WX 570 ; N plus ; B 33 0 537 505 ;
  446. XC 44 ; WX 250 ; N comma ; B -10 -181 192 132 ;
  447. XC 45 ; WX 333 ; N hyphen ; B 33 167 299 282 ;
  448. XC 46 ; WX 250 ; N period ; B 23 -13 170 133 ;
  449. XC 47 ; WX 278 ; N slash ; B -11 -18 289 682 ;
  450. XC 48 ; WX 500 ; N zero ; B 17 -13 472 676 ;
  451. XC 49 ; WX 500 ; N one ; B 5 0 415 676 ;
  452. XC 50 ; WX 500 ; N two ; B -27 0 441 676 ;
  453. XC 51 ; WX 500 ; N three ; B -15 -13 445 676 ;
  454. XC 52 ; WX 500 ; N four ; B -15 0 498 676 ;
  455. XC 53 ; WX 500 ; N five ; B -11 -13 482 662 ;
  456. XC 54 ; WX 500 ; N six ; B 23 -13 504 676 ;
  457. XC 55 ; WX 500 ; N seven ; B 51 0 519 662 ;
  458. XC 56 ; WX 500 ; N eight ; B 3 -13 471 676 ;
  459. XC 57 ; WX 500 ; N nine ; B -12 -13 470 676 ;
  460. XC 58 ; WX 333 ; N colon ; B 52 -13 291 458 ;
  461. XC 59 ; WX 333 ; N semicolon ; B 13 -181 291 458 ;
  462. XC 60 ; WX 570 ; N less ; B 31 -14 540 524 ;
  463. XC 61 ; WX 570 ; N equal ; B 33 116 537 401 ;
  464. XC 62 ; WX 570 ; N greater ; B 31 -14 540 524 ;
  465. XC 63 ; WX 500 ; N question ; B 78 -13 465 676 ;
  466. XC 64 ; WX 832 ; N at ; B -9 -150 838 691 ;
  467. XC 65 ; WX 667 ; N A ; B -51 0 602 676 ;
  468. XC 66 ; WX 667 ; N B ; B -24 0 618 662 ;
  469. XC 67 ; WX 667 ; N C ; B 22 -18 660 677 ;
  470. XC 68 ; WX 722 ; N D ; B -31 0 693 662 ;
  471. XC 69 ; WX 667 ; N E ; B -27 0 646 662 ;
  472. XC 70 ; WX 667 ; N F ; B -20 0 646 662 ;
  473. XC 71 ; WX 722 ; N G ; B 21 -18 699 676 ;
  474. XC 72 ; WX 778 ; N H ; B -24 0 791 662 ;
  475. XC 73 ; WX 389 ; N I ; B -22 0 412 662 ;
  476. XC 74 ; WX 500 ; N J ; B -45 -98 519 662 ;
  477. XC 75 ; WX 667 ; N K ; B -31 0 685 662 ;
  478. XC 76 ; WX 611 ; N L ; B -22 0 584 662 ;
  479. XC 77 ; WX 889 ; N M ; B -29 -12 907 662 ;
  480. XC 78 ; WX 722 ; N N ; B -27 -18 740 662 ;
  481. XC 79 ; WX 722 ; N O ; B 27 -18 684 676 ;
  482. XC 80 ; WX 611 ; N P ; B -27 0 608 662 ;
  483. XC 81 ; WX 722 ; N Q ; B 27 -203 684 676 ;
  484. XC 82 ; WX 667 ; N R ; B -29 0 616 662 ;
  485. XC 83 ; WX 556 ; N S ; B 6 -18 524 676 ;
  486. XC 84 ; WX 611 ; N T ; B 39 0 632 662 ;
  487. XC 85 ; WX 722 ; N U ; B 66 -18 736 662 ;
  488. XC 86 ; WX 667 ; N V ; B 48 -18 692 662 ;
  489. XC 87 ; WX 889 ; N W ; B 48 -18 914 662 ;
  490. XC 88 ; WX 667 ; N X ; B -24 0 687 662 ;
  491. XC 89 ; WX 611 ; N Y ; B 46 0 625 662 ;
  492. XC 90 ; WX 611 ; N Z ; B -1 0 594 662 ;
  493. XC 91 ; WX 333 ; N bracketleft ; B -7 -157 388 682 ;
  494. XC 92 ; WX 278 ; N backslash ; B 1 0 465 682 ;
  495. XC 93 ; WX 333 ; N bracketright ; B -65 -157 330 682 ;
  496. XC 94 ; WX 570 ; N asciicircum ; B 34 259 536 662 ;
  497. XC 95 ; WX 500 ; N underscore ; B 0 -127 500 -89 ;
  498. XC 96 ; WX 333 ; N quoteleft ; B 117 363 319 676 ;
  499. XC 97 ; WX 500 ; N a ; B 9 -14 480 458 ;
  500. XC 98 ; WX 500 ; N b ; B 20 -13 473 682 ;
  501. XC 99 ; WX 444 ; N c ; B 25 -13 418 458 ;
  502. XC 100 ; WX 500 ; N d ; B 9 -13 541 682 ;
  503. XC 101 ; WX 444 ; N e ; B 25 -13 413 458 ;
  504. XC 102 ; WX 333 ; N f ; B -146 -203 460 682 ; L i fi ; L l fl ;
  505. XC 103 ; WX 500 ; N g ; B -27 -203 498 458 ;
  506. XC 104 ; WX 556 ; N h ; B 12 -13 518 682 ;
  507. XC 105 ; WX 278 ; N i ; B 24 -13 283 676 ;
  508. XC 106 ; WX 278 ; N j ; B -152 -203 311 676 ;
  509. XC 107 ; WX 500 ; N k ; B 10 -13 511 682 ;
  510. XC 108 ; WX 278 ; N l ; B 30 -13 311 682 ;
  511. XC 109 ; WX 778 ; N m ; B 16 -13 744 458 ;
  512. XC 110 ; WX 556 ; N n ; B 24 -13 518 458 ;
  513. XC 111 ; WX 500 ; N o ; B 27 -13 467 458 ;
  514. XC 112 ; WX 500 ; N p ; B -79 -203 481 458 ;
  515. XC 113 ; WX 500 ; N q ; B 21 -203 486 459 ;
  516. XC 114 ; WX 389 ; N r ; B 9 0 415 458 ;
  517. XC 115 ; WX 389 ; N s ; B 16 -13 364 459 ;
  518. XC 116 ; WX 278 ; N t ; B 15 -14 304 592 ;
  519. XC 117 ; WX 556 ; N u ; B 47 -13 520 458 ;
  520. XC 118 ; WX 444 ; N v ; B 50 -13 432 458 ;
  521. XC 119 ; WX 667 ; N w ; B 50 -13 642 458 ;
  522. XC 120 ; WX 500 ; N x ; B -5 -13 498 458 ;
  523. XC 121 ; WX 444 ; N y ; B -60 -203 423 458 ;
  524. XC 122 ; WX 389 ; N z ; B -24 -58 394 448 ;
  525. XC 123 ; WX 348 ; N braceleft ; B 30 -154 380 686 ;
  526. XC 124 ; WX 220 ; N bar ; B 70 0 151 682 ;
  527. XC 125 ; WX 348 ; N braceright ; B -31 -161 319 679 ;
  528. XC 126 ; WX 570 ; N asciitilde ; B 33 158 537 353 ;
  529. XC 161 ; WX 389 ; N exclamdown ; B 20 -232 320 458 ;
  530. XC 162 ; WX 500 ; N cent ; B 50 -142 443 570 ;
  531. XC 163 ; WX 500 ; N sterling ; B -32 -13 505 676 ;
  532. XC 164 ; WX 167 ; N fraction ; B -161 0 327 662 ;
  533. XC 165 ; WX 500 ; N yen ; B -15 0 565 662 ;
  534. XC 166 ; WX 500 ; N florin ; B -86 -154 530 682 ;
  535. XC 167 ; WX 500 ; N section ; B 36 -143 454 676 ;
  536. XC 168 ; WX 500 ; N currency ; B -3 110 503 612 ;
  537. XC 169 ; WX 278 ; N quotesingle ; B 126 367 295 693 ;
  538. XC 170 ; WX 500 ; N quotedblleft ; B 57 363 513 676 ;
  539. XC 171 ; WX 500 ; N guillemotleft ; B 21 33 474 416 ;
  540. XC 172 ; WX 333 ; N guilsinglleft ; B 42 33 310 416 ;
  541. XC 173 ; WX 333 ; N guilsinglright ; B 22 38 290 421 ;
  542. XC 174 ; WX 556 ; N fi ; B -157 -203 538 682 ;
  543. XC 175 ; WX 556 ; N fl ; B -149 -203 577 682 ;
  544. XC 177 ; WX 500 ; N endash ; B -11 176 511 266 ;
  545. XC 178 ; WX 500 ; N dagger ; B 90 -146 489 676 ;
  546. XC 179 ; WX 500 ; N daggerdbl ; B 11 -143 487 675 ;
  547. XC 180 ; WX 250 ; N periodcentered ; B 51 179 200 328 ;
  548. XC 182 ; WX 500 ; N paragraph ; B 61 -189 592 682 ;
  549. XC 183 ; WX 350 ; N bullet ; B 50 175 300 425 ;
  550. XC 184 ; WX 333 ; N quotesinglbase ; B 66 -181 268 132 ;
  551. XC 185 ; WX 500 ; N quotedblbase ; B -57 -181 398 132 ;
  552. XC 186 ; WX 500 ; N quotedblright ; B 56 362 509 675 ;
  553. XC 187 ; WX 500 ; N guillemotright ; B 20 38 473 421 ;
  554. XC 188 ; WX 1000 ; N ellipsis ; B 93 -13 906 133 ;
  555. XC 189 ; WX 1000 ; N perthousand ; B 7 -49 985 699 ;
  556. XC 191 ; WX 500 ; N questiondown ; B 30 -203 417 487 ;
  557. XC 193 ; WX 333 ; N grave ; B 115 511 325 690 ;
  558. XC 194 ; WX 333 ; N acute ; B 168 511 405 690 ;
  559. XC 195 ; WX 333 ; N circumflex ; B 70 510 394 682 ;
  560. XC 196 ; WX 333 ; N tilde ; B 69 530 424 648 ;
  561. XC 197 ; WX 333 ; N macron ; B 81 547 420 616 ;
  562. XC 198 ; WX 333 ; N breve ; B 98 511 413 671 ;
  563. XC 199 ; WX 333 ; N dotaccent ; B 180 519 308 648 ;
  564. XC 200 ; WX 333 ; N dieresis ; B 85 519 424 648 ;
  565. XC 202 ; WX 333 ; N ring ; B 141 466 352 676 ;
  566. XC 203 ; WX 333 ; N cedilla ; B 32 -216 264 5 ;
  567. XC 205 ; WX 333 ; N hungarumlaut ; B 28 538 339 750 ;
  568. XC 206 ; WX 333 ; N ogonek ; B -36 -173 193 44 ;
  569. XC 207 ; WX 333 ; N caron ; B 109 511 437 683 ;
  570. XC 208 ; WX 1000 ; N emdash ; B -14 176 1014 266 ;
  571. XC 225 ; WX 944 ; N AE ; B -41 0 931 662 ;
  572. XC 227 ; WX 266 ; N ordfeminine ; B -24 286 291 676 ;
  573. XC 232 ; WX 611 ; N Lslash ; B -22 0 584 662 ;
  574. XC 233 ; WX 722 ; N Oslash ; B 27 -124 684 754 ;
  575. XC 234 ; WX 944 ; N OE ; B 23 -8 936 670 ;
  576. XC 235 ; WX 300 ; N ordmasculine ; B 1 286 300 676 ;
  577. XC 241 ; WX 722 ; N ae ; B 15 -13 685 458 ;
  578. XC 245 ; WX 278 ; N dotlessi ; B 27 -13 260 458 ;
  579. XC 248 ; WX 278 ; N lslash ; B 12 -13 326 682 ;
  580. XC 249 ; WX 500 ; N oslash ; B 27 -118 467 556 ;
  581. XC 250 ; WX 722 ; N oe ; B 26 -13 687 458 ;
  582. XC 251 ; WX 500 ; N germandbls ; B -168 -203 497 682 ;
  583. XC -1 ; WX 667 ; N Aacute ; B -51 0 602 894 ;
  584. XC -1 ; WX 667 ; N Acircumflex ; B -51 0 602 886 ;
  585. XC -1 ; WX 667 ; N Adieresis ; B -51 0 602 852 ;
  586. XC -1 ; WX 667 ; N Agrave ; B -51 0 602 894 ;
  587. XC -1 ; WX 667 ; N Aring ; B -51 0 602 880 ;
  588. XC -1 ; WX 667 ; N Atilde ; B -51 0 602 852 ;
  589. XC -1 ; WX 667 ; N Ccedilla ; B 22 -216 660 677 ;
  590. XC -1 ; WX 667 ; N Eacute ; B -27 0 646 894 ;
  591. XC -1 ; WX 667 ; N Ecircumflex ; B -27 0 646 886 ;
  592. XC -1 ; WX 667 ; N Edieresis ; B -27 0 646 852 ;
  593. XC -1 ; WX 667 ; N Egrave ; B -27 0 646 894 ;
  594. XC -1 ; WX 722 ; N Eth ; B -31 0 693 662 ;
  595. XC -1 ; WX 389 ; N Iacute ; B -22 0 433 894 ;
  596. XC -1 ; WX 389 ; N Icircumflex ; B -22 0 422 886 ;
  597. XC -1 ; WX 389 ; N Idieresis ; B -22 0 452 852 ;
  598. XC -1 ; WX 389 ; N Igrave ; B -22 0 412 894 ;
  599. XC -1 ; WX 722 ; N Ntilde ; B -27 -18 740 852 ;
  600. XC -1 ; WX 722 ; N Oacute ; B 27 -18 684 894 ;
  601. XC -1 ; WX 722 ; N Ocircumflex ; B 27 -18 684 886 ;
  602. XC -1 ; WX 722 ; N Odieresis ; B 27 -18 684 852 ;
  603. XC -1 ; WX 722 ; N Ograve ; B 27 -18 684 894 ;
  604. XC -1 ; WX 722 ; N Otilde ; B 27 -18 684 852 ;
  605. XC -1 ; WX 556 ; N Scaron ; B 6 -18 549 887 ;
  606. XC -1 ; WX 611 ; N Thorn ; B -27 0 572 662 ;
  607. XC -1 ; WX 722 ; N Uacute ; B 66 -18 736 894 ;
  608. XC -1 ; WX 722 ; N Ucircumflex ; B 66 -18 736 886 ;
  609. XC -1 ; WX 722 ; N Udieresis ; B 66 -18 736 852 ;
  610. XC -1 ; WX 722 ; N Ugrave ; B 66 -18 736 894 ;
  611. XC -1 ; WX 611 ; N Yacute ; B 46 0 625 894 ;
  612. XC -1 ; WX 611 ; N Ydieresis ; B 46 0 625 852 ;
  613. XC -1 ; WX 611 ; N Zcaron ; B -1 0 594 887 ;
  614. XC -1 ; WX 500 ; N aacute ; B 9 -14 489 690 ;
  615. XC -1 ; WX 500 ; N acircumflex ; B 9 -14 480 682 ;
  616. XC -1 ; WX 500 ; N adieresis ; B 9 -14 508 648 ;
  617. XC -1 ; WX 500 ; N agrave ; B 9 -14 480 690 ;
  618. XC -1 ; WX 500 ; N aring ; B 9 -14 480 676 ;
  619. XC -1 ; WX 500 ; N atilde ; B 9 -14 508 648 ;
  620. XC -1 ; WX 220 ; N brokenbar ; B 70 0 151 682 ;
  621. XC -1 ; WX 444 ; N ccedilla ; B 25 -216 418 458 ;
  622. XC -1 ; WX 747 ; N copyright ; B 23 -18 723 676 ;
  623. XC -1 ; WX 400 ; N degree ; B 70 376 370 676 ;
  624. XC -1 ; WX 570 ; N divide ; B 33 0 537 505 ;
  625. XC -1 ; WX 444 ; N eacute ; B 25 -13 461 690 ;
  626. XC -1 ; WX 444 ; N ecircumflex ; B 25 -13 450 682 ;
  627. XC -1 ; WX 444 ; N edieresis ; B 25 -13 480 648 ;
  628. XC -1 ; WX 444 ; N egrave ; B 25 -13 413 690 ;
  629. XC -1 ; WX 500 ; N eth ; B 27 -13 498 682 ;
  630. XC -1 ; WX 278 ; N iacute ; B 27 -13 378 690 ;
  631. XC -1 ; WX 278 ; N icircumflex ; B 27 -13 367 682 ;
  632. XC -1 ; WX 278 ; N idieresis ; B 27 -13 397 648 ;
  633. XC -1 ; WX 278 ; N igrave ; B 27 -13 298 690 ;
  634. XC -1 ; WX 606 ; N logicalnot ; B 51 120 555 401 ;
  635. XC -1 ; WX 606 ; N minus ; B 51 210 555 300 ;
  636. XC -1 ; WX 576 ; N mu ; B -62 -210 522 458 ;
  637. XC -1 ; WX 570 ; N multiply ; B 33 0 537 504 ;
  638. XC -1 ; WX 556 ; N ntilde ; B 24 -13 536 648 ;
  639. XC -1 ; WX 500 ; N oacute ; B 27 -13 489 690 ;
  640. XC -1 ; WX 500 ; N ocircumflex ; B 27 -13 478 682 ;
  641. XC -1 ; WX 500 ; N odieresis ; B 27 -13 508 648 ;
  642. XC -1 ; WX 500 ; N ograve ; B 27 -13 467 690 ;
  643. XC -1 ; WX 750 ; N onehalf ; B 30 0 720 676 ;
  644. XC -1 ; WX 750 ; N onequarter ; B 30 0 720 676 ;
  645. XC -1 ; WX 300 ; N onesuperior ; B 17 270 283 676 ;
  646. XC -1 ; WX 500 ; N otilde ; B 27 -13 508 648 ;
  647. XC -1 ; WX 570 ; N plusminus ; B 33 0 537 665 ;
  648. XC -1 ; WX 747 ; N registered ; B 23 -18 723 676 ;
  649. XC -1 ; WX 389 ; N scaron ; B 16 -13 465 683 ;
  650. XC -1 ; WX 500 ; N thorn ; B -79 -203 474 682 ;
  651. XC -1 ; WX 750 ; N threequarters ; B 30 0 720 676 ;
  652. XC -1 ; WX 300 ; N threesuperior ; B 0 263 299 676 ;
  653. XC -1 ; WX 1000 ; N trademark ; B 40 272 980 676 ;
  654. XC -1 ; WX 300 ; N twosuperior ; B -2 270 302 676 ;
  655. XC -1 ; WX 556 ; N uacute ; B 47 -13 520 690 ;
  656. XC -1 ; WX 556 ; N ucircumflex ; B 47 -13 520 682 ;
  657. XC -1 ; WX 556 ; N udieresis ; B 47 -13 536 648 ;
  658. XC -1 ; WX 556 ; N ugrave ; B 47 -13 520 690 ;
  659. XC -1 ; WX 444 ; N yacute ; B -60 -203 461 690 ;
  660. XC -1 ; WX 444 ; N ydieresis ; B -60 -203 480 648 ;
  661. XC -1 ; WX 389 ; N zcaron ; B -24 -58 465 683 ;
  662. XEndCharMetrics
  663. XStartKernData
  664. XStartKernPairs 108
  665. X
  666. XKPX A y -74
  667. XKPX A w -74
  668. XKPX A v -74
  669. XKPX A space -55
  670. XKPX A quoteright -74
  671. XKPX A Y -55
  672. XKPX A W -92
  673. XKPX A V -74
  674. XKPX A T -55
  675. X
  676. XKPX F space -18
  677. XKPX F period -129
  678. XKPX F comma -129
  679. XKPX F A -92
  680. X
  681. XKPX L y -37
  682. XKPX L space -37
  683. XKPX L quoteright -55
  684. XKPX L Y -37
  685. XKPX L W -37
  686. XKPX L V -37
  687. XKPX L T -18
  688. X
  689. XKPX P space -37
  690. XKPX P period -129
  691. XKPX P comma -129
  692. XKPX P A -74
  693. X
  694. XKPX R y -18
  695. XKPX R Y -18
  696. XKPX R W -18
  697. XKPX R V -18
  698. X
  699. XKPX T y -37
  700. XKPX T w -37
  701. XKPX T u -37
  702. XKPX T semicolon -74
  703. XKPX T s -92
  704. XKPX T r -37
  705. XKPX T period -92
  706. XKPX T o -92
  707. XKPX T i -37
  708. XKPX T hyphen -92
  709. XKPX T e -92
  710. XKPX T comma -92
  711. XKPX T colon -74
  712. XKPX T c -92
  713. XKPX T a -92
  714. XKPX T O -18
  715. XKPX T A -55
  716. X
  717. XKPX V y -74
  718. XKPX V u -55
  719. XKPX V space -18
  720. XKPX V semicolon -74
  721. XKPX V r -55
  722. XKPX V period -129
  723. XKPX V o -111
  724. XKPX V i -55
  725. XKPX V hyphen -55
  726. XKPX V e -111
  727. XKPX V comma -129
  728. XKPX V colon -74
  729. XKPX V a -111
  730. XKPX V A -74
  731. X
  732. XKPX W y -55
  733. XKPX W u -55
  734. XKPX W space -18
  735. XKPX W semicolon -55
  736. XKPX W r -74
  737. XKPX W period -74
  738. XKPX W o -74
  739. XKPX W i -37
  740. XKPX W hyphen -37
  741. XKPX W e -74
  742. XKPX W comma -74
  743. XKPX W colon -55
  744. XKPX W a -74
  745. XKPX W A -74
  746. X
  747. XKPX Y v -92
  748. XKPX Y u -92
  749. XKPX Y space -37
  750. XKPX Y semicolon -92
  751. XKPX Y q -111
  752. XKPX Y period -74
  753. XKPX Y p -74
  754. XKPX Y o -111
  755. XKPX Y i -55
  756. XKPX Y hyphen -92
  757. XKPX Y e -111
  758. XKPX Y comma -92
  759. XKPX Y colon -92
  760. XKPX Y a -92
  761. XKPX Y A -74
  762. X
  763. XKPX f quoteright 55
  764. XKPX f f -18
  765. X
  766. XKPX one one -55
  767. X
  768. XKPX quoteleft quoteleft -74
  769. X
  770. XKPX quoteright t -37
  771. XKPX quoteright space -74
  772. XKPX quoteright s -74
  773. XKPX quoteright quoteright -74
  774. X
  775. XKPX r quoteright 37
  776. XKPX r period -55
  777. XKPX r comma -55
  778. X
  779. XKPX space Y -18
  780. XKPX space W -18
  781. XKPX space A -37
  782. X
  783. XKPX v period -37
  784. XKPX v comma -37
  785. X
  786. XKPX w period -37
  787. XKPX w comma -37
  788. X
  789. XKPX y period -37
  790. XKPX y comma -37
  791. XEndKernPairs
  792. XEndKernData
  793. XStartComposites 58
  794. XCC Zcaron 2 ; PCC Z 0 0 ; PCC caron 139 204 ;
  795. XCC zcaron 2 ; PCC z 0 0 ; PCC caron 28 0 ;
  796. XCC Scaron 2 ; PCC S 0 0 ; PCC caron 111 204 ;
  797. XCC scaron 2 ; PCC s 0 0 ; PCC caron 28 0 ;
  798. XCC Ccedilla 2 ; PCC C 0 0 ; PCC cedilla 167 0 ;
  799. XCC ccedilla 2 ; PCC c 0 0 ; PCC cedilla 55 0 ;
  800. XCC Yacute 2 ; PCC Y 0 0 ; PCC acute 139 204 ;
  801. XCC yacute 2 ; PCC y 0 0 ; PCC acute 55 0 ;
  802. XCC Ydieresis 2 ; PCC Y 0 0 ; PCC dieresis 139 204 ;
  803. XCC ydieresis 2 ; PCC y 0 0 ; PCC dieresis 55 0 ;
  804. XCC Uacute 2 ; PCC U 0 0 ; PCC acute 194 204 ;
  805. XCC Ucircumflex 2 ; PCC U 0 0 ; PCC circumflex 194 204 ;
  806. XCC Udieresis 2 ; PCC U 0 0 ; PCC dieresis 194 204 ;
  807. XCC Ugrave 2 ; PCC U 0 0 ; PCC grave 194 204 ;
  808. XCC uacute 2 ; PCC u 0 0 ; PCC acute 111 0 ;
  809. XCC ucircumflex 2 ; PCC u 0 0 ; PCC circumflex 111 0 ;
  810. XCC udieresis 2 ; PCC u 0 0 ; PCC dieresis 111 0 ;
  811. XCC ugrave 2 ; PCC u 0 0 ; PCC grave 111 0 ;
  812. XCC Iacute 2 ; PCC I 0 0 ; PCC acute 28 204 ;
  813. XCC Icircumflex 2 ; PCC I 0 0 ; PCC circumflex 28 204 ;
  814. XCC Idieresis 2 ; PCC I 0 0 ; PCC dieresis 28 204 ;
  815. XCC Igrave 2 ; PCC I 0 0 ; PCC grave 28 204 ;
  816. XCC iacute 2 ; PCC dotlessi 0 0 ; PCC acute -27 0 ;
  817. XCC icircumflex 2 ; PCC dotlessi 0 0 ; PCC circumflex -27 0 ;
  818. XCC idieresis 2 ; PCC dotlessi 0 0 ; PCC dieresis -27 0 ;
  819. XCC igrave 2 ; PCC dotlessi 0 0 ; PCC grave -27 0 ;
  820. XCC Eacute 2 ; PCC E 0 0 ; PCC acute 167 204 ;
  821. XCC Ecircumflex 2 ; PCC E 0 0 ; PCC circumflex 167 204 ;
  822. XCC Edieresis 2 ; PCC E 0 0 ; PCC dieresis 167 204 ;
  823. XCC Egrave 2 ; PCC E 0 0 ; PCC grave 167 204 ;
  824. XCC eacute 2 ; PCC e 0 0 ; PCC acute 55 0 ;
  825. XCC ecircumflex 2 ; PCC e 0 0 ; PCC circumflex 55 0 ;
  826. XCC edieresis 2 ; PCC e 0 0 ; PCC dieresis 55 0 ;
  827. XCC eg
  828. END_OF_FILE
  829.   echo shar: appended 1 NEWLINEs to \"'lout/font0/TimesBolIta.AFM'\"
  830.   if test 14436 -ne `wc -c <'lout/font0/TimesBolIta.AFM'`; then
  831.     echo shar: \"'lout/font0/TimesBolIta.AFM'\" unpacked with wrong size!
  832.   fi
  833.   # end of 'lout/font0/TimesBolIta.AFM'
  834. fi
  835. if test -f 'lout/gnu.gpl' -a "${1}" != "-c" ; then 
  836.   echo shar: Will not clobber existing file \"'lout/gnu.gpl'\"
  837. else
  838.   echo shar: Extracting \"'lout/gnu.gpl'\" \(12487 characters\)
  839.   sed "s/^X//" >'lout/gnu.gpl' <<'END_OF_FILE'
  840. X            GNU GENERAL PUBLIC LICENSE
  841. X             Version 1, February 1989
  842. X
  843. X Copyright (C) 1989 Free Software Foundation, Inc.
  844. X                    675 Mass Ave, Cambridge, MA 02139, USA
  845. X Everyone is permitted to copy and distribute verbatim copies
  846. X of this license document, but changing it is not allowed.
  847. X
  848. X                Preamble
  849. X
  850. X  The license agreements of most software companies try to keep users
  851. Xat the mercy of those companies.  By contrast, our General Public
  852. XLicense is intended to guarantee your freedom to share and change free
  853. Xsoftware--to make sure the software is free for all its users.  The
  854. XGeneral Public License applies to the Free Software Foundation's
  855. Xsoftware and to any other program whose authors commit to using it.
  856. XYou can use it for your programs, too.
  857. X
  858. X  When we speak of free software, we are referring to freedom, not
  859. Xprice.  Specifically, the General Public License is designed to make
  860. Xsure that you have the freedom to give away or sell copies of free
  861. Xsoftware, that you receive source code or can get it if you want it,
  862. Xthat you can change the software or use pieces of it in new free
  863. Xprograms; and that you know you can do these things.
  864. X
  865. X  To protect your rights, we need to make restrictions that forbid
  866. Xanyone to deny you these rights or to ask you to surrender the rights.
  867. XThese restrictions translate to certain responsibilities for you if you
  868. Xdistribute copies of the software, or if you modify it.
  869. X
  870. X  For example, if you distribute copies of a such a program, whether
  871. Xgratis or for a fee, you must give the recipients all the rights that
  872. Xyou have.  You must make sure that they, too, receive or can get the
  873. Xsource code.  And you must tell them their rights.
  874. X
  875. X  We protect your rights with two steps: (1) copyright the software, and
  876. X(2) offer you this license which gives you legal permission to copy,
  877. Xdistribute and/or modify the software.
  878. X
  879. X  Also, for each author's protection and ours, we want to make certain
  880. Xthat everyone understands that there is no warranty for this free
  881. Xsoftware.  If the software is modified by someone else and passed on, we
  882. Xwant its recipients to know that what they have is not the original, so
  883. Xthat any problems introduced by others will not reflect on the original
  884. Xauthors' reputations.
  885. X
  886. X  The precise terms and conditions for copying, distribution and
  887. Xmodification follow.
  888. X
  889. X            GNU GENERAL PUBLIC LICENSE
  890. X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  891. X
  892. X  0. This License Agreement applies to any program or other work which
  893. Xcontains a notice placed by the copyright holder saying it may be
  894. Xdistributed under the terms of this General Public License.  The
  895. X"Program", below, refers to any such program or work, and a "work based
  896. Xon the Program" means either the Program or any work containing the
  897. XProgram or a portion of it, either verbatim or with modifications.  Each
  898. Xlicensee is addressed as "you".
  899. X
  900. X  1. You may copy and distribute verbatim copies of the Program's source
  901. Xcode as you receive it, in any medium, provided that you conspicuously and
  902. Xappropriately publish on each copy an appropriate copyright notice and
  903. Xdisclaimer of warranty; keep intact all the notices that refer to this
  904. XGeneral Public License and to the absence of any warranty; and give any
  905. Xother recipients of the Program a copy of this General Public License
  906. Xalong with the Program.  You may charge a fee for the physical act of
  907. Xtransferring a copy.
  908. X
  909. X  2. You may modify your copy or copies of the Program or any portion of
  910. Xit, and copy and distribute such modifications under the terms of Paragraph
  911. X1 above, provided that you also do the following:
  912. X
  913. X    a) cause the modified files to carry prominent notices stating that
  914. X    you changed the files and the date of any change; and
  915. X
  916. X    b) cause the whole of any work that you distribute or publish, that
  917. X    in whole or in part contains the Program or any part thereof, either
  918. X    with or without modifications, to be licensed at no charge to all
  919. X    third parties under the terms of this General Public License (except
  920. X    that you may choose to grant warranty protection to some or all
  921. X    third parties, at your option).
  922. X
  923. X    c) If the modified program normally reads commands interactively when
  924. X    run, you must cause it, when started running for such interactive use
  925. X    in the simplest and most usual way, to print or display an
  926. X    announcement including an appropriate copyright notice and a notice
  927. X    that there is no warranty (or else, saying that you provide a
  928. X    warranty) and that users may redistribute the program under these
  929. X    conditions, and telling the user how to view a copy of this General
  930. X    Public License.
  931. X
  932. X    d) You may charge a fee for the physical act of transferring a
  933. X    copy, and you may at your option offer warranty protection in
  934. X    exchange for a fee.
  935. X
  936. XMere aggregation of another independent work with the Program (or its
  937. Xderivative) on a volume of a storage or distribution medium does not bring
  938. Xthe other work under the scope of these terms.
  939. X
  940. X  3. You may copy and distribute the Program (or a portion or derivative of
  941. Xit, under Paragraph 2) in object code or executable form under the terms of
  942. XParagraphs 1 and 2 above provided that you also do one of the following:
  943. X
  944. X    a) accompany it with the complete corresponding machine-readable
  945. X    source code, which must be distributed under the terms of
  946. X    Paragraphs 1 and 2 above; or,
  947. X
  948. X    b) accompany it with a written offer, valid for at least three
  949. X    years, to give any third party free (except for a nominal charge
  950. X    for the cost of distribution) a complete machine-readable copy of the
  951. X    corresponding source code, to be distributed under the terms of
  952. X    Paragraphs 1 and 2 above; or,
  953. X
  954. X    c) accompany it with the information you received as to where the
  955. X    corresponding source code may be obtained.  (This alternative is
  956. X    allowed only for noncommercial distribution and only if you
  957. X    received the program in object code or executable form alone.)
  958. X
  959. XSource code for a work means the preferred form of the work for making
  960. Xmodifications to it.  For an executable file, complete source code means
  961. Xall the source code for all modules it contains; but, as a special
  962. Xexception, it need not include source code for modules which are standard
  963. Xlibraries that accompany the operating system on which the executable
  964. Xfile runs, or for standard header files or definitions files that
  965. Xaccompany that operating system.
  966. X
  967. X  4. You may not copy, modify, sublicense, distribute or transfer the
  968. XProgram except as expressly provided under this General Public License.
  969. XAny attempt otherwise to copy, modify, sublicense, distribute or transfer
  970. Xthe Program is void, and will automatically terminate your rights to use
  971. Xthe Program under this License.  However, parties who have received
  972. Xcopies, or rights to use copies, from you under this General Public
  973. XLicense will not have their licenses terminated so long as such parties
  974. Xremain in full compliance.
  975. X
  976. X  5. By copying, distributing or modifying the Program (or any work based
  977. Xon the Program) you indicate your acceptance of this license to do so,
  978. Xand all its terms and conditions.
  979. X
  980. X  6. Each time you redistribute the Program (or any work based on the
  981. XProgram), the recipient automatically receives a license from the original
  982. Xlicensor to copy, distribute or modify the Program subject to these
  983. Xterms and conditions.  You may not impose any further restrictions on the
  984. Xrecipients' exercise of the rights granted herein.
  985. X
  986. X  7. The Free Software Foundation may publish revised and/or new versions
  987. Xof the General Public License from time to time.  Such new versions will
  988. Xbe similar in spirit to the present version, but may differ in detail to
  989. Xaddress new problems or concerns.
  990. X
  991. XEach version is given a distinguishing version number.  If the Program
  992. Xspecifies a version number of the license which applies to it and "any
  993. Xlater version", you have the option of following the terms and conditions
  994. Xeither of that version or of any later version published by the Free
  995. XSoftware Foundation.  If the Program does not specify a version number of
  996. Xthe license, you may choose any version ever published by the Free Software
  997. XFoundation.
  998. X
  999. X  8. If you wish to incorporate parts of the Program into other free
  1000. Xprograms whose distribution conditions are different, write to the author
  1001. Xto ask for permission.  For software which is copyrighted by the Free
  1002. XSoftware Foundation, write to the Free Software Foundation; we sometimes
  1003. Xmake exceptions for this.  Our decision will be guided by the two goals
  1004. Xof preserving the free status of all derivatives of our free software and
  1005. Xof promoting the sharing and reuse of software generally.
  1006. X
  1007. X                NO WARRANTY
  1008. X
  1009. X  9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
  1010. XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
  1011. XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
  1012. XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
  1013. XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  1014. XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
  1015. XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
  1016. XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
  1017. XREPAIR OR CORRECTION.
  1018. X
  1019. X  10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
  1020. XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
  1021. XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  1022. XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
  1023. XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
  1024. XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
  1025. XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
  1026. XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
  1027. XPOSSIBILITY OF SUCH DAMAGES.
  1028. X
  1029. X             END OF TERMS AND CONDITIONS
  1030. X
  1031. X    Appendix: How to Apply These Terms to Your New Programs
  1032. X
  1033. X  If you develop a new program, and you want it to be of the greatest
  1034. Xpossible use to humanity, the best way to achieve this is to make it
  1035. Xfree software which everyone can redistribute and change under these
  1036. Xterms.
  1037. X
  1038. X  To do so, attach the following notices to the program.  It is safest to
  1039. Xattach them to the start of each source file to most effectively convey
  1040. Xthe exclusion of warranty; and each file should have at least the
  1041. X"copyright" line and a pointer to where the full notice is found.
  1042. X
  1043. X    <one line to give the program's name and a brief idea of what it does.>
  1044. X    Copyright (C) 19yy  <name of author>
  1045. X
  1046. X    This program is free software; you can redistribute it and/or modify
  1047. X    it under the terms of the GNU General Public License as published by
  1048. X    the Free Software Foundation; either version 1, or (at your option)
  1049. X    any later version.
  1050. X
  1051. X    This program is distributed in the hope that it will be useful,
  1052. X    but WITHOUT ANY WARRANTY; without even the implied warranty of
  1053. X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1054. X    GNU General Public License for more details.
  1055. X
  1056. X    You should have received a copy of the GNU General Public License
  1057. X    along with this program; if not, write to the Free Software
  1058. X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1059. X
  1060. XAlso add information on how to contact you by electronic and paper mail.
  1061. X
  1062. XIf the program is interactive, make it output a short notice like this
  1063. Xwhen it starts in an interactive mode:
  1064. X
  1065. X    Gnomovision version 69, Copyright (C) 19xx name of author
  1066. X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  1067. X    This is free software, and you are welcome to redistribute it
  1068. X    under certain conditions; type `show c' for details.
  1069. X
  1070. XThe hypothetical commands `show w' and `show c' should show the
  1071. Xappropriate parts of the General Public License.  Of course, the
  1072. Xcommands you use may be called something other than `show w' and `show
  1073. Xc'; they could even be mouse-clicks or menu items--whatever suits your
  1074. Xprogram.
  1075. X
  1076. XYou should also get your employer (if you work as a programmer) or your
  1077. Xschool, if any, to sign a "copyright disclaimer" for the program, if
  1078. Xnecessary.  Here a sample; alter the names:
  1079. X
  1080. X  Yoyodyne, Inc., hereby disclaims all copyright interest in the
  1081. X  program `Gnomovision' (a program to direct compilers to make passes
  1082. X  at assemblers) written by James Hacker.
  1083. X
  1084. X  <signature of Ty Coon>, 1 April 1989
  1085. X  Ty Coon, President of Vice
  1086. X
  1087. XThat's all there is to it!
  1088. END_OF_FILE
  1089.   if test 12487 -ne `wc -c <'lout/gnu.gpl'`; then
  1090.     echo shar: \"'lout/gnu.gpl'\" unpacked with wrong size!
  1091.   fi
  1092.   # end of 'lout/gnu.gpl'
  1093. fi
  1094. if test -f 'lout/z09.c' -a "${1}" != "-c" ; then 
  1095.   echo shar: Will not clobber existing file \"'lout/z09.c'\"
  1096. else
  1097.   echo shar: Extracting \"'lout/z09.c'\" \(14080 characters\)
  1098.   sed "s/^X//" >'lout/z09.c' <<'END_OF_FILE'
  1099. X/*@z09.c:Closure Expansion:ClosureExpand()@***********************************/
  1100. X/*                                                                           */
  1101. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.03)       */
  1102. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  1103. X/*                                                                           */
  1104. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  1105. X/*  Basser Department of Computer Science                                    */
  1106. X/*  The University of Sydney 2006                                            */
  1107. X/*  AUSTRALIA                                                                */
  1108. X/*                                                                           */
  1109. X/*  This program is free software; you can redistribute it and/or modify     */
  1110. X/*  it under the terms of the GNU General Public License as published by     */
  1111. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  1112. X/*  any later version.                                                       */
  1113. X/*                                                                           */
  1114. X/*  This program is distributed in the hope that it will be useful,          */
  1115. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  1116. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  1117. X/*  GNU General Public License for more details.                             */
  1118. X/*                                                                           */
  1119. X/*  You should have received a copy of the GNU General Public License        */
  1120. X/*  along with this program; if not, write to the Free Software              */
  1121. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  1122. X/*                                                                           */
  1123. X/*  FILE:         z09.c                                                      */
  1124. X/*  MODULE:       Closure Expansion                                          */
  1125. X/*  EXTERNS:      SetEnv(), AttachEnv(), GetEnv(), SearchEnv(),              */
  1126. X/*                ClosureExpand()                                            */
  1127. X/*                                                                           */
  1128. X/*****************************************************************************/
  1129. X#include "externs"
  1130. X
  1131. X
  1132. X/*****************************************************************************/
  1133. X/*                                                                           */
  1134. X/*  OBJECT SearchEnv(env, sym)                                               */
  1135. X/*                                                                           */
  1136. X/*  Search environment env for a symbol such that actual() == sym.           */
  1137. X/*                                                                           */
  1138. X/*****************************************************************************/
  1139. X
  1140. XOBJECT SearchEnv(env, sym)
  1141. XOBJECT env, sym;
  1142. X{ OBJECT link, y;
  1143. X  debug2(DCE, DD, "SearchEnv(%s, %s)", EchoObject(null, env), SymName(sym));
  1144. X  for(;;)
  1145. X  {
  1146. X    debug1(DCE, DDD, "  searching env %s", EchoObject(null, env));
  1147. X    assert( env != nil && type(env) == ENV, "SearchEnv: env!" );
  1148. X    if( Down(env) == env )
  1149. X    { debug0(DCE, DD, "SearchEnv returning <nil>");
  1150. X      return nil;
  1151. X    }
  1152. X    Child(y, Down(env));
  1153. X    assert( type(y) == CLOSURE, "SearchEnv: type(y) != CLOSURE!" );
  1154. X    if( actual(y) == sym )
  1155. X    { debug1(DCE, DD, "SearchEnv returning %s", EchoObject(null, y));
  1156. X      return y;
  1157. X    }
  1158. X    assert( LastDown(y) != y, "SearchEnv: LastDown(y) == y!" );
  1159. X    link = LastDown(env) != Down(env) ? LastDown(env) : LastDown(y);
  1160. X    Child(env, link);
  1161. X  }
  1162. X} /* end SearchEnv */
  1163. X
  1164. X
  1165. X/*@@**************************************************************************/
  1166. X/*                                                                           */
  1167. X/*  static OBJECT EvalNext(x, env)                                           */
  1168. X/*                                                                           */
  1169. X/*  Evaluate x, which is a @Next something object, in environment env.       */
  1170. X/*                                                                           */
  1171. X/*****************************************************************************/
  1172. X
  1173. Xstatic OBJECT EvalNext(x, env)
  1174. XOBJECT x, env;
  1175. X{ OBJECT y, prnt, link, par, py;
  1176. X  BOOLEAN done;
  1177. X  assert( type(x) == NEXT, "EvalNext: x is not NEXT!" );
  1178. X  assert( Down(x) != x, "EvalNext: x has no child!" );
  1179. X  assert( env == nil || type(env) == ENV, "EvalNext: env!" );
  1180. X  debug2(DCE,DD, "EvalNext(%s, %s)", EchoObject(null,x), EchoObject(null,env));
  1181. X  Child(y, Down(x));
  1182. X
  1183. X  /* if argument of @Next can be evaluated, do so */
  1184. X  if( type(y) == NEXT )  y = EvalNext(y, env);
  1185. X  else if( type(y) == CLOSURE && is_par(type(actual(y))) )
  1186. X  { prnt = SearchEnv(env, enclosing(actual(y)));
  1187. X    if( prnt == nil )
  1188. X    { Error(WARN,&fpos(y),"environment missing when evaluating %s", KW_NEXT);
  1189. X    }
  1190. X    else
  1191. X    { assert( prnt != nil, "EvalNext: prnt == nil!" );
  1192. X      for( link = Down(prnt);  link != prnt;  link = NextDown(link) )
  1193. X      {    Child(par, link);
  1194. X    if( type(par) == PAR && actual(par) == actual(y) )
  1195. X    { assert( Down(par) != par, "AttachEnv: par!" );
  1196. X      Child(py, Down(par));
  1197. X      if( type(py) == WORD )
  1198. X      { y = CopyObject(py, &fpos(py));
  1199. X        DisposeChild(Down(x));
  1200. X        Link(x, y);
  1201. X      }
  1202. X      break;
  1203. X    }
  1204. X      }
  1205. X    }
  1206. X  }
  1207. X
  1208. X  /* if argument of @Next is a WORD, increment it */
  1209. X  if( type(y) == WORD )
  1210. X  { done = FALSE;
  1211. X    y = Next(y, 1, &done);
  1212. X    ReplaceNode(y, x);
  1213. X    DisposeObject(x);
  1214. X    x = y;
  1215. X  }
  1216. X
  1217. X  debug1(DCE, DD, "EvalNext returning %s", EchoObject(null, x));
  1218. X  return x;
  1219. X} /* end EvalNext */
  1220. X
  1221. X
  1222. X/*****************************************************************************/
  1223. X/*                                                                           */
  1224. X/*  OBJECT SetEnv(x, y)                                                      */
  1225. X/*                                                                           */
  1226. X/*  Create a new environment containing x and possibly y.                    */
  1227. X/*                                                                           */
  1228. X/*****************************************************************************/
  1229. X
  1230. XOBJECT SetEnv(x, y)
  1231. XOBJECT x, y;
  1232. X{ OBJECT res;
  1233. X  debug2(DCE, D, "SetEnv( %s, %s )", EchoObject(null, x), EchoObject(null, y));
  1234. X  assert( x != nil && type(x) == CLOSURE, "SetEnv: x == nil or not CLOSURE!" );
  1235. X  assert( y == nil || type(y) == ENV, "SetEnv: y != nil && type(y) != ENV!" );
  1236. X  res = New(ENV);
  1237. X  Link(res, x);
  1238. X  if( y != nil )  Link(res, y);
  1239. X  debug1(DCE, D, "SetEnv returning %s", EchoObject(null, res));
  1240. X  return res;
  1241. X} /* end SetEnv */
  1242. X
  1243. X
  1244. X/*@@**************************************************************************/
  1245. X/*                                                                           */
  1246. X/*  AttachEnv(env, x)                                                        */
  1247. X/*                                                                           */
  1248. X/*  Attach environment env to CLOSURE x.                                     */
  1249. X/*                                                                           */
  1250. X/*****************************************************************************/
  1251. X
  1252. XAttachEnv(env, x)
  1253. XOBJECT env, x;
  1254. X{ debug2(DCE,D,"AttachEnv( %s, %s )", EchoObject(null,env), EchoObject(null,x));
  1255. X  assert( env != nil && type(env) == ENV, "AttachEnv: type(env) != ENV!" );
  1256. X  assert( type(x) == CLOSURE, "AttachEnv: type(x) != CLOSURE!" );
  1257. X  Link(x, env);
  1258. X  debug0(DCE, D, "AttachEnv returning.");
  1259. X} /* end AttachEnv */
  1260. X
  1261. X
  1262. X/*****************************************************************************/
  1263. X/*                                                                           */
  1264. X/*  OBJECT GetEnv(x)                                                         */
  1265. X/*                                                                           */
  1266. X/*  Get from CLOSURE x the environment previously attached.                  */
  1267. X/*                                                                           */
  1268. X/*****************************************************************************/
  1269. X
  1270. XOBJECT GetEnv(x)
  1271. XOBJECT x;
  1272. X{ OBJECT env;
  1273. X  debug1(DCE, DD, "GetEnv( %s )", EchoObject(null, x));
  1274. X  assert( type(x) == CLOSURE, "GetEnv: type(x) != CLOSURE!" );
  1275. X  assert( LastDown(x) != x, "GetEnv: LastDown(x) == x!" );
  1276. X  Child(env, LastDown(x));
  1277. X  assert( type(env) == ENV, "GetEnv: type(env) != ENV!" );
  1278. X  debug1(DCE, DD, "GetEnv resturning %s", EchoObject(null, env));
  1279. X  return env;
  1280. X} /* end GetEnv */
  1281. X
  1282. X
  1283. X/*****************************************************************************/
  1284. X/*                                                                           */
  1285. X/*  OBJECT DetachEnv(x)                                                      */
  1286. X/*                                                                           */
  1287. X/*  Detach from CLOSURE x the environment previously attached.               */
  1288. X/*                                                                           */
  1289. X/*****************************************************************************/
  1290. X
  1291. XOBJECT DetachEnv(x)
  1292. XOBJECT x;
  1293. X{ OBJECT env;
  1294. X  debug1(DCE, DD, "DetachEnv( %s )", EchoObject(null, x));
  1295. X  assert( type(x) == CLOSURE, "DetachEnv: type(x) != CLOSURE!" );
  1296. X  assert( LastDown(x) != x, "DetachEnv: LastDown(x) == x!" );
  1297. X  Child(env, LastDown(x));
  1298. X  DeleteLink(LastDown(x));
  1299. X  assert( type(env) == ENV, "DetachEnv: type(env) != ENV!" );
  1300. X  debug1(DCE, DD, "DetachEnv resturning %s", EchoObject(null, env));
  1301. X  return env;
  1302. X} /* end DetachEnv */
  1303. X
  1304. X
  1305. X/*@@**************************************************************************/
  1306. X/*                                                                           */
  1307. X/*  OBJECT ClosureExpand(x, env, style, crs_wanted, crs, res_env)            */
  1308. X/*                                                                           */
  1309. X/*  Return expansion of closure x in environment env and style style.        */
  1310. X/*  The body comes from x's environment if x is a parameter, else from the   */
  1311. X/*  symbol table.  The original x is pushed into the environments.           */
  1312. X/*                                                                           */
  1313. X/*  If crs_wanted and x has a tag, a cross-reference is added to crs.        */
  1314. X/*                                                                           */
  1315. X/*****************************************************************************/
  1316. X
  1317. XOBJECT ClosureExpand(x, env, style, crs_wanted, crs, res_env)
  1318. XOBJECT x, env;  STYLE *style;  BOOLEAN crs_wanted;  OBJECT *crs, *res_env;
  1319. X{ OBJECT link, y, res, prnt_env, par, prnt, ppar;
  1320. X  debug3(DCE, D, "ClosureExpand( %s, crs, %s, %s, res_env )",
  1321. X        EchoObject(null, x), bool(crs_wanted), EchoObject(null, env));
  1322. X  assert( type(x) == CLOSURE, "ClosureExpand given non-CLOSURE!");
  1323. X  assert( predefined(actual(x)) == FALSE, "ClosureExpand given predefined!" );
  1324. X
  1325. X  /* add a tag to x if needed but none provided */
  1326. X  if( has_tag(actual(x)) )
  1327. X  { for( link = Down(x);  link != x;  link = NextDown(link) )
  1328. X    { Child(par, link);
  1329. X      if( type(par) == PAR && is_tag(actual(par)) )  break;
  1330. X    }
  1331. X    if( link == x )
  1332. X    { ppar = nil;
  1333. X      for( link=Down(actual(x));  link != actual(x);  link = NextDown(link) )
  1334. X      {    Child(y, link);
  1335. X    if( is_par(type(y)) && is_tag(y) )
  1336. X    { ppar = y;
  1337. X      break;
  1338. X    }
  1339. X      }
  1340. X      if( ppar != nil )
  1341. X      {
  1342. X    /* prepare new PAR containing generated tag */
  1343. X    par = New(PAR);
  1344. X    actual(par) = ppar;
  1345. X    y = CrossGenTag(x);
  1346. X    Link(par, y);
  1347. X
  1348. X    /* find the right spot, then link it to x */
  1349. X    switch( type(ppar) )
  1350. X    {
  1351. X      case LPAR:    link = Down(x);
  1352. X            break;
  1353. X
  1354. X      case NPAR:    link = Down(x);
  1355. X            if( Down(x) != x )
  1356. X            { Child(y, Down(x));
  1357. X              if( type(y) == PAR && type(actual(par)) == LPAR )
  1358. X                link = NextDown(link);
  1359. X            }
  1360. X            break;
  1361. X
  1362. X      case RPAR:    for( link = Down(x); link != x; link = NextDown(link) )
  1363. X            { Child(y, link);
  1364. X              if( type(y) != PAR )  break;
  1365. X            }
  1366. X            break;
  1367. X    }
  1368. X    Link(link, par);
  1369. X      }
  1370. X    }
  1371. X  }
  1372. X
  1373. X  /* add cross-reference to crs if needed */
  1374. X  if( crs_wanted && has_tag(actual(x)) )
  1375. X  { OBJECT tmp;
  1376. X    tmp = CopyObject(x, no_fpos);  AttachEnv(env, tmp);
  1377. X    y = CrossMake(actual(x), tmp, CROSS_TARG);
  1378. X    tmp = New(CROSS_TARG);
  1379. X    actual(tmp) = y;
  1380. X    Link(tmp, y);
  1381. X    if( *crs == nil )  *crs = New(CR_LIST);
  1382. X    Link(*crs, tmp);
  1383. X  }
  1384. X
  1385. X
  1386. X  /* case x is a parameter */
  1387. X  res = *res_env = nil;
  1388. X  if( is_par(type(actual(x))) )
  1389. X  {
  1390. X    prnt = SearchEnv(env, enclosing(actual(x)));
  1391. X    if( prnt == nil )
  1392. X      Error(FATAL, &fpos(x), "symbol with import list used illegally");
  1393. X    assert( prnt != nil, "ClosureExpand: is_par but prnt == nil!" );
  1394. X    prnt_env = GetEnv(prnt);
  1395. X    for( link = Down(prnt);  link != prnt;  link = NextDown(link) )
  1396. X    { Child(par, link);
  1397. X      if( type(par) == PAR && actual(par) == actual(x) )
  1398. X      {    assert( Down(par) != par, "ExpandCLosure: Down(par)!");
  1399. X    Child(res, Down(par));
  1400. X    if( dirty(enclosing(actual(par))) )
  1401. X    { debug2(DSU, DD, "  copying %s %s",
  1402. X        SymName(actual(par)), EchoObject(null, res));
  1403. X      res = CopyObject(res, no_fpos);
  1404. X    }
  1405. X    else
  1406. X    { debug2(DSU, DD, "  linking %s %s",
  1407. X        SymName(actual(par)), EchoObject(null, res));
  1408. X      DeleteLink(Down(par));
  1409. X      y = MakeWord("??", &fpos(res));
  1410. X      Link(par, y);
  1411. X    }
  1412. X    ReplaceNode(res, x);
  1413. X    if( type(actual(x)) == RPAR && has_body(enclosing(actual(x))) )
  1414. X    { *res_env = SetEnv(prnt, nil);
  1415. X      DisposeObject(x);
  1416. X    }
  1417. X    else
  1418. X    { AttachEnv(env, x);
  1419. X      *res_env = SetEnv(x, prnt_env);
  1420. X    }
  1421. X    break;
  1422. X      }
  1423. X    }
  1424. X  }
  1425. X
  1426. X  /* case x is a user-defined symbol or default parameter */
  1427. X  if( res == nil )
  1428. X  { if( sym_body(actual(x)) == nil )  res = MakeWord("??", &fpos(x));
  1429. X    else res = CopyObject(sym_body(actual(x)), &fpos(x));
  1430. X    ReplaceNode(res, x);
  1431. X    AttachEnv(env, x);
  1432. X    *res_env = SetEnv(x, nil);
  1433. X  }
  1434. X
  1435. X  assert( *res_env != nil && type(*res_env) == ENV, "ClosureExpand: *res_env!");
  1436. X  debug0(DCE, D, "ClosureExpand returning, res =");
  1437. X  ifdebug(DCE, D, EchoObject(stderr, res));
  1438. X  debug1(DCE, DD, "  environment = %s", EchoObject(null, *res_env));
  1439. X  return res;
  1440. X} /* end ClosureExpand */
  1441. END_OF_FILE
  1442.   if test 14080 -ne `wc -c <'lout/z09.c'`; then
  1443.     echo shar: \"'lout/z09.c'\" unpacked with wrong size!
  1444.   fi
  1445.   # end of 'lout/z09.c'
  1446. fi
  1447. if test -f 'lout/z21.c' -a "${1}" != "-c" ; then 
  1448.   echo shar: Will not clobber existing file \"'lout/z21.c'\"
  1449. else
  1450.   echo shar: Extracting \"'lout/z21.c'\" \(10867 characters\)
  1451.   sed "s/^X//" >'lout/z21.c' <<'END_OF_FILE'
  1452. X/*@z21.c:Galley Maker:SizeGalley()@*******************************************/
  1453. X/*                                                                           */
  1454. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.03)       */
  1455. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  1456. X/*                                                                           */
  1457. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  1458. X/*  Basser Department of Computer Science                                    */
  1459. X/*  The University of Sydney 2006                                            */
  1460. X/*  AUSTRALIA                                                                */
  1461. X/*                                                                           */
  1462. X/*  This program is free software; you can redistribute it and/or modify     */
  1463. X/*  it under the terms of the GNU General Public License as published by     */
  1464. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  1465. X/*  any later version.                                                       */
  1466. X/*                                                                           */
  1467. X/*  This program is distributed in the hope that it will be useful,          */
  1468. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  1469. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  1470. X/*  GNU General Public License for more details.                             */
  1471. X/*                                                                           */
  1472. X/*  You should have received a copy of the GNU General Public License        */
  1473. X/*  along with this program; if not, write to the Free Software              */
  1474. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  1475. X/*                                                                           */
  1476. X/*  FILE:         z21.c                                                      */
  1477. X/*  MODULE:       Galley Maker                                               */
  1478. X/*  EXTERNS:      SizeGalley()                                               */
  1479. X/*                                                                           */
  1480. X/*****************************************************************************/
  1481. X#include "externs"
  1482. X
  1483. X
  1484. X/*****************************************************************************/
  1485. X/*                                                                           */
  1486. X/*  SizeGalley(hd, env, rows, joined, nonblock, trig, style, c, target,      */
  1487. X/*                                                dest_index, recs, inners)  */
  1488. X/*                                                                           */
  1489. X/*  Convert unsized galley hd into sized format.  The input parameters are:  */
  1490. X/*                                                                           */
  1491. X/*    hd          the galley to be converted                                 */
  1492. X/*    env         its environment                                            */
  1493. X/*    rows        TRUE if the resulting galley may have more than one row    */
  1494. X/*    joined      TRUE if the resulting galley must be simply joined         */
  1495. X/*    nonblock    Set the non_blocking() field of RECEPTIVEs to this value   */
  1496. X/*    trig        TRUE if galley's indefinites may trigger external galleys  */
  1497. X/*    *style      The initial style                                          */
  1498. X/*    *c          the width constraint hd should conform to                  */
  1499. X/*    target      if non-nil, expand indefinite objects to reveal a          */
  1500. X/*                @Galley within this symbol                                 */
  1501. X/*                                                                           */
  1502. X/*  The output parameters, in addition to the converted hd, are:             */
  1503. X/*                                                                           */
  1504. X/*    dest_index  the index of the @Galley found within target, if any       */
  1505. X/*    recs        list of all RECURSIVE indexes found (or nil if none)       */
  1506. X/*    inners      list of all UNATTACHED indexes found (or nil if none)      */
  1507. X/*                                                                           */
  1508. X/*****************************************************************************/
  1509. X
  1510. XSizeGalley(hd, env, rows, joined, nonblock, trig, style, c, target,
  1511. X                        dest_index, recs, inners)
  1512. XOBJECT hd, env;  BOOLEAN rows, joined, nonblock, trig;  STYLE *style;
  1513. XCONSTRAINT *c;  OBJECT target, *dest_index, *recs, *inners;
  1514. X{ OBJECT y, link, z, crs, t, tlink, zlink, tmp;
  1515. X  OBJECT extras, tmp1, tmp2, bt[2], ft[2];
  1516. X  
  1517. X  assert( type(hd) == HEAD && Down(hd) != hd, "SizeGalley: precondition!" );
  1518. X  assert( !sized(hd), "SizeGalley: already sized!" );
  1519. X  debug6(DGM, D, "SizeGalley(hd, -, %s, %s, %s, %s, %s, %s, -, -, -), hd =",
  1520. X    bool(joined), bool(nonblock), bool(trig), EchoStyle(style),
  1521. X    EchoConstraint(c), SymName(target));
  1522. X  ifdebug(DGM, DD, EchoObject(stderr, hd));
  1523. X
  1524. X  /* manifest hd's child, making sure it is simply joined if required */
  1525. X  tmp1 = target;
  1526. X  Child(y, Down(hd));
  1527. X  crs = nil;
  1528. X  bt[COL] = ft[COL] = bt[ROW] = ft[ROW] = nil;
  1529. X  if( joined )
  1530. X  { bt[COL] = New(THREAD);  ft[COL] = New(THREAD);
  1531. X    y = Manifest(y, env, style, bt, ft, &tmp1, &crs, TRUE, must_expand(hd));
  1532. X    assert( Down(bt[COL]) != bt[COL] && Down(ft[COL]) != ft[COL],
  1533. X    "SizeGalley: threads!" );
  1534. X    Child(tmp1, Down(bt[COL]));  Child(tmp2, Down(ft[COL]));
  1535. X    if( Down(bt[COL]) != LastDown(bt[COL]) ||
  1536. X      Down(ft[COL]) != LastDown(ft[COL]) || tmp1 != tmp2 )
  1537. X      Error(FATAL, &fpos(y), "galley %s must have just one column mark",
  1538. X                        SymName(actual(hd)) );
  1539. X    DisposeObject(bt[COL]);  DisposeObject(ft[COL]);
  1540. X  }
  1541. X  else y = Manifest(y, env, style, bt, ft, &tmp1, &crs, TRUE, must_expand(hd));
  1542. X
  1543. X  /* horizontally size and break hd */
  1544. X  debug0(DGM, DD, "SizeGalley: after manifesting, hd =");
  1545. X  ifdebug(DGM, DD, EchoObject(stderr, hd));
  1546. X  debug0(DGM, DD, "SizeGalley horizontally sizing and breaking hd:");
  1547. X  CopyConstraint(constraint(hd), *c);
  1548. X  y = MinSize(y, COL, &extras);
  1549. X  debug0(DOB, DD, "  calling BreakObject from SizeGalley");
  1550. X  y = BreakObject(y, c);
  1551. X  back(hd, COL) = back(y, COL);
  1552. X  fwd(hd, COL)  = fwd(y, COL);
  1553. X  assert( FitsConstraint(back(hd, COL), fwd(hd, COL), *c),
  1554. X    "SizeGalley: BreakObject failed to fit!" );
  1555. X  debug2(DSF, D, "MinSize(hd, COL) = %s,%s",
  1556. X      EchoLength(back(hd, COL)), EchoLength(fwd(hd, COL)) );
  1557. X
  1558. X  /* get the rows of hd to the top level, if required */
  1559. X  seen_nojoin(hd) = FALSE;
  1560. X  if( rows )
  1561. X  { /* OBJECT prev_gap = nil; */
  1562. X    debug0(DGM, DD, "SizeGalley cleaning up rows of hd:");
  1563. X    for( link = hd;  NextDown(link) != hd;  link = NextDown(link) )
  1564. X    { Child(y, NextDown(link));
  1565. X      debug2(DGM,DD,"  cleaning %s: %s", Image(type(y)), EchoObject(null,y));
  1566. X      switch( type(y) )
  1567. X      {
  1568. X    case GAP_OBJ:
  1569. X
  1570. X      /* prev_gap = y; */
  1571. X      if( !join(gap(y)) )  seen_nojoin(hd) = TRUE;
  1572. X      break;
  1573. X
  1574. X
  1575. X    case VCAT:
  1576. X      
  1577. X      TransferLinks(Down(y), y, Up(y));
  1578. X      DisposeChild(Up(y));
  1579. X      link = PrevDown(link);
  1580. X      break;
  1581. X
  1582. X
  1583. X    case SPLIT:
  1584. X      
  1585. X      assert(Up(y)==LastUp(y), "SizeGalley COL_THR: Up(y)!=LastUp(y)!");
  1586. X      Child(z, DownDim(y, ROW));
  1587. X      if( is_indefinite(type(z)) )  external(z) = TRUE;
  1588. X      else if( type(z) == VCAT )
  1589. X      { OBJECT hor, thor, clink, dlink;
  1590. X        Child(hor, DownDim(y, COL));
  1591. X        assert( type(hor) == COL_THR, "SizeGalley: missing COL_THR!" );
  1592. X        Parent(thor, UpDim(z, COL));
  1593. X        assert( hor == thor, "SizeGalley/SPLIT: hor != thor!" );
  1594. X        clink = DownDim(y, COL);
  1595. X        dlink = UpDim(z, COL);
  1596. X        for( tlink = LastDown(z);  tlink != z;  tlink = PrevDown(tlink) )
  1597. X        { Child(t, tlink);
  1598. X          if( type(t) == GAP_OBJ )  Link(NextDown(link), t);
  1599. X          else
  1600. X          {    tmp = New(SPLIT);
  1601. X        back(tmp, COL) = back(hor, COL);
  1602. X        fwd(tmp, COL) = fwd(hor, COL);
  1603. X        Link(NextDown(link), tmp);
  1604. X        Link(tmp, NextUp(clink));
  1605. X        Link(NextDown(dlink), t);
  1606. X        Link(tmp, t);
  1607. X          }
  1608. X        }
  1609. X        DeleteLink(dlink);
  1610. X        assert(Up(y)==LastUp(y), "SizeGalley COL_THR: Up(y) != LastUp(y)!");
  1611. X        DisposeChild(Up(y));
  1612. X        link = PrevDown(link);
  1613. X      }
  1614. X      break;
  1615. X
  1616. X
  1617. X    case CLOSURE:
  1618. X    case HEAD:
  1619. X      
  1620. X      external(y) = TRUE;
  1621. X      break;
  1622. X
  1623. X
  1624. X    default:
  1625. X      
  1626. X      break;
  1627. X      }
  1628. X    }
  1629. X  }
  1630. X
  1631. X  /* size the rows of hd and attach indices where needed */
  1632. X  debug0(DGM, DD, "SizeGalley sizing rows of hd =");
  1633. X  ifdebug(DGM, DD, EchoObject(stderr, hd));
  1634. X  *recs = *inners = *dest_index = nil;
  1635. X  for( link = Down(hd);  link != hd;  link = NextDown(link) )
  1636. X  { Child(y, link);
  1637. X    if( type(y) == GAP_OBJ || is_index(type(y)) )  continue;
  1638. X    debug0(DGM, DDD, "  ROW sizing:");
  1639. X    ifdebug(DGM, DDD, EchoObject(stderr, y));
  1640. X    extras = New(ACAT);
  1641. X    y = MinSize(y, ROW, &extras);
  1642. X    debug3(DSF, D, "MinSize( %s , ROW ) = %s,%s", EchoObject(null, y),
  1643. X      EchoLength(back(y, ROW)), EchoLength(fwd(y, ROW)) );
  1644. X    debug0(DGM, DDD, "  ROW result:");
  1645. X    ifdebug(DGM, DDD, EchoObject(stderr, y));
  1646. X
  1647. X    /* now attach indexes in front of y */
  1648. X    for( zlink = Down(extras);  zlink != extras;  zlink = NextDown(zlink) )
  1649. X    { Child(z, zlink);
  1650. X      blocked(z) = FALSE;
  1651. X      /* debug1(DCR, D, "  extra: %s", EchoObject(null, z)); */
  1652. X      debug1(DGM, DD, "  extra: %s", EchoObject(null, z));
  1653. X      switch( type(z) )
  1654. X      {
  1655. X    case RECEPTIVE:
  1656. X
  1657. X      /* debug2(DCR, D, "  ... uses_ext  = %s, trig = %s",
  1658. X        bool(uses_extern_target(actual(actual(z)))), bool(trig)); */
  1659. X      trigger_externs(z) = uses_extern_target(actual(actual(z))) && trig;
  1660. X      non_blocking(z)    = nonblock;
  1661. X      if( actual(actual(z)) == GalleySym )  *dest_index = z;
  1662. X      break;
  1663. X
  1664. X
  1665. X    case RECURSIVE:
  1666. X
  1667. X      if( *recs == nil )  *recs = New(ACAT);
  1668. X      Link(*recs, z);
  1669. X      break;
  1670. X
  1671. X
  1672. X    case UNATTACHED:
  1673. X
  1674. X      if( *inners == nil )  *inners = New(ACAT);
  1675. X      Link(*inners, z);
  1676. X      break;
  1677. X
  1678. X        
  1679. X    case EXPAND_IND:
  1680. X    case GALL_PREC:
  1681. X    case GALL_FOLL:
  1682. X    case GALL_TARG:
  1683. X    case CROSS_PREC:
  1684. X    case CROSS_FOLL:
  1685. X    case CROSS_TARG:
  1686. X
  1687. X      debug1(DCR, DD, "  SizeGalley: %s", EchoObject(null, z));
  1688. X      break;
  1689. X
  1690. X
  1691. X    default:
  1692. X      
  1693. X      Error(INTERN, no_fpos, "SizeGalley: %s", Image(type(z)) );
  1694. X      break;
  1695. X
  1696. X      }
  1697. X    }
  1698. X    TransferLinks(Down(extras), extras, link);
  1699. X    assert( Down(extras) == extras && Up(extras) == extras, "SizeG: extras!");
  1700. X    Dispose(extras);
  1701. X  }
  1702. X  
  1703. X  /* insinuate cross references */
  1704. X  if( crs != nil )
  1705. X  { 
  1706. X    debug1(DCR, D, "SizeGalley insinuating %s", crs);
  1707. X    TransferLinks(Down(crs), crs, Down(hd));
  1708. X    DisposeObject(crs);
  1709. X  }
  1710. X
  1711. X  /* check that *dest_index was found if it was required, and exit */
  1712. X  if( target != nil && *dest_index == nil )
  1713. X    Error(FATAL, &fpos(hd), "Unexpected absence of %s from the body of %s",
  1714. X      SymName(target), SymName(actual(hd)));
  1715. X  debug3(DGM, D, "SizeGalley returning %s,%s  %s;  hd =",
  1716. X    EchoLength(back(hd, COL)), EchoLength(fwd(hd, COL)),
  1717. X    EchoConstraint(&constraint(hd)));
  1718. X  ifdebug(DGM, DD, EchoObject(stderr, hd));
  1719. X  sized(hd) = TRUE;
  1720. X
  1721. X} /* end SizeGalley */
  1722. END_OF_FILE
  1723.   if test 10867 -ne `wc -c <'lout/z21.c'`; then
  1724.     echo shar: \"'lout/z21.c'\" unpacked with wrong size!
  1725.   fi
  1726.   # end of 'lout/z21.c'
  1727. fi
  1728. if test -f 'lout/z26.c' -a "${1}" != "-c" ; then 
  1729.   echo shar: Will not clobber existing file \"'lout/z26.c'\"
  1730. else
  1731.   echo shar: Extracting \"'lout/z26.c'\" \(12088 characters\)
  1732.   sed "s/^X//" >'lout/z26.c' <<'END_OF_FILE'
  1733. X/*@z26.c:Echo Service:BeginString(), AppendString(), EndString(), Image()@****/
  1734. X/*                                                                           */
  1735. X/*  LOUT: A HIGH-LEVEL LANGUAGE FOR DOCUMENT FORMATTING (VERSION 2.03)       */
  1736. X/*  COPYRIGHT (C) 1993 Jeffrey H. Kingston                                   */
  1737. X/*                                                                           */
  1738. X/*  Jeffrey H. Kingston (jeff@cs.su.oz.au)                                   */
  1739. X/*  Basser Department of Computer Science                                    */
  1740. X/*  The University of Sydney 2006                                            */
  1741. X/*  AUSTRALIA                                                                */
  1742. X/*                                                                           */
  1743. X/*  This program is free software; you can redistribute it and/or modify     */
  1744. X/*  it under the terms of the GNU General Public License as published by     */
  1745. X/*  the Free Software Foundation; either version 1, or (at your option)      */
  1746. X/*  any later version.                                                       */
  1747. X/*                                                                           */
  1748. X/*  This program is distributed in the hope that it will be useful,          */
  1749. X/*  but WITHOUT ANY WARRANTY; without even the implied warranty of           */
  1750. X/*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            */
  1751. X/*  GNU General Public License for more details.                             */
  1752. X/*                                                                           */
  1753. X/*  You should have received a copy of the GNU General Public License        */
  1754. X/*  along with this program; if not, write to the Free Software              */
  1755. X/*  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                */
  1756. X/*                                                                           */
  1757. X/*  FILE:         z26.c                                                      */
  1758. X/*  MODULE:       Echo Service                                               */
  1759. X/*  EXTERNS:      BeginString(), AppendString(), EndString(), Image()        */
  1760. X/*                                                                           */
  1761. X/*****************************************************************************/
  1762. X#include "externs"
  1763. X
  1764. X#if DEBUG_ON
  1765. X#define    MULTI      7            /* max no of simultaneous calls      */
  1766. X
  1767. Xstatic    unsigned char buff[MULTI][MAX_LINE];    /* buffers for strings       */
  1768. Xstatic    int    curr = 1;        /* current buffer in use             */
  1769. Xstatic    int    bp;            /* next free space in buff[curr]     */
  1770. Xstatic    BOOLEAN    instring = FALSE;    /* TRUE while making a string        */
  1771. X
  1772. X
  1773. X/*****************************************************************************/
  1774. X/*                                                                           */
  1775. X/*  BeginString()                                                            */
  1776. X/*                                                                           */
  1777. X/*  Locate a clear buffer into which debug output may be accumulated.        */
  1778. X/*                                                                           */
  1779. X/*****************************************************************************/
  1780. X
  1781. XBeginString()
  1782. X{ if( instring ) Error(INTERN, no_fpos, "BeginString: currently in string!");
  1783. X  instring = TRUE;  curr = (curr + 1) % MULTI;
  1784. X  assert( 0 <= curr && curr < MULTI, "BeginString: curr!" );
  1785. X  strcpy(buff[curr], "");  bp = 0;
  1786. X}
  1787. X
  1788. X
  1789. X/*****************************************************************************/
  1790. X/*                                                                           */
  1791. X/*  AppendString(str, p1, p2, p3, p4, p5, p6)                                */
  1792. X/*                                                                           */
  1793. X/*  Sprintf str to the current buffer, if space is available there.          */
  1794. X/*                                                                           */
  1795. X/*****************************************************************************/
  1796. X
  1797. X/*VARARGS1*/
  1798. XAppendString(str, p1, p2, p3, p4, p5, p6)
  1799. Xunsigned char *str;  int p1, p2, p3, p4, p5, p6;
  1800. X{ int len;
  1801. X  if( !instring ) Error(INTERN, no_fpos, "AppendString: no current string!");
  1802. X  assert( 0 <= curr && curr < MULTI, "BeginString: curr!" );
  1803. X  if( bp == MAX_LINE ) return;        /* no space, do nothing */
  1804. X
  1805. X  len = strlen(str);
  1806. X  if( len + bp >= MAX_LINE )
  1807. X  { strcpy( &buff[curr][MAX_LINE/2], " ... <too long to print>" );
  1808. X    bp = MAX_LINE;
  1809. X  }
  1810. X  else
  1811. X  { sprintf( &buff[curr][bp], str, p1, p2, p3, p4, p5, p6 );
  1812. X    while( buff[curr][bp] != '\0' )  bp++;
  1813. X    if( bp >= MAX_LINE )  Error(INTERN, no_fpos, "AppendString abort");
  1814. X  }
  1815. X} /* end AppendString */
  1816. X
  1817. X
  1818. X/*****************************************************************************/
  1819. X/*                                                                           */
  1820. X/*  unsigned char *EndString()                                               */
  1821. X/*                                                                           */
  1822. X/*  Return the string constructed by previous AppendString operations.       */
  1823. X/*                                                                           */
  1824. X/*****************************************************************************/
  1825. X
  1826. Xunsigned char *EndString()
  1827. X{ if( !instring ) Error(INTERN, no_fpos, "EndString: no current string!");
  1828. X  assert( 0 <= curr && curr < MULTI, "BeginString: curr!" );
  1829. X  instring = FALSE;
  1830. X  return buff[curr];
  1831. X} /* end Endstring */
  1832. X#endif
  1833. X
  1834. X
  1835. X/*****************************************************************************/
  1836. X/*                                                                           */
  1837. X/*  unsigned char *EchoLength(len)                                           */
  1838. X/*                                                                           */
  1839. X/*  Echo a length.                                                           */
  1840. X/*                                                                           */
  1841. X/*****************************************************************************/
  1842. X
  1843. Xunsigned char *EchoLength(len)
  1844. Xint len;
  1845. X{ static unsigned char buff[6][20];
  1846. X  static int i = 0;
  1847. X  i = (i + 1) % 6;
  1848. X  sprintf(buff[i], "%.3fc", (float) len/CM);
  1849. X  return buff[i];
  1850. X} /* end EchoLength */
  1851. X
  1852. X
  1853. X/*@@**************************************************************************/
  1854. X/*                                                                           */
  1855. X/*  unsigned char *Image(c)                                                  */
  1856. X/*                                                                           */
  1857. X/*  Returns the string value of type c.                                      */
  1858. X/*                                                                           */
  1859. X/*****************************************************************************/
  1860. X
  1861. Xunsigned char *Image(c)
  1862. Xunsigned int c;
  1863. X{ static unsigned char b[20];
  1864. X  switch(c)
  1865. X  {
  1866. X
  1867. X    case LINK:        return (unsigned char *) "link";
  1868. X
  1869. X    case SPLIT:        return (unsigned char *) "split";
  1870. X    case HEAD:        return (unsigned char *) "head";
  1871. X    case PAR:        return (unsigned char *) "par";
  1872. X    case WORD:        return (unsigned char *) "word";
  1873. X    case GAP_OBJ:    return (unsigned char *) "gap_obj";
  1874. X    case ROW_THR:    return (unsigned char *) "row_thr";
  1875. X    case COL_THR:    return (unsigned char *) "col_thr";
  1876. X    case CLOSURE:    return (unsigned char *) "closure";
  1877. X    case NULL_CLOS:    return (unsigned char *) KW_NULL;
  1878. X    case CROSS:        return (unsigned char *) KW_CROSS;
  1879. X    case ONE_COL:    return (unsigned char *) KW_ONE_COL;
  1880. X    case ONE_ROW:    return (unsigned char *) KW_ONE_ROW;
  1881. X    case WIDE:        return (unsigned char *) KW_WIDE;
  1882. X    case HIGH:        return (unsigned char *) KW_HIGH;
  1883. X    case HSCALE:    return (unsigned char *) KW_HSCALE;
  1884. X    case VSCALE:    return (unsigned char *) KW_VSCALE;
  1885. X    case HCONTRACT:    return (unsigned char *) KW_HCONTRACT;
  1886. X    case VCONTRACT:    return (unsigned char *) KW_VCONTRACT;
  1887. X    case HEXPAND:    return (unsigned char *) KW_HEXPAND;
  1888. X    case VEXPAND:    return (unsigned char *) KW_VEXPAND;
  1889. X    case PADJUST:    return (unsigned char *) KW_PADJUST;
  1890. X    case HADJUST:    return (unsigned char *) KW_HADJUST;
  1891. X    case VADJUST:    return (unsigned char *) KW_VADJUST;
  1892. X    case ROTATE:    return (unsigned char *) KW_ROTATE;
  1893. X    case SCALE:        return (unsigned char *) KW_SCALE;
  1894. X    case CASE:        return (unsigned char *) KW_CASE;
  1895. X    case YIELD:        return (unsigned char *) KW_YIELD;
  1896. X    case FONT:        return (unsigned char *) KW_FONT;
  1897. X    case SPACE:        return (unsigned char *) KW_SPACE;
  1898. X    case BREAK:        return (unsigned char *) KW_BREAK;
  1899. X    case NEXT:        return (unsigned char *) KW_NEXT;
  1900. X    case ENV:        return (unsigned char *) KW_ENV;
  1901. X    case CLOS:        return (unsigned char *) KW_CLOS;
  1902. X    case LVIS:        return (unsigned char *) KW_LVIS;
  1903. X    case OPEN:        return (unsigned char *) KW_OPEN;
  1904. X    case TAGGED:    return (unsigned char *) KW_TAGGED;
  1905. X    case INCGRAPHIC:    return (unsigned char *) KW_INCGRAPHIC;
  1906. X    case SINCGRAPHIC:    return (unsigned char *) KW_SINCGRAPHIC;
  1907. X    case GRAPHIC:    return (unsigned char *) KW_GRAPHIC;
  1908. X    case ACAT:        return (unsigned char *) "acat";
  1909. X    case HCAT:        return (unsigned char *) "hcat";
  1910. X    case VCAT:        return (unsigned char *) "vcat";
  1911. X
  1912. X    case TSPACE:    return (unsigned char *) "tspace";
  1913. X    case TJUXTA:    return (unsigned char *) "tjuxta";
  1914. X    case LBR:        return (unsigned char *) "lbr";
  1915. X    case RBR:        return (unsigned char *) "rbr";
  1916. X    case BEGIN:        return (unsigned char *) KW_BEGIN;
  1917. X    case END:        return (unsigned char *) KW_END;
  1918. X    case USE:        return (unsigned char *) KW_USE;
  1919. X    case GSTUB_NONE:    return (unsigned char *) "gstub_none";
  1920. X    case GSTUB_INT:    return (unsigned char *) "gstub_int";
  1921. X    case GSTUB_EXT:    return (unsigned char *) "gstub_ext";
  1922. X    case INCLUDE:    return (unsigned char *) KW_INCLUDE;
  1923. X    case SYS_INCLUDE:    return (unsigned char *) KW_SYSINCLUDE;
  1924. X    case PREPEND:    return (unsigned char *) KW_PREPEND;
  1925. X    case SYS_PREPEND:    return (unsigned char *) KW_SYSPREPEND;
  1926. X    case DATABASE:    return (unsigned char *) KW_DATABASE;
  1927. X    case SYS_DATABASE:    return (unsigned char *) KW_SYSDATABASE;
  1928. X    case START:         return (unsigned char *) "start";
  1929. X
  1930. X    case DEAD:        return (unsigned char *) "dead";
  1931. X    case UNATTACHED:    return (unsigned char *) "unattached";
  1932. X    case RECEPTIVE:    return (unsigned char *) "receptive";
  1933. X    case RECEIVING:    return (unsigned char *) "receiving";
  1934. X    case RECURSIVE:    return (unsigned char *) "recursive";
  1935. X    case PRECEDES:    return (unsigned char *) "precedes";
  1936. X    case FOLLOWS:    return (unsigned char *) "follows";
  1937. X    case CROSS_FOLL:    return (unsigned char *) "cross_foll";
  1938. X    case GALL_FOLL:    return (unsigned char *) "gall_foll";
  1939. X    case CROSS_TARG:    return (unsigned char *) "cross_targ";
  1940. X    case GALL_TARG:    return (unsigned char *) "gall_targ";
  1941. X    case GALL_PREC:    return (unsigned char *) "gall_prec";
  1942. X    case CROSS_PREC:    return (unsigned char *) "cross_prec";
  1943. X    case EXPAND_IND:    return (unsigned char *) "expand_ind";
  1944. X    case THREAD:    return (unsigned char *) "thread";
  1945. X    case CROSS_SYM:    return (unsigned char *) "cross_sym";
  1946. X    case CR_ROOT:    return (unsigned char *) "cr_root";
  1947. X    case MACRO:        return (unsigned char *) KW_MACRO;
  1948. X    case LOCAL:        return (unsigned char *) "local";
  1949. X    case LPAR:        return (unsigned char *) "lpar";
  1950. X    case NPAR:        return (unsigned char *) "npar";
  1951. X    case RPAR:        return (unsigned char *) "rpar";
  1952. X    case CR_LIST:    return (unsigned char *) "cr_list";
  1953. X    case EXT_GALL:    return (unsigned char *) "ext_gall";
  1954. X    case DISPOSED:    return (unsigned char *) "disposed";
  1955. X
  1956. X    case BACK:        return (unsigned char *) "back";
  1957. X    case ON:        return (unsigned char *) "on";
  1958. X    case FWD:        return (unsigned char *) "fwd";
  1959. X
  1960. X    case PROMOTE:    return (unsigned char *) "promote";
  1961. X    case CLOSE:        return (unsigned char *) "close";
  1962. X    case BLOCK:        return (unsigned char *) "block";
  1963. X    case CLEAR:        return (unsigned char *) "clear";
  1964. X
  1965. X    case ABS:        return (unsigned char *) "abs";
  1966. X    case INC:        return (unsigned char *) "inc";
  1967. X    case DEC:        return (unsigned char *) "dec";
  1968. X
  1969. X    default:        sprintf(b, "??(%d)", c);
  1970. X            return b;
  1971. X  } /* end switch */
  1972. X} /* end Image */
  1973. END_OF_FILE
  1974.   if test 12088 -ne `wc -c <'lout/z26.c'`; then
  1975.     echo shar: \"'lout/z26.c'\" unpacked with wrong size!
  1976.   fi
  1977.   # end of 'lout/z26.c'
  1978. fi
  1979. echo shar: End of archive 22 \(of 30\).
  1980. cp /dev/null ark22isdone
  1981. MISSING=""
  1982. for I in 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 ; do
  1983.     if test ! -f ark${I}isdone ; then
  1984.     MISSING="${MISSING} ${I}"
  1985.     fi
  1986. done
  1987. if test "${MISSING}" = "" ; then
  1988.     echo You have unpacked all 30 archives.
  1989.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1990. else
  1991.     echo You still must unpack the following archives:
  1992.     echo "        " ${MISSING}
  1993. fi
  1994. exit 0
  1995. exit 0 # Just in case...
  1996.