D]3 P]01jb1 P]02jb2 P]03jb3 P]04jb4 P]05jb5 P]0Hjbh P]PAjbmini P]fijbrelax ]]P01 00 ]03 ]10 ]P01 06 ]]P01 01 ]13 LIREPIC (v2.2) ]10 ]P01 07 ]]P01 02 ]13 ฉ1990 by Charles Vassallo ]10 ]P01 08 ]]P01 03 ]23 (all rights reserved -- See the ]10 ]P01 09 ]]P01 04 ]23 notice at the end of the article) ]10 ]P01 10 ]]P01 05 ]P01 11 ]]P02 00 ]P0H 00 ]P02 06 ]]P02 01 ]P0H 01ere is a new version of my utility to display ]P02 07 ]]P02 02 ]P0H 02 illustrated texts. Several enhancements have ]P02 08 ]]P02 03 been carried out; undoubtedly, the most obvious of ]P02 09 ]]P02 04 them is the possibility to place pictures side by ]P02 10 ]]P02 05 side without bothering too much about palettes. ]P02 11 ]]P03 00 As an example, the present display is drawn in a ]P03 06 ]]P03 01 3-bitplane screen and it can't hold pictures with ]P03 07 ]]P03 02 more than 8 colors. Indeed, all the present images ]P03 08 ]]P03 03 have 8 colors only, but not always the same 8. Of ]P03 09 ]]P03 04 course, nothing is perfect; there are some limita- ]P03 10 ]]P03 05 tions and some drawbacks. More on this later on. ]P03 11 ]]P05 00 ]P05 06 ]]P05 01 The other major enhancement is the capability ]P05 07 ]]P05 02 of showing files that have been crunched with the ]P05 08 ]]P05 03 Nico Francois' program "PowerPacker" (Jumpdisk, ]P05 09 ]]P05 04 July 89 and April 90). The original decrunching of ]P05 10 ]]P05 05 Nico's code is included in LIREPIC by special ]P05 11 ]]P04 00 permission. Of course, don't try to crunch your ]P04 06 ]]P04 01 files with another program. ]P04 07 ]]P04 02 ]P04 08 ]]P04 03 At last, new gadgets have been added. You can see ]P04 09 ]]P04 04 the Find gadget below. In case you use "LirePic" ]P04 10 ]]P04 05 to display mere text files, there another gadget ]P04 11 appears to print or to copy the file. Since only the text (not the pictures) can be printed, don't mistake LIREPIC at 5300 bytes in uncrunched form, for a complete graphical text processor. I preferred to make the printing gadget disappear in the case of illustrated texts. Inevitably, novice users would have been frustrated not to get a print of the whole display: text and images. Please, let me know your reactions/frustrations/suggestions either directly (C. Vassallo, 33 route des Traouieros, 22730 Tregastel - France) or through JUMPDISK. Accordingly, I'll try to help or console you and I might even take your advice into account. But please, don't mistake LIREPIC for a complete environment for editing and printing illustrated texts. It only a display utility. So far there is no associated editor program. In other terms, text files must be prepared by hand. ]]PPA 00 ]]PPA 01 ]20USING THE DISPLAY GADGETS ]]PPA 02 We now detail the operation of the various gadgets. From the left to the right, we successively find: ]- ]30<<<< >>>>]10 : scrolling gadgets. A single (fast) click on them makes the display scroll by one line backward or forward. Keeping the button down makes continuous (line by line) scrolling. I agree with you: The scrolling is not esthetically pleasant, especially in case of large images in 16-color displays, but. . . (see further on). ]- ]30the proportional page gadget]10. The cursor indicates the relative location (in the whole text) of the first line of the display. Drag it to move along the text. If you click on the right of the cursor, you get the next page, so repeatedly clicking on the right part of the gadget is an easy way to rapidly flip pages forward. Similarly, you get the previous pages by clicking on the left of the cursor. ]- ]30<< Find >>]10 : searching gadgets, to locate the occurrence of a given string of characters in the text. There are actually three different gadgets. Begin by clicking the central part ("Find"). A window opens, with a string gadget and three new gadgets: "PREV", "NEXT" and "CANCEL". Enter a string (let's say "<< Find >>",i.e., the first words of this paragraph - you can ] enter up to 32 characters) ]20and hit RETURN.]10 The window is closed and the search begins, from the current first line of the display toward the end of the text. The screen flashes if no occurrence is found. You can now click on "<<" or ">>" to search for the previous or the next occurrences. When an occurrence is found, the screen is updated with the string in the first line. You can now reopen the search window (by clicking "Find") and look for another string. The previous string is not lost. If you wish to return to it, reopen the search window and click the "PREV" gadget. You can thus memorize up to 10 strings and make them circulate by clicking "PREV" or "NEXT". Obviously, CANCEL returns you to the display. Two remarks: The search is case-unsensitive, i.e., strings "using", "USING" or "Using" are equivalent. Second, if the occurrence is found in the last page, only the last page is displayed, even if the occurrence is not in the upper line. ]-]30 PRT/COPY]10 : this gadget appears only in case of non-illustrated texts. Its main interest is to offer a facility to copy or to print decrunched texts. It makes a window open, with a string gadget aimed at receiving a filename for copy operation and three self-explanatory gadgets: COPY, PRINT and CANCEL. The print operation is made with your Preferences printer. ]-]30 EXIT]10 : closes the display. ]]PPA 00 ]]PPA 01 ]20HOW DOES IT WORK ? ]]PPA 02 Special control sequences must be embedded in the text to activate the loading and the display of the pictures. They consist in a "]" and various characters. LIREPIC tries to load in memory the whole material: text and pictures. Pictures are loaded in auxiliary bitmaps and displayed "line" by "line," that is, by slices eight pixels high, thus preserving the line scrolling facility of the text reader. Consequently, the pictures must be declared ahead of the file, with some identifier (like the number of a figure in a book) and the relevant pathname to find them. They are displayed line by line. For each line, one must recall the identifier of the picture and the number of the "line" to be displayed. In case of low-memory operation, only a limited number of pictures can be loaded with the text. The corresponding memory is partly released when other pictures are called. These pictures are then loaded from the disk. This low memory operation has to be made possible but obviously makes the program more complex. Only 640x200 (or PAL 640x256) screens are possible, with 2 to 4 bit- planes. Because of the low-memory complications, the depth must be declared ahead of the text. Otherwise, a default value of 2 is assumed. Pictures with more bit-planes than this depth are rejected (but not those with less bit-planes). Consequently, only 16 colors are simultaneously possible. ]]20Two pictures that share the same lines in the display must have the same ]]20palette. On the other hand, pictures located in different lines may have ]]20different palettes. ]10I am sorry to impose this restriction but I was unable to program Copper lists as quickly as in the new dynamic hi-res mode of NewTek. A new Copper list is prepared every time the display is changed. I chose an unsophisticated way, namely to scan the display only during page change in order to locate the palette switches, and I gave up the idea of providing a continuous refresh of the Copper list during the scrolling operations. Anyway, such a refinement would have been spoiled by the strong flickering that occurs in 8-color or 16-color displays. I think this could e arranged with a double-buffering display, but so far, I have been worrying about limiting memory requirements. Recall that all files are kept in memory, in addition to the display itself. Currently, the Copper list is updated only at the end of a scrolling. But why keep these clumsy scrolling gadgets, since the same job can be done with the page gadget? Well, try to display a 60-Kbyte file and move by less than one page at a time with the cursor. The figures must have been prepared as IFF/ILBM files, for example as Deluxe Paint brushes. The text can be prepared with ED or a similar text editor. However, avoid editors that can insert TAB characters. ]]PPA 00 ]]PPA 01 ]20THE CONTROL SEQUENCES ]]PPA 02 The text must begin with special declarations like the following ones (only one declaration per line, beginning on the extreme left): D]n sets the depth to n (n=2,3 or 4). This instruction can be omitted if ญญญ there is no figure; the depth is then set to 2. This instruction must be the first one in the file. G] rgb xyz uvw sets the colors in the gadget line. The triplets "rgb","xyz" ญญญญญญญญญญญญญญ and "uvw" are hex numbers (0 to F) for the red, green and blue components of three colors, namely the background, the pen color and the color for the box and the cursor of the page gadget. This command can be omitted. In this case, there is an automatic adjustment based on the 1st and 2nd colors of the first palette used in the first page. These colors are then kept on throughout the file display. This command is provided because the default adjustment might prove not satisfactory. This command (when used) must be the second one, just after the depth command. Use upper case A,B,C,D,E,F for hex numbers. The spaces between triplets are optional. P]xxFigFile is the declaration for the figure stored in the file ญญญญญญญญญญญ "FigFile". "xx" is a 2-character identifier which will be used later on to call the picture (for instance 00, 01, 02, etc...). The name "FigFile" must include all the relevant path information to locate the file. Mind that this information depends on whether LIREPIC is invoked from CLI or through a Workbench icon. In the latter case, the current directory is set to the one containing the icon and no path is required, provided the figure files are in the same directory as the text file. There must be no space in the declaration sequence. The text itself begins just after the last picture declaration. The control sequences can be split in two classes: - sequences x]... (at the extreme left of a line), announcing a global change for the whole line. - sequences ]....]xxx... with a first ] at the extreme left. The first ] means the line will be analyzed character by character, looking for the subsequent ]xx codings. The first class contains only two instructions: f] (at the beginning of a line) prints the line with the f-th color in the ญญ the palette, i.e. "f" starts from 1 and is written as a hex number (1,2...A,B,C,D,E,F). This notation was adopted for reasons of compatibility with text readers previously used in JUMPDISK. It is unhappy because it does not correspond to the convention used in the internal system of the Amiga, where colors are numbered from 0 (in other terms, the first color is color "0"), and this can lead to mistakes. It will not be extended to the following more powerful color commands. By analogy, a palette command was added: p] RGB UVW XYZ... where "p" is precisely the lower case "p". The various ญญญญญญญญญญญญญญญญ triplets RGB, UVW, XYZ are the amounts of red, green and blue for the various colors of the palette, written as hex numbers from 0 to F (upper case only for A,B,..F). If one uses a palette instruction with fewer RGB triplets than possible colors, only the first colors are changed by this instruction. The spaces are optional. There must be no text after this command. The second class of instructions contains extended color instructions and picture instructions. ]...]fb (the first "]" must be at the beginning of the line) sets up the ญญญญญญญ f-th color for the pen and the b-th color for the background, until a second color code or the end of the line. The internal Amiga numbering is used, i.e. f or b = 0,1,2...F. The default colors are restored at the end of the line. ]]f (or ]...]f), immediately followed with the end of line, means the ญญญ pen color is switched to the f-th color, but this will not be changed until a new similar instruction occurs. This will be generally used only once, at the beginning of the text, to change the default pen color (color 1). ]... ]Pxx nn inserts the line "nn" (nn=00,01,02...) of the picture ญญญญญญญญญญญญ identified with "xx" in the declaration instructions. There must be a space between "xx" and "nn". Be sure to use the same "nn" as in the declaration (upper case and lower case are different). For example, one can insert a 4-line picture with the identifier "1a" with the following coding: ]...(text)....]P1a 00....(text)... (for the first line) ]...(text)....]P1a 01....(text)... (next line) ]...(text)....]P1a 02....(text)... (next line) ]...(text)....]P1a 03....(text)... (last line) The picture will appear with text on both sides. Of course, either the left text or the right text can be suppressed (if there is no left text, each line must begin with "]]P"). Notice that all the "]Pxx nn" sequences must be perfectly aligned vertically if there is no extra color coding added to the text. ]]PPA 03 ]]PPA 04 ]20IF SOMETHING GOES WRONG... ]]PPA 05 Normally, all special codes are filtered out. Errors are signalled precisely by displaying the code sequences that have not been understood. If there is a problem when loading a figure, its declaration code is printed ahead of the text (the following declarations also are printed, but in fact the corresponding figures are not checked). Generally, the file can't be found because of an incorrect name or an incorrect path. Another possible reason is that the figure has more bit-planes than the depth previously declared. If a picture "line" cannot be displayed, the calling sequence "]Pxx nn" is printed on screen. Probable cause: an erroneous identifier, or too high a line number. ]]PPA 00 ]]PPA 01 ]20HOW TO INVOKE "LIREPIC" ]]PPA 02 "Lirepic" can be called from the Workbench or from the CLI. From CLI, simply type lirepic filename Take care of the current directory, so the figures files can be found. To use it with Workbench icons, attach a Project type icon to the text file you wish to read. Click this icon (once) and select "Info" from the pulldown Workbench menu at top left of the Workbench screen. In the ToolTypes box, type :lirepic and click the Save box at bottom left of the screen. You must copy "lirepic" to the same diskette as the text file. ]]PPA 00 ]]PPA 01 ]20HINTS FOR FIGURES AND TEXT PREPARATION ]]PPA 02 I am afraid it is simpler to display texts than to prepare them, and this will last as long as there will be no specific editor. A first problem is to prepare the pictures. You will generally have to lessen their color number. Find your way with DPAINT and, I recommend, PIXMATE. I think you cannot avoid using PIXMATE, unless you prepare your pictures by yourself from the beginning. 1 - Think of the background and pen colors. In my opinion, they should be the same throughout the display, which means these two colors must be in the palettes of all your pictures, at the same places (defaults are 0 and 1). 2 - Now reduce the number of independent colors. Notice that you are not obliged to consider 16-color displays. I agree that 4-color displays are somewhat limited -- though you can obtain interesting effects by using dithered (or patterned) colors -- but 8-color displays can be impressive; this one is 8-color. The more bitplanes you have, the longer the picture files are and the slower the display operation. Reducing the effective color number can be done with DPAINT by means of the palette function, by copying a color into another one, or with PIXMATE, by means of the function "Less colors". You will have a better control of your work with DPAINT. This must produce an image with a restricted number of independent colors (either 16, 8 or 4) 3 - Now the recommended use of PIXMATE. First "pack" the colors, obtaining a palette where only the 16 (or 8, or 4) first colors are used. Then "reformat" the picture by removing one, two or three bit-planes. Then come the final step, setting the background and the pen colors in places 0 and 1 in the palette. For this, use the "swap" function. 4 - Open DPAINT again in a 640x200 (or 256) screen, with the required number of bitplanes. Load your picture again and made a brush of it. If you started from a low-res picture, halve the height and (at last!) save your brush. The text can be prepared with ED. The main problem is to determine how much room is left for the text on the right or on the left side of a picture, and the number of lines it will occupy. I process with trials and error, saving the text and displaying it to see the result. To find out the number of lines, add "]Pxx nn" instructions until you see such an instruction printed on the screen. ] ]Pfi 05 ]Pfi 00 ] ]Pfi 06 This may prove difficult for some ]Pfi 01 ] ]Pfi 07 users. Work at it. Please, see it ]Pfi 02 ] ]Pfi 08 as a first step -- and let me see ]Pfi 03 ] ]Pfi 09 what you can do with it. ]Pfi 04 3] TERMS FOR USING LIREPIC: This program and its documentation are 3]copyright material and MAY NOT be distributed, re-published, or placed on 3]bulletin boards. However, permission is granted to purchasers of JUMPDISK to 3]use LIREPIC in their own non-commercial, creative applications. That is, you 3]may include LIREPIC on a disk where it is used solely to display text/image 3]files which you have created. Such disks containing LIREPIC may not be sold. 3]For information on commercial use of LIREPIC, contact JUMPDISK, 1493 Mt. 3]View Ave., Chico, CA 95926 (916) 343-7658.