home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 426.lha / Leggi / Leggi.doc (.txt) < prev    next >
IFF Formatted Text  |  1990-10-02  |  20KB  |  484 lines

  1.  
  2.  
  3.                                    33mLeggi0m
  4.  
  5.                          A Multi-Font Text Reader
  6.  
  7.                            By Sebastiano Vigna
  8.  
  9.                                  (c) 1990
  10.  
  11.  
  12. You may ask: why should I consider another text reader?
  13.  
  14. There's really no reason, unless you want a multi-window, multi-font,
  15. configurable, flexible, powerful text reader.  If you do 33mLeggi0m may be the
  16. Amiga text reader for which you have been waiting!
  17.  
  18. 33mLeggi0m can read simple IFF FTXT, ANSI and ASCII files, and open an unlimited
  19. number of windows with different fonts and styles.  It auto-configures
  20. itself smartly.  No fixed size window!.  No hard-coded fonts in menus &
  21. text!  ARexx, of course!  Expert options to tuneup the program to suit your
  22. tastes and your system in a config-file.  Freely distributable under
  23. the widest conditions possible.  Pure and residentable.  Fast and easy
  24. to use.
  25.  
  26. Before you ask:  "33mLeggi0m" in Italian means "read", and I am told is
  27. pronounced "leeji" in English.
  28.  
  29. 33mLeggi0m needs ARP to run (not under the future 2.0-OS-only version).  It
  30. likes req.library, too, but it's not necessary:  simply, if you have it you
  31. will be able to use many functions without involving ARexx or the CLI.
  32. This condition will also be removed with the 2.0-OS-only version.  Both the
  33. arp.library and req.library are in the distribution archive.
  34.  
  35. Starting 33mLeggi0m is really simple:
  36.  
  37. double-click on its icon, or
  38. just type "33mLeggi0m" at the Shell/CLI prompt.
  39.  
  40. A full-WB-size window will pop up (except a pixel line at the very top will
  41. be saved to make it easier to drag around your screen).  Play with the
  42. menus, they're easy to understand, and follow Commodore's guidelines.  If
  43. you aren't reading this with 33mLeggi0m, why not start 33mLeggi0m and then load
  44. 33mLeggi0m.doc by selecting the "Open" option (or Right Amiga-O) and double
  45. clicking on 33mLeggi0m.doc in the ARP file requestor window.
  46.  
  47.  
  48.  
  49.  
  50.  
  51.                                33mLeggi0m's Menus
  52.  
  53. 33mLeggi0m has menus, to be easy to use, and powerful shortcuts, to be fast for
  54. the experienced user.
  55.  
  56.                                General Notes
  57.  
  58. (*):  The menu items marked with this symbol are available from the menus
  59. only if you have the system library named "req.library".  Otherwise, you'll
  60. have to use the CLI command line.
  61.  
  62. The menu items ending with "..." bring up a requester.  This can be either
  63. the ARP file requester (very easy to use), or the req.library string
  64. requesters (very easy to use, too).
  65.  
  66.  
  67. 33mLeggi0m has three menus-- "Project", "Commands" and "Options".
  68.  
  69.  
  70.                              The Project Menu
  71.  
  72. This menu manages files and windows.  33mLeggi0m has been designed to be almost
  73. limitless (i.e., as many windows can be opened as available memory allows),
  74. and this means several files can be displayed without having to run another
  75. copy of 33mLeggi0m.
  76.  
  77. New:  (Right Amiga-N)
  78. Opens a new window, and makes it the principal one (read on to see what it
  79. means).
  80.  
  81. Open...:  (Right Amiga-O)
  82. Loads a new file in the current window.
  83.  
  84. Close:  (Right Amiga-C)
  85. Closes the current window (same as the closing gadget).
  86.  
  87. Save As ASCII...:
  88. Saves the file in the current window as a plain ASCII file.  TABs are
  89. converted to spaces following the current settings.
  90.  
  91. Quit:  (Right Amiga-Q)
  92. Closes all windows and quits.
  93.  
  94.  
  95.                              The Commands Menu
  96.  
  97. This menu's items direct 33mLeggi0m to do something.
  98.  
  99. Font...:  (Right Amiga-F)
  100. Changes the basic font for this window (33mLeggi0m allows upto 8 fonts).
  101.  
  102. Free All Fonts:
  103. Closes all fonts used in this window (freeing memory) and picks up the
  104. system default font.
  105.  
  106. Search...  (*):  (Right Amiga-S)
  107. Asks for a string to search for (max 79 characters); the search is
  108. case-insensitive and will start from the line following the very first one
  109. in the window; if a match is found in a line, it becomes the top screen
  110. line.
  111.  
  112. Repeat Search Forwards:  (Right Amiga-A)
  113. Repeats the last search looking forward.
  114.  
  115. Repeat Search Backwards:  (Right Amiga-B)
  116. Repeats the last search looking backward.
  117.  
  118. Select:
  119. Selects the current window as the principal window (keep reading to find
  120. out what this means).
  121.  
  122. Refresh Window:  (Right Amiga-R)
  123. Refreshes the contents of the current window; this can be useful if, a
  124. simple refresh window has been scrolled behind another window---usually
  125. this will cause a lot of trash to be displayed (system design, not 33mLeggi0m's
  126. fault...).
  127.  
  128. Jump To...  (*):  (Right Amiga-J)
  129. Jumps to a specified line in the file.
  130.  
  131.  
  132.                              The Options Menu
  133.  
  134. This menu affects the way 33mLeggi0m acts.  There are many switches, in order to
  135. fully configure the program to suit the user's tastes.  All of the switches
  136. can be included in a configuration file (discussed below).
  137.  
  138.  
  139. Smooth Scrolling:  (Right Amiga-H)
  140. Turns on a smooth type of scrolling, really slow, but some people like it
  141. because they can read while the window is scrolling.
  142.  
  143. Grossier Scrolling:  (Right Amiga-G)
  144. Turns on a raw scrolling, decently fast but absolutely unreadable during
  145. scrolling.
  146.  
  147. Simple Refresh:
  148. Smart Refresh:
  149. Set the refresh type of the window 33mLeggi0m uses.  These are rather difficult
  150. technical details of interest mainly to programmers, so I won't explain
  151. them in detail, only recall that Simple Refresh windows don't use Chip
  152. memory and are slower.  Smart Refresh windows are faster but they use Chip
  153. memory (the wider the hidden part of the window, the more memory used).
  154. Please note that you can't scroll a Simple Refresh window that's partially
  155. hidden, or a lot of trash will appear.
  156.  
  157. Line Numbers On:  (Right Amiga-1)
  158. Line Numbers Off: (Right Amiga-0)
  159. Switch on and off the line length/line number indication in the window
  160. title.  The updating of the line numbers tends to slow down the scrolling
  161. (at least under 1.3), so maybe you wouldn't want to keep it on all the
  162. time.
  163.  
  164. Set Tabs...  (*):  (Right Amiga-T)
  165. Specifies a number of spaces that will be substituted for a TAB in the
  166. current window.
  167.  
  168. Set Wordwrap...  (*):  (Right Amiga-W)
  169. Specifies the max length of a line, after which there will be an automatic
  170. wordwrap.  "0" means no wordwrap.  Please note that wordwrap is done at
  171. loading time (so a file must be re-loaded if you see it needs wordwrapping
  172. after loading).  The breaking algorithm is rather stupid:  it tries to
  173. break the line at the first space after the column number specified has
  174. been passed.
  175.  
  176. Set Line Spacing...  (*):  (Right Amiga-L)
  177. Sets the interline spacing in pixels.  You can get a much more readable
  178. file by inserting a few blank pixels between a row and another one. Eight
  179. pixels equal about one line in the default Topaz 8 font.
  180.  
  181. Set Page Key...  (*):  (Right Amiga-K)
  182. Sets the page key to a specified string (max 39 characters).  The key will
  183. be searched forwards each time you press CTRL-DOWN, and backwards each time
  184. you press CTRL-UP.
  185.  
  186.  
  187. There are some subtle differences between the switches, however.  More
  188. precisely, Simple/Smart Refresh are global switches (i.e., common to all of
  189. the windows).  They go in effect from the next window you open (it's
  190. impossible to change the refresh type of an already opened window).  The
  191. other switches are local, i.e., setting Smooth Scrolling in a window won't
  192. change it in another window.  But they are inherited, i.e., if you open a
  193. new window and the current windows has Smooth Scrolling, the new window
  194. we'll have it, too.
  195.  
  196.  
  197.  
  198.                                 33mLeggi0m Keys
  199.  
  200. Once a file is loaded, you can move around in it in many different ways.
  201.  
  202. The simplest is to click and hold down the left mouse button on the top or
  203. bottom part of the window:  the file will scroll up or down revealing more
  204. text.  If you click about in the middle of a window vertically, but near
  205. the side of the window, the file will scroll horizontally, too!
  206.  
  207. The second method is to use the scroll bar 33mLeggi0m puts at your disposal.
  208. Click on the knob and drag it:  you'll get a "living" scrolling.  You can
  209. also click on the bar but not on the knob:  you'll move a page (less a
  210. line) at a time.
  211.  
  212. The third way is to use the keyboard.  The main keys for movement are, of
  213. course, cursor keys.  They move one line at a time (vertically) or four
  214. caracters at a time (horizontally).  If ALTed, the movement is greater:  a
  215. window less one line at a time (both horizontally and vertically).  If,
  216. SHIFTed the movement will be to the top/bottom of the file (UP/DOWN) or the
  217. default horizontal position (both SHIFT-RIGHT/LEFT do the same thing).
  218.  
  219. The CTRL-UP/DOWN combination yields a really special behavior.  You'll get
  220. the first occurrence in the file of a customizable key.  For example, if
  221. you set the key to "======", you can skip one BIX message at a time.  You
  222. can set the key from the CLI/Shell or from your configuration file.
  223.  
  224. For experienced More/Less users, a "More" compatible mechanism is
  225. available:  SPACE/("B" or BACKSPACE) to go up/down a page, and ESC to close
  226. the current window.
  227.  
  228. If many windows have been opened, it could be time consuming searching
  229. around for a specified one.  33mLeggi0m lets you press a numeric key (the row on
  230. the top of the keyboard-NOT the numeric keypad) to choose a window through
  231. its number (0 yields 10).  ALT adds 10, SHIFT adds 20, and CTRL adds 40.
  232. With a little practice in binary aritmetic, you can instantly get to anyone
  233. of eighty windows.  In fact:
  234.  
  235.         ALT adds 10
  236.         SHIFT adds 20
  237.         ALT+SHIFT adds 30
  238.         CTRL adds 40
  239.         CTRL+ALT adds 50
  240.         CTRL+SHIFT adds 60
  241.         CTRL+ALT+SHIFT adds 70
  242.  
  243.  
  244.  
  245.  
  246.                      Invoking 33mLeggi0m from the CLI/Shell
  247.  
  248.  
  249. 33mLeggi0m can be used and fully configured from the CLI/Shell.  The syntax is
  250. rather complex, so try to get acquainted with the menus before getting into
  251. the deep of it.
  252.  
  253. To get 33mLeggi0m's syntax, simply type "33mLeggi0m ?" at a prompt.  Another "?" will
  254. give more help.  There are many options, but they're grouped under the
  255. names "Usage:" and "Line commands".  Let's start with "Usage:", because
  256. those are the most frequently used options.
  257.  
  258. Files:  an unlimited number of files can be specified for reading.  You can
  259. also use wildcards (#?  or *), in which case a window will be opened for
  260. each matching file.  If too many windows are being opened, quit with
  261. Amiga-Q.
  262.  
  263. Font <fontspec>:  this command must be followed by font specification in
  264. the form <font name>/<point height>.  For instance, "FONT Helvetica/15"
  265. will set the font to Helvetica, height 15 points, as the default font.
  266.  
  267. Key <pattern>:  this option describes the pattern to search for when the
  268. smart paging feature is used---see below.
  269.  
  270. SMOOTH, GROSSIER:  these are exactly like their menu counterparts.
  271.  
  272. NON, NOFF:  exactly like Numbers On/Numbers Off.
  273.  
  274. SMART, SIMPLE:  we know the trick now, don't we?  Please note that the
  275. first option is the only way to get the first window opened in smart
  276. refresh!
  277.  
  278. Tab, WordWrap, LineSpacing:  like the corresponding menu items.
  279.  
  280.  
  281. These are all of the options you should use when using 33mLeggi0m until you are
  282. familiar with 33mLeggi0m's operation.  If 33mLeggi0m is invoked while its already
  283. running, a new copy of 33mLeggi0m will not pop up:  rather, the options
  284. specified on the command line will be passed to the copy currently running.
  285. This means 33mLeggi0m can be "piloted" from the CLI, and this explains the need
  286. for the following options, too.  Please note that while you're using menus,
  287. 33mLeggi0m knows very well the window you're referring to---it's the active
  288. window, the one that's not ghosted.  But when giving commands from the CLI
  289. to a running copy or while using ARexx, 33mLeggi0m must know where to send the
  290. commands.  That's why there is a window, called the "principal" window,
  291. that's distinguished by the "§" sign (instead of "#") in the title bar.  It
  292. receives all of the commands.  You can change it with the "Select"
  293. commands, or opening a new window, since the new window becomes always the
  294. principal one.
  295.  
  296.  
  297. New, Save, Close, Quit:  exactly like in the menus.
  298.  
  299. Select n :  selects the n-th window as the principal one.
  300.  
  301. WindowToFront n:  pops up and activates the n-th window.
  302.  
  303. TOP, BOTTOM:  set the position in the principal window to the beginning or
  304. to the end of the file.
  305.  
  306. BACKWARD, FORWARD:  move a page up/down.
  307.  
  308. PREV, NEXT:  move up/down following the optional KEY command.
  309.  
  310. UP, DOWN:  move a page up/down.
  311.  
  312. Jump n:  jumps to the n-th line.
  313.  
  314. LEFT, RIGHT:  moves four characters left or right.
  315.  
  316. WLEFT, WRIGHT:  moves about a window left or right
  317.  
  318. CENTER:  repositions the horizontal margin to 0.
  319.  
  320. Search <pattern>:  searches for the given pattern.  If you haven't the
  321. req.library, this is the right way to do a search.
  322.  
  323. AGAIN, BAGAIN:  repeats the last search forwards or backwards.
  324.  
  325. REFRESH, FREEFONTS:  exactly like the menu items.
  326.  
  327.  
  328.  
  329.                         Invoking 33mLeggi0m from the WB
  330.  
  331. 33mLeggi0m can be also invoked from the Workbench.  However, the number of
  332. options available is restricted to the defaults or those specified in the
  333. config file.  You can simply double-click on its icon or double click on an
  334. icon that has "DefaultTool=33mLeggi0m" and you can use multiple selections.
  335. Tool Types are not supported.  Please note that if you double-click a file
  336. to read while 33mLeggi0m is already active, the file will be loaded into the
  337. principal window.
  338.  
  339.  
  340.  
  341.                         Using 33mLeggi0m ARexx Interface
  342.  
  343. 33mLeggi0m possesses a powerful ARexx interface (the port is named '33mLeggi0m'),
  344. with which you can completely control the program.  The commands available
  345. through ARexx are exactly the ones available through the command line.  The
  346. only real difference is that to open a file you must use "open <filename>".
  347. Please note that the "options result" command has no effect, since 33mLeggi0m
  348. returns only the error code (the error code will be non-NULL if a movement
  349. is impossible, too).  I would like to see any AREXX macros written for
  350. 33mLeggi0m, so please send them to me on Bix or post them to publicly available
  351. BBSs, and they will likely get to me.  Let your imagination go!
  352.  
  353. The commands from AREXX are recognized by 33mLeggi0m through the minimun
  354. meaningful set of characters.  For instance, you need only to type "wri" in
  355. order to use the "wright" command.
  356.  
  357.  
  358.  
  359.                      Using 33mLeggi0m's Configuration File
  360.  
  361. There are many options available in 33mLeggi0m, and it would likely be a chore
  362. to change everything every time 33mLeggi0m was called because you don't like the
  363. default.  That's why a configuration file can be setup.
  364.  
  365. The file is named "Startup-33mLeggi0m" and must be in the "S:" directory.  It
  366. can contain any of the command line options (i.e., the options under
  367. "Usage:") excepted, of course, filenames.  This will allow you, for
  368. instance, to set up a version of 33mLeggi0m that starts with Smart Refresh,
  369. Smooth Scrolling windows.  Commands can be spread over several lines or
  370. gathered together on a single line separated by spaces.
  371.  
  372.  
  373.                              Advanced features
  374.  
  375. Here we are, folks!  You will learn to prepare your IFF files to submit to
  376. 33mLeggi0m in order to get the best results and to produce impressive doc files.
  377.  
  378. 33mLeggi0m is able to parse completely only a small subset of the whole IFF FTXT
  379. standard (e.g., it doesn't show pictures) but the subset has been carefully
  380. chosen to produce the best results in the littlest space.
  381.  
  382. The basic idea (we go into technical details, but don't get scared) is that
  383. the text contained in the CHRS chunks should possess some indication of the
  384. font/color/style changing (as from the IFF specs).  The IFF standard
  385. suggests the ANSI/ISO codes, and this is exactly what was implemented in
  386. 33mLeggi0m, so let's take a look at it.
  387.  
  388. Color/Style Specifications
  389.  
  390. <ESC>[0mnormal char set (all reverts to plain)
  391. <ESC>[3mitalics on
  392. <ESC>[23mitalics off
  393. <ESC>[4munderline on
  394. <ESC>[24munderline off
  395. <ESC>[1mboldface on
  396. <ESC>[22mboldface off
  397. <ESC>[3xmset foreground color to x (from 0 to 9)
  398. <ESC>[4xmset background color to x (from 0 to 9)
  399.  
  400. You can freely mix together indications.  For instance,
  401.  
  402. <ESC>[4;1;31;40m
  403.  
  404. sets underline and boldface on, and sets the color to 1 (fore) and 0
  405. (back).  The <ESC>[ pair can be substituted by the single CSI character
  406. (0x9b) but this is usually more difficult to handle in a text editor.
  407.  
  408.  
  409. Font Specifications
  410.  
  411. <ESC>(x
  412.  
  413. where x can be any of B,R,K,A,E,H,Y,Z and selects one of the eight fonts
  414. 33mLeggi0m can handle.  Why these letters?  Ask the ANSI committee, I haven't a
  415. clue.
  416.  
  417.  
  418.                        Putting Together an IFF File
  419.  
  420. OK, now you have your ANSI/ISO coded text, and you want to add fonts to
  421. make it beautiful.  Here comes IFF.rexx, the little ARexx macro that comes
  422. with 33mLeggi0m.  All you have to do is to change the first lines of the
  423. program, i.e., the fontname.x.y specifications.
  424.  
  425. IFF.rexx creates an IFF file simply putting all of your text in a CHRS
  426. chunk, and storing before it a number of FONS chunks, specifying the fonts
  427. you want in the text.  You can set upto eight fonts, but each of the eight
  428. can have more specifications (just in case the user doesn't have the font
  429. you asked).  The x chooses the font number, e.g., the font number one will
  430. be recalled with the <ESC>(B ANSI sequence.  The y, instead, lets you
  431. associate to a font number many fonts, on a the-last-is-the-better base.
  432. For instance:
  433.  
  434. fontname.1.1='Times/18'
  435. fontname.1.2='Helvetica/18'
  436.  
  437. If you code your IFF file with that specification, 33mLeggi0m while reading it
  438. will first try to open Times, then it will try to open Helvetica, and, if
  439. the latter is found, the former will be closed.  Otherwise, Times will be
  440. kept.  Got it?
  441.  
  442. Once you have modified IFF.rexx to get the fonts you want, type
  443.  
  444. IFF <ASCII file name> <IFF file name>
  445.  
  446. and IFF.rexx will do the conversion.
  447.  
  448.  
  449.                           Decomposing an IFF File
  450.  
  451. If, however, you have an IFF file and want to change the fonts in it, you
  452. can use the DeIFF program that comes with 33mLeggi0m:  it takes as arguments two
  453. filenames:  the first one will be parsed as an IFF file, and the content of
  454. any CHRS chunk will be written to the second one.  In other words, DeIFF
  455. strips out all of the IFF FTXT stuff from a file and leaves you a clean
  456. ASCII/ANSI file that you can pass to IFF.rexx.
  457.  
  458.  
  459.                               Acknowledgments
  460.  
  461. I must thank all of the guys who helped me during 33mLeggi0m's development.
  462. First of all, thanks to my beta-testers, Vittorio Calzolari, Dan Ten Ton,
  463. Bill Hogsett, Luca Spada, Reinhard Spisser and Jon Wolf.  Thanks also to
  464. the BIX people who often answered to my questions (the silly ones, too) and
  465. gave many suggestion in the discussion preceeding 33mLeggi0m's development.
  466.  
  467.  
  468.                                Distribution
  469.  
  470. Well, since this should be a text reader for a variety of uses, the
  471. distribution conditions will be very wide.  33mLeggi0m is a copyrighted, freely
  472. distributable program, in the widest sense, i.e., the only restriction is
  473. to selling it by itself.  33mLeggi0m can be included in disk magazines, PD
  474. collections, commercial programs, but, including if possible at least
  475. these docs.  It would be really appreciated if you included also IFF.rexx
  476. and DeIFF.  They're so small!
  477.  
  478.  
  479.  
  480.                                                 Sebastiano Vigna
  481.                                                 BIX: svigna
  482.                                                 Via Valparaiso, 18
  483.                                                 20144 Milano ITALIA
  484.