
V1.25	PostScript System - some information I Parker 14 Aug 92


HPGL	  Hewett Packard Graphic Language - this is the file format
	  for controlling plotters and image setting machines, it 
	  contains everything in graphic form, bitmap images cannot
	  be placed in these files, only vector graphic images made
	  up of xy co-ordinates.

HP PCL   Hewett Packard Printer Control Language.

Gerber   output of cad package for making pcb's produces various files
         for pcb, layers, silkscreen, drill template ect.

DXF      Drawing Exchange Format: cad language storage file format.

IGES	 cad language storage file format.

Bitmapimage - picture made up of pixels (dots), 16 21 24 or 32 bit.
              see graphics doc

vectorgraphic - picture made up of co - ordinates.

Postscript is the file format for controlling printers and type setting
	   machines, it can contain fonts and graphics, or just indicate
	   where the fonts can be found and contain the graphics.

EPS - Postscript encapsulated file which may be imported into page
      layouts as a graphic in dtp programs. It cannot be printed directly.

AI - Adobe Illustrator; subset of postscript which makes it possible to
     edit the files in a drawing program.

	There are three types of adobe (postscript) fonts:-

	Type 1: Known as hinted outline, which are either downloaded
        to a printer on request	from the printer. Or as part of a
        postscript file which is sent to the printer. Composed
        of third degree bezier curves(Start and stop points with two
        points inbetween).

	Type 2: Unknown.

	Type 3: Unhinted outline, these have to be downloaded to a
	printer before use.

file extensions:

.PFA Printer Font Ascii Adobe type 1 shape of font in hex format ie like
     the one inserted into the postscript file if the font data is included
     in file.

.PFB Printer Font Binary This is the actual shape of the font, it
     does'nt have to have the extension to work.

.AFM Adobe font metric contains graphic spacing data for printing. This
     is required on amigas and some IBM applications, others and mac
     computers use pfm files instead.

.PFM Printer font metric file alternative method of graphic spacing

.PPD printer font download file for applemac computers.

18.abf 18 point adobe binary font (screen font).

ATM Adobe type manager, will load a font from either afm or pfm file.

Dictionary Keywords:-

FontMatrix An array that converts character coordinates into user
	   coordinates.

VMUsage    I think this is the memory used by the font first number for
           one character the second for hole font.

FontType   A number that indicates where the information for character
	   descriptions is to be found and how it is represented.

FontBBox   An array of four numbers in the character coordinate system
	   that gives lower-left x, lower-left y. upper-right x,
	   and upper-right y for the box that encloses all characters in
	   the font, called the font-bounding box. This box is just
	   large enough to enclose all marks made by any character
	   in the font, if all the characters were printed one on
	   top of the other at the same point.

Encoding   An array of 256 names that maps the character codes (the 
	   numberic values) to a set of character names.

FID        FontID a entry that serves internal purposes in the font
	   machinery and that is automatically created by the
	   definefont operator.

POSTSCRIPT BUILTIN FONTS

FontName   Contains the fonts postscript name. This is for information
	   only; it is not used by the font machinery.

PaintType  A code that indicates how the characters in the font are to
	   be painted. The valid codes are as follows:
		0 characters are filled
		1 characters are stroked
		2 characters are outlined
		3 characters fill or stroke (or a combination of these)
		  
StrokeWidth The stroke width in character coordinate units for outlined
	    fonts. This field is not initially present in filled fonts
	    and must be created when making an oulined font from a 
	    filled font.

UniqueID    An integer identifier for this font; it must be unique to
	    the font, no matter how slight its difference may be from
	    another font, should have its own uniqueID value. This entry
	    is not required; but if it is present, it will be used by the
	    font-cache mechanism to help the cache run more efficiently.

CharString  Associates character names (from Encoding) with shape descrip-
	    tions in a proprietary, protected format.

Private     contains protected information about the font.

Metrics     Dictionary may contain width and sidebearing information for
	    any character in the font. This entry is not normally
	    present in built-in fonts; if it is present, it will
	    override the widths and side bearing encoded in the
	    character description of whatever characters are included 
	    here.

FontInfo    Contains optional information about the font. This information
	    is entirely for the benefit of PostScript programs that use
	    the font; the PostScript font machinery ignores this information
	    Other systems use it ie:-
	Notice     Copyright message.
	FullName     The full text name of the font.
	FamilyName   The name of the font family to which this font belongs.
	Weight       The weight of the font: ie bold light.
	Version      The fonts version number
	ItalicAngle  The angle in degrees counter clockwise from 90 deg
	             of the dominant vertical strokes of the font.
	isFixedPitch A value that, if true, indicates that the font is
	             fixed-pitch (monospaced) font.
	UnderlinePosition The distance in character-coordinate units 
	             from the baseline of the characters to the underline.
	underlineThickness The stroke width in character-coordinate
	             units for the underline.

WX field	Character spacing in a decoded font in the vector shaping
                data, in the first encode word 25 540 hsbw the 25 is the first
                value in the B box data the 540 will be the WX file spacing
                which can be found in the AFM/PFM files. (ie the tieup data) 
C field		Ascii character codes in decimal
N field		Ascii character. Note that the N field name must be the same
                as the dup field name in a pfa/pfb decoded file ie:-
dup 20/DC4 put dup 21/onehalf put dup 22/onequarter put dup 23/onesuperior put
                so 20/DC4 means decimal 20 is N DC4 (device control 4)
                this is what ties the afm/pfm files to the pfa/pfb files 
                character by character.
B field		Bound box for character. The second field in the vector shaping
                data of a decoded pfb file ie -2 20 hstem. The -2 is the
                second data element of the b box data in the AFM file.

Font Matrix array (size)
eg [.001 0 0 .001 0 0]
1st element is multiplier for x co-ordinates
4th element is multiplier for y co-ordinates
[.012 0 0 .012 0 0] would be 12 point

Note different applications and machines use different information fields
to calculate information. ie pagestream uses:-

Fullname - is used to place the font name in the font box (IBM and apple-
mac dont use this).

Family - used to tie .pfb .afm .pfm .abf files together, so they may be
used in one font ie as bold italic inverse ect. Used in all systems.

Weight - Used in the type box (not used on IBM or applemac).

BBox - not used in pagestream but are used on other systems.

	Both applemac and IBM have font management programs. IBM's is
the adobe font manager which allow the fonts to be down loaded
(via the .ppd files on applemacs) to the printer. Also it is
possible to manipulate (not edit) there size, spacing or filled
with patterns or colours.

Font Types:-

Outlined May be rendered as either an outline or filled shape.

Hinted It means that if you reduce the point size although the lines the
font are made up of will reduce in width, they will never get so small
that they will disapear.

Stroked Made up of lines, limited filling options

Bitmapper Small graphic objects

Subtypes:-

Serif - have small flurish orniments ending lines (eg times)

Sans Serif - no ornimentation (eg helvetica)

Typewriter - not in other two groups (eg courier)

Proportional - character spacing changes depending on letters

Nonproportional - character spacing fixed

Roman - The upright version of a particular typeface. Also called
        Normal, Regular, Book Medium Antique or Gothic.

Example of 100% Amiga compatable adobe 1 AFM font file
StartFontMetrics 2.0
FullName Bauhaus
FamilyName Bauhaus-Bold
Weight standard
Comment Generated by Metamorphosis 4/13/91 11:05:31 PM 
FontName Bauhaus-Bold
Notice Copyright (c) 1989 Adobe Systems Incorporated. 
All Rights Reserved.Bauhaus is a registered trademark
of International Typeface Corporation.
ItalicAngle 0.0
IsFixedPitch false
UnderlinePosition -100
UnderlineThickness 50
Version 001.000
EncodingScheme AdobeStandardEncoding
FontBBox -167 -226 1000 966
CapHeight 700
XHeight 486
Descender -210
Ascender 700
StartCharMetrics 229
C 32 ; WX 278 ; N space ; B 0 0 0 0 ; 
ie ascii number ; character spacing ; ascii chr ; box co-ordinates
ect.

Note a fontmetrics 3.0 file has the ascii char and box co-ords fields missing,
depending on application they may have to be re-inserted.

Example of 100% compatable adobe 1 PFB font file
%!PS-AdobeFont-1.0: Bauhaus-Bold 001.001
%%CreationDate: 4/13/91 11:05:31 PM 
%%VMusage: 1024 22131
 
% Generated by Metamorphosis Professional 2.0
% Copyright (c) 1989 Adobe Systems Incorporated.
All Rights Reserved.Bauhaus is a registered trademark of International
Typeface Corporation.
FontDirectory/Bauhaus-Bold known{/Bauhaus-Bold findfont dup/UniqueID
known{dup/UniqueID get 0 eq exch/FontType get 1 eq and}{pop false}ifelse
{save true}{false}ifelse}{false}ifelse
12 dict begin
/FontInfo 9 dict dup begin
 /version (001.001) readonly def
 /FullName (Bauhaus-Bold) readonly def
 /FamilyName (Bauhaus-Bold) readonly def
 /Weight (Medium) readonly def
 /ItalicAngle 0 def
 /isFixedPitch false def
 /UnderlinePosition -100 def
 /UnderlineThickness 50 def
 /Notice (Copyright (c) 1989 Adobe Systems Incorporated.
 All Rights Reserved.Bauhaus is a registered trademark of International
 Typeface Corporation.) readonly defend readonly def
/FontName /Bauhaus-Bold def
/Encoding StandardEncoding def
/PaintType 0 def
/FontType 1 def
/StrokeWidth 0 def
/FontMatrix[0.001 0 0 0.001 0 0]readonly def
%/UniqueID 0 def
/FontBBox{-167 -226 1000 966}readonly def
currentdict end
currentfile eexec

Note if you use a font on an IBM there may only be eight characters
in its name, also some applications require the .pfb extension and
some do not. If you are going to download your fonts after the word
UniqueID you must place a unique number in the range 0 - 65535.
Some applications require the pfb name to be the same as the internal
font name.

If you find characters missing from your fonts, or areas missing from
vectorgraphic images its because of the memory allocation for different data
types, one way round this is to reduce the DPI of a printout, the other
is to send the file to the printer in postscript format if this is
possible for your printer. The reasion this works is because the font/
vector graphic data is inserted into the file at one size together with
an enlargment/reduction factor to be worked out by the postscript device.

The postscript output file consists of a header, a prologue file (which
may be edited), and page details. The fonts can be either encrypted into
the postscript file or downloaded separatly. If you are going to download
them separatly you may have to turn them into ascii (.pfa) files with
the program T1ascii so they can be transferred The resulting file can then
be sent to a postscript device or printed through a postscript interpreter.
The file can be anything upto 150mbytes so removable cartridges are usualy
used. But Adpro's split and join programs can be used the split a large
file into fragments, put it on many disks then rejoin it on another 
machine (amiga,ibm,mac).
The prologue file of pagestream resides in the printers drawer, and is
copied to the postscript output file when it is generated. This is so
it may be edited once and will always modify your file afterwards.

If you want to print a colour postscript page on a black and white
printer, you must split the postscript file into cyan, magenta, yellow
and black fragments. You will find four areas in the file vis:-

% Begin Page
% Begin Tile
("untitled", Page #1, Process Cyan)

(If you have any spot colours like flouesent green (special inks)
you may have more than four sections.)

   one for cyan, magenta, yellow and black, you must create four files
be leaving a set of page information for each of the colours in the
file and errasing the information for the other colours. If your going
to download the fonts you now have four files to send to the interpreter
but if your font data is included in the postscript file you must move
it, as the font data is in the cyan colour area, and the information
to print the text will be in the black area.
   You will find a font header/s similar to the ones in the document, with
encode font information after it/them, clip all this data and remove it
from the cyan area to the same location in the black data (unless the
font is in colour of course). 

   To set pagestream up to send colour, select the postscript driver,
select send to file, select color in the special gadget, and when you
print select four colour separations. 

When you've created your four postscript files, you have to convert them
into printer binary files. I'm using a HP deskjet 500, so i'm using
the interpreter/driver (postlj) from the post1.7 archive, with
the command "postlj -j0 init.ps filename/colour.ps TO
 CYAN/MAGENTA/YELLOW/BLACK" which creates the four printer binary files.
Next you place your cyan cartridge in the printer and send the cyan
information to it, ie "copy CYAN to par:", and the same with the other
colours.
For best colour results of bitmap pictures (any format) they should be
corrected by +15% gamma to adjust for paper images from screen display
images. Also take into account the DPI of the scanner, with respect to
the DPI of the printer. 

You can get ink kits for places like system insight england 0727 827200.

ASCII Table (numbers in hex) (american standard code for information
			      interchange)
nr  alt   char      nr  alt   char      nr  alt   char      nr  alt  char
00  80    NULL      20  A0    SPACE     40  C0    @	    60  E0   '
01  81    SOH       21  A1    !         41  C1    A         61  E1   a
02  82    STX       22  A2    "         42  C2    B         62  E2   b
03  83    ETX       23  A3    #         43  C3    C         63  E3   c
04  84    EOT       24  A4    $         44  C4    D         64  E4   d
05  85    ENQ       25  A5    %         45  C5    E         65  E5   e
06  86    ACK       26  A6    &         46  C6    F         66  E6   f
07  87    BELL      27  A7    '         47  C7    G         67  E7   g
08  88    BS        28  A8    (         48  C8    H         68  E8   h
09  89    HT        29  A9    )         49  C9    I         69  E9   i
0A  8A    LF        2A  AA    *         4A  CA    J         6A  EA   j
0B  8B    VT        2B  AB    +         4B  CB    K         6B  EB   k
0C  8C    FF        2C  AC    ,         4C  CC    L         6C  EC   l
0D  8D    CR        2D  AD    -         4D  CD    M         6D  ED   m
0E  8E    SO        2E  AE    .         4E  CE    N         6E  EE   n
0F  8F    SI        2F  AF    /         4F  CF    O         6F  EF   o
10  90    DLE       30  B0    0         50  D0    P         70  F0   p
11  91    DC1 Xon   31  B1    1         51  D1    Q         71  F1   q
12  92    DC2 Xoff  32  B2    2         52  D2    R         72  F2   r
13  93    DC3 Xoff  33  B3    3         53  D3    S         73  F3   s
14  94    DC4       34  B4    4         54  D4    T         74  F4   t
15  95    NAK       35  B5    5         55  D5    U         75  F5   u
16  96    SYNC      36  B6    6         56  D6    V         76  F6   v
17  97    ETB       37  B7    7         57  D7    W         77  F7   w
18  98    CAN       38  B8    8         58  D8    X         78  F8   x
19  99    EM        39  B9    9         59  D9    Y         79  F9   y
1A  9A    SUB       3A  BA    :         5A  DA    Z         7A  FA   z
1B  9B    ESC       3B  BB    ;         5B  DB    [         7B  FB   {
1C  9C    FS        3C  BC    <         5C  DC    \         7C  FC   |
1D  9D    GS        3D  BD    =         5D  DD    ]         7D  FD   }
1E  9E    RS        3E  BE    >         5E  DE    ^         7E  FE   ~
1F  9F    US        3F  BF    ?         5F  DF    _         7F  FF   DEL

Use this table to determine what keys can be used with the control key
to obtain a control code. First find the desired code in the first 
column. Then read across that line to find the two or three keys which
produce that character when pressed with control.
For examplse, LF can be obtained by pressing control with one of the
following: * j shift J The del character is the only one that
can't be obtained using the control key.

null all zero's			soh  start of heading
stx  start of text		etx  end of text
eot  end of transmission	enq  enquiry
ack  acknowledge		bell bell
bs   backspace			ht   horizontal tab
ff   form feed			cr   carrage return
so   shift out			si   shift in
dle  data link escape		dc1-4  device control 1-4
nak  no acknowledged		sync synchronous idle
etb  end of text block		can  cancel
em   end of media		sub  substitute
esc  escape			fs   file separator
gs   group separator		rs   record separator
us   unit separator

Usefull amiga programs
FC - Soft Logic Converts AppleMac adobe 1, adobe3 fonts to IBM, and apple-
     mac screen fonts to abf format. Note applemac files have a small
     preheader which contains the icon data

Unsit - Breaks applemac files into resource and data units for file
        conversion.

FixFont - Soft Logic Automaticaly inserts any adobe keywords pagestream
          requires into a font, it the keywords are missing.

MakeMac - Soft Logic Takes unsit files (applemac) and rejoins them with
          a correct applemac header.

MI-M2I - Gary Brusanowski Converts applemac fonts into ibm adobe1 fonts. 

T1ascii - Lee Hetherington converts pfb files to pfa format

T1binary - converts pfa files to pfb

T1disasm - disassembles a type-1 font (pfa or pfb) into raw text.

T1asm - assembles type 1 font into pfa or pfb format

unpost - extracts post resources from macintosh type 1 fonts

PFMTOAFM - Ken Borgendale Generates afm files from pfm.

Post V1.7 - Adrian Aylward postscript interpreter.

MKBMAP - Creates amiga bitmap fonts from postscript fonts.

Resetadobe - I Parker & D Spencer corrects afm spacings

Note adobe fonts will work on IBM applemac amiga atari and archimedes
machines but require a small amount of modification.

The font utilities in pro-page 3.0 will allow conversion between adobe1
to AGFA compugraphic. Versions which are better have been released by Gordon
Fecyk see the Fred Fish collection.

Note CorelDraw's font manager can convert to adobe1 fonts but you must 
delete the extra space on lines 14 & 15 in the words UnderlinePosition
and UnderlinThickness.



Extract of decoded adobe type1 pfb file

%!FontType1-1.0: BlackForest 001.001 /* identifies the type of font and pitch */
%%CreationDate: 7/25/90 8:36:30 PM   /* creation date */
%%VMusage: 1024 24444
 
% Generated by Fontographer 3.1      /* what generated by */
% v1.0 ShareWare $10 PoBox 1828 Easton MD 21601 /* copywrite */
FontDirectory/BlackForest known{/BlackForest findfont dup/UniqueID known{dup
/UniqueID get 4106915 eq exch/FontType get 1 eq and}{pop false}ifelse
{save true}{false}ifelse}{false}ifelse /* unique identifier for font cashes */
12 dict begin
/FontInfo 9 dict dup begin
/FullName (BlackForest) readonly def
/FamilyName (BlackForest) readonly def
/Weight (standard) readonly def
 /version (001.001) readonly def
 /ItalicAngle 0 def
 /isFixedPitch false def
 /UnderlinePosition -133 def
 /UnderlineThickness 20 def
 /Notice (v1.0 ShareWare $10 PoBox 1828 Easton MD 21601) readonly def
end readonly def
/FontName /BlackForest def
/Encoding 256 array
dup 0/NUL put dup 1/Eth put dup 2/eth put dup 3/Lslash put
dup 4/lslash put dup 5/Scaron put dup 6/scaron put dup 7/Yacute put
dup 64/at put dup 65/A put dup 66/B put dup 67/C put

/* the above identify the ascii code to the character ie 65 = A */

readonly def
/PaintType 0 def
/FontType 1 def
/StrokeWidth 0 def
/FontMatrix[0.001 0 0 0.001 0 0]readonly def
/UniqueID 4106915 def
/FontBBox{-35 -201 1088 735}readonly def
currentdict end
currentfile eexec
userdict/RD{string currentfile exch readstring pop}executeonly put
userdict/ND{noaccess def}executeonly put
userdict/NP{noaccess put}executeonly put
dup/Private 11 dict dup begin
/BlueValues [-10 0 490 494 667 677 734 739]ND
/MinFeature{16 16}ND
/password 5839 def
/UniqueID 4106915 def
/StdHW[22]def
/StdVW[134]def
/StemSnapH[22 45 66 89 ]def
/StemSnapV[23 44 67 134 ]def
/Subrs 9 array
dup 0 {
	3 0 callothersubr
	pop
	pop
	setcurrentpoint
	return
	} NP

ND
end NP
dup/CharStrings 151 dict dup begin
/.notdef {
	0 280 hsbw
	endchar
	} ND
/space {
	0 250 hsbw
	4 callsubr
	0 vmoveto
	endchar
	} ND
/exclam {
	130 285 hsbw
	0 134 vstem
	1 134 hstem
	201 vmoveto
	139 hlineto
	401 vlineto
	-139 hlineto
	closepath
	-601 vmoveto
	139 hlineto
	135 vlineto
	-139 hlineto
	closepath
	endchar
	} ND
/A {                /* the vectorgraphic shape of uppercase A */
	-3 670 hsbw /* the first bbox entry and the spacing
	134 23 vstem /* the second bbox entry */
	158 23 vstem
	0 23 vstem
	666 -89 hstem
	2 89 hstem
	200 45 hstem
	379 -45 hstem
	490 -22 hstem
	-110 22 hstem
	158 22 hstem
	247 334 rmoveto
	-23 -88 rlineto
	-43 hlineto
	-47 -47 rlineto
	-42 vlineto
	23 -23 rlineto
	24 hlineto
	-23 23 rlineto
	43 vlineto
	52 hlineto
	-37 -110 rlineto
	-83 hlineto
	-90 -88 rlineto
	-88 vlineto
	24 -24 rlineto
	87 hlineto
	24 24 rlineto
	23 vlineto
	-24 -24 rlineto
	-88 hlineto
	89 vlineto
	294 hlineto
	88 88 rlineto
	-179 hlineto
	17 68 rlineto
	248 hlineto
	45 -90 rlineto
	-67 -66 rlineto
	104 hlineto
	86 86 rlineto
	-189 370 rlineto
	135 vlineto
	-73 73 rlineto
	-304 hlineto
	-88 -88 rlineto
	-88 vlineto
	24 -24 rlineto
	87 hlineto
	24 24 rlineto
	24 vlineto
	-24 -24 rlineto
	-88 hlineto
	87 vlineto
	286 hlineto
	-55 -198 rlineto
	-56 hlineto
	-45 -45 rlineto
	-42 vlineto
	25 -25 rlineto
	24 hlineto
	-25 25 rlineto
	42 vlineto
	closepath
	263 -88 rmoveto
	-180 hlineto
	60 243 rlineto
	closepath
	-72 -288 rmoveto
	216 hlineto
	12 -22 rlineto
	-232 hlineto
	closepath
	endchar
	} ND


end
readonly put
dup/FontName get exch definefont pop
mark currentfile closefile

Extract of corrisponding AFM file

StartFontMetrics 2.0  /* notice version 2.0 file (full data) */
Comment Generated by Fontographer 7/25/90 8:36:31 PM 
FontName BlackForest
FullName BlackForest
FamilyName BlackForest
Weight standard
Notice v1.0 ShareWare $10 PoBox 1828 Easton MD 21601
ItalicAngle 0.0
IsFixedPitch false
UnderlinePosition -133
UnderlineThickness 20
Version 001.000
EncodingScheme AppleStandard /* notice standard encoding */
FontBBox -35 -201 1088 735
CapHeight 667
XHeight 490
Descender -200
Ascender 734
StartCharMetrics 150

/* the following are in the order ascii code ; spacing; chr name;bounding box */
C 32 ; WX 250 ; N space ; B 0 0 0 0 ; 
C 33 ; WX 285 ; N exclam ; B 130 0 268 601 ; 
C 65 ; WX 670 ; N A ; B -3 -110 656 666 ; 

C  -1 ; WX  376 ; N asciicircum ; /* dont know what these are */
C  -1 ; WX  376 ; N asciitilde ;
C  -1 ; WX  192 ; N quoteright ;

EndCharMetrics
StartKernData
StartKernPairs 36 /* kerning data (adjusts spacing if adjacent characters
                     as stated */
KPX quotesingle s -32
KPX A T -32
KPX F comma -136

EndKernPairs
EndKernData
EndFontMetrics

Compugraphic fonts:- Better at small point sizes on DMP printers
poor at large sizes. Use second degree bezier curve formed (made by a
single control point between start and stop points and drawn with
a particular equation).

A none adobe standard writen by agfa:- there are two main systems
xxx.atc      the encoding table
xxx.dat      pro page related data
xxx.metric   spacing and width information
xxx.lib      font definition chr outlines (encoding and spacing data) 
xxx.type     same as xxx.lib
xxx.font
xxx.otg
plugin.types same as plugin.typebucket in pagestream
if.fnt
if.ss

