APLX FONTS

In order to display and print special APL symbols such as quad and iota,
APLX for Linux requires the APLX X-windows fonts to be installed on your
system.

For convenience, during installation the "fonts" directory is created 
under the APLX install directory. To properly install the fonts, they
must be placed in a system-wide X-windows font directory, and certain
configuration files updated to make them available.

In the normal case, APLX for Linux is installed by the root user, and
the APLX installer program automatically installs the fonts and updates
the necessary configuration files.

When APLX is installed by a normal user, the fonts must be subsequently
installed by the super-user. In this case, the system administrator
may use the supplied script to install the fonts, as described in (1)
below.

Once the APLX fonts are installed, it is necessary to instruct X-windows
to re-initialize its fonts and re-read its configuration files before
the fonts can be used. The easiest way to do this is to restart the system.
It is possible to make the fonts available without restarting the system,
but the method for doing this depends on your system configuration. See
section (3) for more information.

For unusual configurations of X-windows, the automatic font installation
can fail. Section (2) below describes how to install the APLX fonts
manually in this case.



1.  Automatic installation of APLX fonts

    The shell script
    
        install_fonts.sh
        
    provided with APLX can be used to install the APLX fonts on most Linux
    systems. If the script runs successfully, see sections (3) and (4)
    which describe how to make the fonts available, and check that they are
    properly installed.
    
    If the script exits with a message like:

        "*** Could not find X-windows font directory ..."

    your system layout is unknown. In this case, please see section (2)
    below describing how to install the fonts manually.
    


2a. The X-windows font path

    X-windows fonts are organized just like ordinary files. When the 
    X-windows font system starts up, it looks in a list of directories
    called the "font path" for its font files and font configuration
    files. Fonts are handled in one of two ways, depending on which
    distribution of Linux you have, and which version of that distribution.

    i.  A dedicated font server
    
    Most recent distributions come configured so that X-windows fonts are
    handled by a separate program, called the X font server (xfs).
    
    ii. Built-in font handling
    
    Originally fonts were handled directly by the X-server. This system
    is still used by some Linux distributions.

    To determine which method your system is using, you can look for a
    running font server process. e.g.
    
        ps aux | grep xfs
        
    The font path is configured differently for the two systems:
    
    i.  When using a dedicated font server, the font path is listed
        in the font server configuration file
        
            /etc/X11/fs/config
        
        which may be different on your system. See the "xfs" man page
        for more information.
        
    ii. When using built-in X-server font handling, the font path
        is listed in the main X-windows configuration file. It can
        be displayed and manipulated using the "xset" command.
        
            xset -q
            
        This command will list several details, including the font
        path. If the font path is shown as "unix:/-1", "unix:/7102"
        or something similar, it means fonts are being handled as in (i)
        by a separate font server process.


2b. Installing the screen fonts

    The APLX screen fonts consist of several .PCF (Portable Compiled Format)
    font files, each of which represent the APLX font at a particular size.
    Normally, the APLX screen fonts should be installed to
    
        /usr/lib/X11/fonts/misc
    
    where there are already several other PCF fonts. If this exact path does
    not exist on your system, it is very likely there is a similar path
    with the same purpose. Section (2a) gives some tips on how to locate
    the path.
    
    When you have located the path, modify the "install_fonts.sh" script
    by filling in the path value, then run it to install the fonts. The
    script copies the APLX screen fonts to the X-windows font directory,
    then updates the "fonts.alias" file.
    
    See sections (3) and (4) which describe how to make the fonts available
    and check that they are properly installed.
    
        
2c. Installing the printing font

    The APLX printing font is a single .PFB file representing a scaleable
    PostScript Type 1 font. Normally the APLX printing font should be
    installed to
    
        /usr/lib/X11/fonts/Type1

    where there are already several other PFB font files. As for the screen
    fonts, if this path does not exist on your system, it is very likely
    there is a similar path with the same purpose. You will need to find
    this path in order to install the printing font. Section (2a) gives
    some tips for doing this.

    When you have located the path, modify the "install_fonts.sh" script
    by filling in the path value, then run it to install the font. The
    script copies the APLX printer font to the X-windows font directory,
    then updates the "fonts.scale" file.
    
    See sections (3) and (4) which describe how to make the fonts available
    and check that they are properly installed.
    
    IMPORTANT:
    Please note that for systems using a dedicated font server, the APLX
    printing font must also be in the font path reported by "xset -q". This
    is because the X-server directly searches for the PostScript font when
    creating PostScript printing output. If you run the "install_fonts.sh"
    script as recommended above, this will happen automatically as APLX
    is started.
    

3.  Making installed fonts available to X-windows

    Once the screen and printing font files are installed in the X-windows
    font path and the configuration files have been updated, the X font
    system must be re-initialized so that it picks up the changes.

    The easiest way to do this is to reboot your system. To restart the
    font system without rebooting, you will need to do one or more of the
    following steps, according to your configuration. 
    
    First do an "mkfontdir" for each of the two font directories, e.g.
    if the screen font PCF files are installed to "/dirpcf" and the 
    printer font PFB files are installed to "/dirpfb",
    
        mkfontdir /dirpcf
        mkfontdir /dirpfb
    
    See the man page for mkfontdir for more info.

    Now determine whether your system uses built-in X-windows font handling
    or a dedicated font server (see section 2a).
   
    i.  A dedicated font server
    
    You can signal the font server to re-initialize using the "kill"
    command. Find the process number of the font server:
    
        ps aux | grep xfs
        
    This should give the xfs process number, e.g.
    
        xfs    721  ...
        
    As root user, signal the xfs process with the SIGUSR1 signal
    
        kill -USR1 721
        
    This will cause the font server to re-initialize.

   
    ii. Built-in font handling

    If you are using built-in X-server font handling, use the "xset"
    command to re-initialize.
    
        xset fp rehash


4.  Testing the fonts

    Once the fonts are installed and the X font system has been
    re-initialized, you should check that the fonts are working correctly.
    
    Start the standard X-windows font selection tool:
    
        xfontsel &
     
    Under the font family ("fmly") list, two APLX fonts should be reported:
    
        "aplx upright"
        
    for the screen fonts, and
    
        "aplxprint"
    
    for the printing font. If X-windows is correctly locating the fonts,
    it is time to try APLX!
    
        startaplx &
    
    Enter the APL expression
    
        16 16 {reshape} {quad}AV
        
    replacing "{reshape}" by the rho symbol (shift-R), and "{quad}" by the
    square Quad symbol (shift-L). You should see a 16 column matrix of
    letters, numbers and APL symbols. Rows 1, 2 and 3 are almost empty,
    and rows 11 and 12 are completely empty. Try changing the font size
    from the "Tools" menu. If APL symbols are displayed correctly, the
    APLX screen font is installed!
    
    Finally, test the printing font by selecting "Print" from the "File"
    menu, and select "Window Contents". The printed output should match
    the contents of your session window.
    
    If the APLX font is not displaying or printing correctly, please
    refer to sections 2 and 3 above.


5.  More information

    XFree86 is the open-source version of X-windows used with almost all
    distributions of Linux. Their website has information explaining how
    to install fonts for the versions of X-windows they provide.

        http://www.xfree86.org


    If you have any questions, please contact us at support@microapl.co.uk.
    Please include a brief description of your Linux and X-windows system.



