
 *#######################################################################*
 *                                                                       *
 *       Fontaloger V1.2 - Final Writer Arexx Script                     *
 *       Andrew M. Haas (03-Sep-98)                                      *
 *                                                                       *
 *       EMail: AndyHaas@wcnet.org                                       *
 *                                                                       *
 *#######################################################################*


Introduction:

    Fontaloger is a Final Writer ARexx macro which will print all fonts in a
    specified path. The font name will be printed using a common font and a 
    test string will be printed using the actual font. 

    Since Fontaloger prints each page as is it created, clears the document,
    and starts the next page on an empty document, there is no limit to the
    number of fonts, or pages of fonts which can be cataloged. In contrast,
    accumulation (as a single Final Writer document) of a large font catalog
    could exceed the available memory of an 8 MB Amiga.

    A catalog page can contain one, two, or three columns of font samples,
    allowing 15, 56, and 108 samples per page respectively. You can choose
    from these based on your preferences and available memory. Fontaloger has
    two sorting modes and two page format options and allows the user to save
    each page as a Final Writer document or create a sorted ASCII fonts 
    listing.


Requirements:

    Any Amiga
    Final Writer V4
    OS 2.04+
    AmigaDOS commands:
        RequestFile, RequestChoice, Wait, Delete, Run, Rename, List, Sort, Copy
    6MB RAM


Recommended:

    Accelerated Amiga
    Final Writer V5 (Fontaloger prefers to use the FW V5 public screen)
    OS 3.1
    AmigaDOS commands:
        RequestFile, RequestChoice, Wait, Delete, Run, Rename, List, Sort, Copy
    >8MB RAM


Installation:

    1.) Put Fontaloger and Fontaloger.doc in the FWMacros directory.

    2.) Add the following 'assign' to your S:User-Startup and reboot.

    --> Assign FinalWriter: <Final Writer program directory path>

        The stuff in < > is the path to Final Writer - it includes the Final
        Writer directory name. Fontaloger will execute Final Writer 
        automatically if you perform this step - it is not a NECESSARY step.
     

Starting Fontaloger:

    From Final Writer:

        1.) Run Final Writer

        2.) Select Fontaloger in 'User' menu -> Other -> ARexx Script...

    From CLI:
        1.) You will need the 'assign' in step 2 of the installation 
            instructions in place.

        2.) At the CLI prompt, enter the following command.

    --> rx FinalWriter:FWMacros/Fontaloger

        3.) If Final Writer is not already running, it will be started
        automatically.


Using Fontaloger:

    1.) Execute Fontaloger in one of the two ways described above.

    2.) Select 'Continue' in the first requester.

    3.) Select the printing mode:

        * 'Autoprint' will send the pages to the printer automatically as they
        are completed. There is no possibility of saving the pages as a 
        Final Writer document in this mode. You will want to turn your printer
        on right away if using this mode. Fontaloger will print the entire fonts
        list unattended.

        * 'Page prompt' mode will present a requester and beep when each page
        is completed and ready to print. Saving each page as a separate Final
        Writer document is possible in this mode.

        * 'List to file' will not print, but will create a sorted ASCII listing
        of all the files which would otherwise be printed in the 'Autoprint' or
        'Page prompt' modes. This is good for making a trial run to see how
        things will go. The list file is created in RAM:FontList. You can view
        this file with any text editor.

    4.) Select the number of columns of text (font samples) you want
        printed on each page: 

        * 'One' column mode will print about 15 fonts per page. 

        * 'Two' column mode will print about 56 fonts per page.

        * 'Three' column mode will print about 108 fonts per page.

        The amount of RAM on your particular Amiga may also play a role in your
        selection process. Keep an eye on your free RAM.

        In 'List to file' (see 3. above) mode, the number of columns is used to
        generate an estimate of the number of pages required to print the
        listed fonts.

    5.) Select page format: (not applicable in 'List to file' mode)

        Fontaloger supports two formats of listing font names and paths. These
        formats, designated 'A' and 'B', differ mainly in that one format ('A')
        specifies the path to the font directory at the top of the page, while
        the other ('B') lists the entire path with each font.
 
        Note below that the font name/path print arrangement (i.e. 'name [path]'
        v.s. 'path/name') also differs from page format 'A' to 'B'. If the user
        prefers to use 'name [path]' arrangement in page format 'A' or prefers
        to use 'path/name' arrangement in page format 'B', then this can be 
        accomplished by a simple modification of the Fontaloger source code. The
        variables FontNameModeA and FontNameModeB in the GETCONFIG: section of
        the Fontaloger source code control the arrangement of font name and path
        for page format 'A' and 'B' respectively. Simply reversing the state of
        the appropriate variable will change the arrangement. This can be done
        with any text editor. Note that the value must be 1 or 0.

        A)  Format 'A' lists the full path to the font directory at the top
            (header) of the page. The font name (with subdirectory, if 
            applicable) is listed above each font sample. The page is formatted
            as shown below.
    
            --------------------------------------------------------------------
            |                                                                  |
            |   Font listing of "Work:DeskTop/FinalWriter/FWFonts/SWOLFonts/"  |
            |                    page 1 of 20, fonts 1 - 15                    |
            |                                                                  |
            |   Courier                                                        |
            |   AaBbCcXxYyZz1234567890  (in Courier font)                      |
            |                                                                  |
            |   Deco/Amelia                                                    |
            |   AaBbCcXxYyZz1234567890  (in Amelia font)                       |
            |                                                                  |
            |   ......                                                         |
            |                                                                  |
            \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
    
            This mode allows only a single path to be specified for cataloging
            and thus, the requester for the font path is presented only once.
    
            The maximum total string length for the subdirectory and font
            string is 45 characters. If the subdirectory and font name (with 
            delimiters) exceeds this limit, the leftmost characters of the 
            string will be cut off and will be replaced with a single '+' 
            character.
    
        B)  Format 'B' lists the font name, and the full path to the font in 
            brackets for each font. A simple title and page numbering are at the
            top (header) of the page. The page is formatted as shown below.
    
            --------------------------------------------------------------------
            |                                                                  |
            |                     Fontaloger font listing                      |
            |                    page 1 of 20, fonts 1 - 15                    |
            |                                                                  |
            |   Courier [Work:DeskTop/FinalWriter/FWFonts/SWOLFonts]           |
            |   AaBbCcXxYyZz1234567890  (in Courier font)                      |
            |                                                                  |
            |   Amelia [Work:DeskTop/FinalWriter/FWFonts/SWOLFonts/Deco]       |
            |   AaBbCcXxYyZz1234567890  (in Amelia font)                       |
            |                                                                  |
            |   ......                                                         |
            |                                                                  |
            \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

            In order to include the entire path with each font, the font width
            has to be compressed to about 60% of normal. This makes the text a
            bit more difficult to read - especially in three column mode. 
    
            In this mode, there is no limit to the number of paths that can be 
            specified for cataloging and thus, the requester for the font path
            will be presented repeatedly for additional paths until you select 
            'Cancel' or until you select 'Ok' after specifying a duplicate path.
    
            The maximum total string length for the font and path string is 74 
            characters. If the path and font name (with delimiters) exceeds this
            limit, the leftmost characters of the path will be be cut off and
            will be replaced with a single '+' character.
    
    6.) Select sorting method:

        Fontaloger supports two methods of alphabetically sorting the font
        name and path:

        A) Sort by path+name:

            In this mode, Fontaloger simply alphabetizes the standard form
            'path + filename'. Sorting method 'A' would result in the example
            below:

            Work:DeskTop/FinalWriter/FWFonts/SWOLFonts/Courier
            Work:DeskTop/FinalWriter/FWFonts/SWOLFonts/Deco/Amelia

            This results from the fact that 'Courier' comes alphabetically
            before 'Deco'.

        B) Sort by name, then path:

            In this mode, Fontaloger alphabetizes first by filename, and then
            by path. Sorting method 'B' would result in the example below:

            Work:DeskTop/FinalWriter/FWFonts/SWOLFonts/Deco/Amelia
            Work:DeskTop/FinalWriter/FWFonts/SWOLFonts/Courier
            Work:DeskTop/FinalWriter/FWFonts/SWOLFonts/Deco/Stop
            Work:DeskTop/FinalWriter/FWFonts/SWOLFonts/Fonts2/Stop

            This results from the fact that 'Amelia' comes alphabetically
            before 'Courier' and 'Stop', and the directory 'Deco' comes
            before 'Fonts2'.

        You also have the option to 'Abort' which immediately stops the ARexx
        script.

    7.) Select the font path:

        Fontaloger defaults to the current Final Writer font path. Navigate 
        your way to the directory which hosts the fonts that you are interested
        in. Any selected filenames will be ignored.

        In Page format 'A', only a single path can be specified for cataloging
        and thus, the requester for the font path is presented only once.
        Selecting 'Cancel' at this requester will abort Fontaloger.

        In Page format 'B', there is no limit to the number of paths that can
        be specified for cataloging and thus, the requester for the font path
        will be presented repeatedly for additional paths until you select 
        'Cancel' or until you select 'Ok' after specifying a duplicate path.
        Selecting 'Cancel' at this requester will abort Fontaloger ONLY ON THE
        FIRST APPEARANCE OF THE REQUESTER. Selecting 'Cancel' subsequent to the
        first appperance simply states that you do not want to specify
        additional paths.

    8.) Enter the font pattern:

        The font pattern serves as a filter for selecting (from the specified
        path) only those files which are Final Writer compatible fonts. Files
        which match the pattern and are not fonts will cause Final Writer to
        present an error message. Repeatedly clicking 'Ok' at this requester
        can get tiresome. 

        The default pattern is '~(#?.info) ALL AutoID'. The ~(#?.info) 
        parameter instructs Fontaloger to ignore all files ending with '.info'
        and 'All' causes all subdirectories to be included in the catalog. If
        you are not familiar with AmigaDOS pattern matching, you should consult
        your AmigaDOS manual and practice using the AmigaDOS 'List' command.

        The 'AutoID' parameter instructs Fontaloger to inspect every file which
        matches the above pattern and verify their first two bytes against each
        of three font header templates. If the first two bytes of a file 
        matches one of the templates, there is a high likelihood that this file
        is a valid Final Writer compatible font. Although the 'AutoID' feature
        slows the process (by opening and closing each file to inspect the 
        header), it almost guarantees that the default pattern will be
        sufficient.

    9.) Inspect the advance analysis and select first page:

        Fontaloger counts the number of files (which are hopefully all fonts)
        which match the font pattern and path and estimates the number of pages
        that will be required to print them all. If you are unhappy, you may
        select 'Abort', otherwise select 'Continue', or 'Skip pages'. 
        'Continue' will start page creation at page 1 and continue until 
        completion or until aborted. 'Skip pages' allows you to continue from
        where you left off if you had to abort an earlier multipage print. Page
        calculation for the 'Skip pages' option assumes that all files skipped
        are valid fonts. So, if you printed five pages and got tired of 
        clicking 'OK' on the 'bad font' requester, for instance, you can abort
        and restart using a better pattern, then 'Skip' the pages that were
        already printed. If any files that match your pattern are not fonts,
        the 'Skip pages' function will not operate properly.

        In 'List to file' mode, the only option is 'OK'. You will then be 
        presented a message that tells you where the font list file can be 
        found. Click on the 'Done' button to finish the Fontaloger session. You
        may now view the RAM:FontList file with the text editor of your choice.

    10.) Let 'er rip!:

        Fontaloger draws both the font name with path (as specified by the page
        format selection) in the 'Courier' font and a 'test string' of
        characters in the font itself. This is repeated until the page is full.
        The list is alphabetized per the sort mode selected. 

        Fonts that are unusually wide may not fit completely within its column.
        In this case, Fontaloger will truncate the test string and redraw the
        font sample until it fits.

        If a file is reached which Final Writer cannot open, then Final Writer
        will complain. Afterwords, Fontaloger will present a requester allowing
        you to abort (i.e. you have realized that you font pattern is flawed).
        You may 'Abort', 'Continue' (in which case this requester will return
        upon occurrence of the next bad font), or select 'Do not ask again'
        which only stops the Fontaloger requester from popping up. The Final
        Writer requester will still be presented for each bad font.

        When the page is full, Fontaloger draws the header at the top of the
        page as specified by the page format (see 5. above) selection.

        In 'Page prompt' mode, upon completion of each page, you will be given
        the options of 'Print'ing the page, skipping to the 'Next' page, 'Save-
        as', 'Autoprint' and 'Abort'ing Fontaloger.

            'Save as' presents the Final Writer 'save as' requester. Here 
            you can specify a filename for immediate writing of THAT PAGE 
            ONLY to a file. Fontaloger does not create a multipage document
            in the interest of memory conservation. 

            'Autoprint' causes Fontaloger to print the current page and 
            automatically print the remaining pages without presenting this
            requester again.
        
        Note that in 'Page prompt' mode, you may print or save the current page
        as many times as you like before going on to the next page. In order to
        go on to the next page, you must select 'Next pg'.

    11.) Review Fontaloger stats:

        When all pages have been processed, Fontaloger presents a tally of the
        valid (loadable) fonts, the number of pages, and the number of invalid
        files. Select 'Continue' when you are done gasping in amazement at
        these numbers.

        If at least one bad file resulted in a requester, Fontaloger will
        remind you that it created a list of these bad files in the file
        'BadFontsList' in the RAM Disk. This file can be used to aid in the
        deleting of bad files, or may be helpful in adjusting the font pattern
        for your next Fontaloger session.


Notes:

    * Fontaloger's AutoID function appears to be selective enough that it is
    possible to specify the root directory your hard drive as the font path 
    without having a significant number (if any) of false ID's as fonts. This
    feature can be used in conjunction with 'List to file' in order to create
    an ASCII list file of every FW compatible font on your hard drive. In
    reviewing this file (RAM:FontList) with any text editor, you may find that
    you have more fonts than you thought!

    * Note that 'AutoID' excludes files which do not match one of the three
    header templates. Therefore it is conceivable that a Final Writer
    compatible font with a different (new) header will be excluded from the
    font list. If this, or the opposite (a non-font getting past the test) 
    happens to you, please let me know, and if possible, Email the offending
    file to me. I will update Fontaloger and Email it to you.

    * As I haven't yet found a way to send a 'break' to an AREXX script which
    was called from Final Writer, the only methods of stopping the Fontaloger
    execution are: 1) waiting for a requster to pop up upon page completion,
    2) quitting from Final Writer, or 3) rebooting your Amiga. If anyone knows
    of a better way to do this, please email me.

    * Use good quality paper and ink when using three column mode - the fonts
    are quite small.

    * Drawing and page redraws can take quite awhile - have patience. 

    * Using 'three column' mode with less than 8MB of RAM may bring your Amiga
    to a screaching halt. Watch your free RAM!


Modifying Fontaloger Defaults:

    Fontaloger was written for easy customization. There are plenty of variables
    that can be changed to give a desired effect. Configuration items such as
    page view size, font test string, and some mode controls are in the 
    GETCONFIG: function near the end of Fontaloger. All of the constants in the
    GETLAYOUT: function affect the positioning, size and style of objects on
    the page.


Distribution:

    Fontaloger is freeware, but please keep the archive intact. 


Things to Do:

    I probably spent more time on this than I should have, but changes are
    easy. Email me with any suggestions. I hope to have the following 
    enhancements incorporated someday.

    * Implement some sort of asynchronous abort capability. (Help!)

    * If there is enough interest in Fontaloger, I might learn how to make an
    AmigaGuide version of this .doc file.

    * Determine compatibility with other versions of Final Writer. To date,
    Fontaloger has only been tested with Final Writer 5 and 97. (Help!)


Credits:

    * Many thanks go to Robbie Akins, Nuno Maltez and Alan Magsig for thier
    helpful testing and input in shaping the operation and user interface of
    Fontaloger.


Revision History:

    V1.2 (03-Sep-98) :

        * Added new page format which lists font name and path for each font.

        * Added "sort by font name, then path" option.

        * Changed header page numbering format from "Page x" to "Page x of y".

        * Increased maximum font name/path length from 37 characters to 74.

        * Corrected error in tallying of bad files.

        * Bell no longer sounds between pages in 'Autoprint' mode.

        * Moved page size setting to GETCONFIG section.

        * Various minor bug fixes

    V1.11 (26-May-98) :

        * Fixed coding mistake in "Page Prompt" mode requester to "print page
        again".

    V1.1 (20-Feb-98) :

        * Added auto-identification of font files via verification of first two
        bytes of file.

        * Fixed a bug which prevented Fontaloger from scanning a device's root
        directory (i.e. Work:).

        * Changed 'Test' option in print mode requester to "List to file"
        option which creates a list of fonts in a file in the RAM Disk.

        * Changed the order of the startup requesters - print mode before the
        number of columns.

        * Removed automatic 'Quit' ARexx command to FW by Fontaloger. 

        * Added a beep to the page prompt - V1.0 did not have this even though
        the .doc file said it did.

    V1.0 (5-Feb-98) : Initial release


Contacting the Author:

    Please send all correspondence to:

    Andrew Haas
    EMail: AndyHaas@wcnet.org
    URL: www.wcnet.org/~amhaas/amiga.html

                               --------------------
