	Installing PostScript fonts into Display PostScript on Solaris 2
	----------------------------------------------------------------

Introduction
------------
The X-windows server provided by SUN supports the Display PostScript server
extensions (DPS).  These allow programs to use PostScript commands to render
graphics to the workstation screen.

Laser-Scan's LAMPS2 products take advantage of this facility to allow maps and
charts to be drawn using industry-standard PostScript fonts.  These fonts are
read by the X-server, and as such have to be in the correct format, have the
correct names, and live in the correct directories to work.

Fonts for use in this way should be in the Adobe Type1 format, in ASCII (not
binary) form.  This format is commonly called PFA format.  An associated AFM 
file (Adobe Font Metrics file) is also needed.  If it is needed to use
multinational characters, then a second AFM file for the ISOLatin1 encoding is
also needed.

Microsoft Windows however uses a variant of Type1 in which the font glyph data
is encoded in binary form. This is called PFB format. It may well be that font 
suppliers are more familiar with providing fonts in this format.

The process of loading fonts from whatever source for use by Display PostScript 
is not specific to Laser-Scan. You would do the same steps if the fonts were to 
be used by any Motif application using DPS (eg the Sun pageview viewer).
However it doesn't seem particularly well documented in any of the Sun
documentation we have seen, so these notes are intended to guide you
through the process.


Getting PFA Fonts
-----------------
If you have a Type1 font in PFB format and you need it in PFA for use by DPS,
then there are various ways of doing this (assuming you have a license to use
the font legally on this CPU):

1) Go back to your font supplier and ask for it to be supplied in Type1 PFA
   format.  This is often the best method!

2) On a Microsoft Windows PC, print a small document using the font using the
   PostSCript printer driver, with output going to a file (rather than a COM
   port). Then edit the resultant file with a text editor to extract the font
   definition section.  While doing this, ensure that there are appropriate line
   terminator characters (CR) at the end of each PostScript line, and every 80
   characters through the hexadecimal encoded data.

3) Use a conversion tool, such as the program `t1ascii' in the public domain
   `t1utils' package.  


Font directory and name
-----------------------
Having got your font in PFA format, then it needs to  have the correct name,
which is made up from the full PostScript font name (usually with `-' signs
between the words), and extension of `.pfa', eg `Times-Roman-Bold.pfa'

It is also important that the file be put in the correct directory which is
"/usr/openwin/lib/X11/fonts/Type1/outline"  This directory is owned by ROOT so
that creating new fonts must be done by a privileged account. Note also that
any new font files should have their protection  checked as 664 and their group
as `bin' to make sure that they have access allowed. E.g. `chmod 664 *.pfa' and
`chgrp bin *.pfa'.


Font Metrics Files
------------------
As well as the font file itself (which is read by the X-server), a second file
is needed which is read by applications software to get character size
information.  These files are known as AFM files (Adobe Font Metrics).  You
must ensure that you get one of these files with the PFA or PFB file from your
font supplier.  AFM files are plain ASCII text, so no conversion is needed.

Having got your AFM file, then it needs to  have the correct name, which is
made up from the full PostScript font name as for the pfa file above, but with
no extension eg `Times-Roman-Bold'.  

It is also important that the file  be put in the correct directory which is
"/usr/openwin/lib/X11/fonts/Type1/afm". This directory is owned by ROOT so that
creating new fonts must be done by a privileged account. Note also that any new
AFM files should have their protection  checked as 664 and their group as `bin'
to make sure that they have access allowed. E.g. `chmod 664 Times*' and `chgrp
bin Times*'.

If you wish to use multinational characters (such as e acute), then you will
need an ISOLatin1 encoded afm file.  This follows the same conventions as for
the standard Adobe encoding afm file, but has `-ISOLatin1' appended to its 
name, eg `Times-Roman-Bold-ISOLatin1'.  


Registering the new fonts
-------------------------
Once the files are in the right place, they need to be registered with the
display PostScript system. This remembers their names and locations in some
central resource files which have the extension `.upr'. These live in the
directory "/usr/openwin/lib/X11". As root, you must cd to this directory, and
then run the program `makepsres'. If this is not known directly, it can be
found in the directory "/usr/openwin/bin".


Using the new fonts
-------------------
Once the font files are in the correct format, names, and places, and are
registerd, then they are available to be used from from Laser-Scan LAMPS2
software.  The connection between LAMPS2 font names and the PostScript font
name is made using a lull initialisation file.called `afm_init_fonts.lull', and
this should be edited to include the new fonts. Use the existing entries as a
template. The four fields given are:
	(1) the gothic font name (eg Univers 45 light)
	(2) the PostScript font name (eg Univers-Light)
	(3) the encoding name (eg ISOLatin1)
	(4) the afm file name (eg Univers-Light-ISOLatin1)



Paul Hardy
31/8/95
