home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
utility
/
dtp
/
fontswap
/
fntswap.doc
< prev
next >
Wrap
Text File
|
1991-06-07
|
22KB
|
467 lines
FontSwap2
Postscript Typeface Substitution Utility
(Atari ST with monochrome monitor and at least 1 megabyte)
Copyright 1990, David Becker
When I first received Ultrascript ST1 (after much anticipation), I
found I was not able to use it with my desktop publishing program
of choice. Although Ultrascript came bundled with the Lucida and
Courier font families, these were not currently supported by Fleet
Street Publisher 2.0. My desktop publisher could write Postscript
to disk using Helvetica and Avante-Garde but my Postscript
interpreter could only print Lucida and Courier! Aaurgh!
I now realized the purchase of additional typefaces was necessary
but unfortunately not immediately affordable. What to do? The
Ultrascipt manual suggests using a word processor to search and
replace typefaces, however this proved difficult. Postscript is a
language not unlike Basic or Pascal. It demands correct syntax.
Fooling around with search and replace caused me nothing but
grief. After doing a little bit of homework I wrote a utility that
recognizes Postscript fonts and then allows you to replace the
fonts with others. Well, three months and over 90,000 bytes
later, I present you with FontSwap2, a full featured Postscript
Typeface Substitution Utility. Let's look at what FontSwap2 can
and can't do for you:
It WILL allow you to print someone elses Postscript page even if
you do not own the font with which it was originally designed. I
have often seen Postscript demos and pages on GEnie, Compuserve
and many local BBS systems. Some I could print, others defaulted
to Courier (which looks like it came from a monstrous typewriter).
It WILL allow rough proofing a document in many typestyles,
without having to re-enter the desktop publishing environment.
When you finally decide on the typestyle, you will no doubt wish
to reformat your page within your DTP package.
It WON'T kern or adjust text or line spacing for the new typeface.
Some typefaces parallel each other very closely in hight, width
and character spacing. Others don't. Once FontSwap2 has replaced
fonts there is no guarantee the page is going to print correctly.
Some conversions work beautifully, others look horrid. Trial and
error! Experimentation is your responsibility.
OK, lets convert a Postscript file. I have included a demo
file called DEMO.PS, but first double-click on FONTSWAP.PRG.
The first selection box gives you three choices,
LOAD INFO CONFIG
INFO displays a brief introductory screen for the folks who
don't read documentation.
We will talk about CONFIG a little later on.
Let's start by clicking on LOAD. You are now presented with the
Atari file selector. Choose DEMO.PS and this Postscript file will
load and processing will begin. FontSwap2, in processing the
file, looks at every single line to see if it contains any one of
a possible 132 fonts. As you can well imagine, given a large file,
this can take some time. Actually, the average Postscript file
processes in under 30 seconds, a 300K file in about 1 minute. I
have included a graphic routine that draws little processing
plants and tells you how much of the file has been analyzed. To
cancel the processing routine, hit UNDO or click both mouse
buttons at the same time. Mind you, the only option available to
you if you do this will be the text editor! If, after processing,
FontSwap2 has not found any fonts, you will be dumped into the
OPTIONS screen. However, having found some fonts within the file,
you will be shown the FONTS FOUND SCREEN.
FONTS FOUND SCREEN
Here is a list of every typeface found within the Postscript file.
Pressing or clicking HELP will bring up a brief window of helpful
reminders (HELP is available from any screen within the program!)
To abort the font selection sequence you can click or hit UNDO.
Choose the font you wish to replace either by entering its number
and pressing RETURN or by pointing and clicking with the mouse.
FontSwap2 will remove the chosen font and then offer us a choice
of replacements.
REPLACEMENT FONTS SCREEN
Depending on the configuration of your FONTSWAP.DAT file (more on
this later), you will be presented with one of up to three screens
filled with replacement fonts. Once again, HELP is available as an
option. Click or hit RETURN to page through the font listings (the
right button also works). Click or hit 'C' and you can enter a
custom replacement font, anything you want! Hit UNDO to abort the
whole sequence. Enter the number or click on the typeface of your
choice and it will be selected as the replacement. After a quick
switch routine, you will once again find yourself in the FONTS
FOUND SCREEN (the fonts have now been swapped!). You can continue
replacing fonts or simply hit UNDO for the OPTIONS SCREEN.
OPTIONS SCREEN
This is the hub of the program. From this screen you can choose to
do just about anything. Let's look at the options in order:
(1) This will take you to the MANUAL FONT EDITOR, a custom text
editor containing ONLY the lines that were found to contain fonts.
You may edit and change the contents of these lines but you may
not delete or add lines with the FONT EDITOR. Here are the
features offered within this text editor,
Cursor flash..............F1
Invert screen colours.....F2
Key click.................F3
Postscript operators......F4
Copy line into buffer.....F5
Use line buffer...........F6
Search....................<Control>S
Search & Replace..........<Control>R
Resume search.............F10
Block start...............<Control>A
Block end.................<Control>Z
Use the block.............<Control>U
Clear the block...........ESC
Top of file...............<Control>T or <HOME>
Bottom of file............<Control>B
Page up...................<Shift>Up-Arrow
Page down.................<Shift>Down-Arrow
Scroll up.................Up Arrow
Scroll down...............Down Arrow
Safety buffer.............<Control>Undo
Information...............HELP
Abort to options..........UNDO
Print all fonts...........<ALT>P
Print the page............<Control>P
Mark a line...............<Control>M
Jump to the mark..........<Control>J
The MANUAL LINE EDITOR contains many more features. Check out the
docs on option five below for a detailed account of all the bells
and whistles.
(2) This choice returns you to the FONTS FOUND SCREEN so that you
can replace more typefaces.
(3) Loads a new Postscript file into memory. This will replace the
existing file. You will be prompted if there is an active file.
(4) Save the altered Postscript file in memory to disk. Make
sure you do not overwrite the original file! Use backups!
(5) Here is the MANUAL FILE EDITOR. With this text editor you can
edit the complete Postscript file listing. Delete, insert and
vandalize to your hearts content. A word of warning, if you do not
understand Postscript, don't fool around. One wrong or missing
letter can mess up the whole file. If Ultrascript cannot
understand the listing it simply won't print correctly (if at
all!).
At the bottom of the screen you will see the FontSwap2 command
line. It displays (from left to right), the line number, scroll or
edit mode, manual or automatic scrolling, fast or smooth scroll
and either system memory or the content of the line buffer.
Use the arrow keys to scroll around the file. When you make
changes to anything the window within the command line changes
from SCROLL to EDIT.
CURSOR (blinking or solid). ..............................F1
INVERT SCREEN COLOURS (black to white/white to black).....F2
KEY CLICK (shut off that irritating noise!)...............F3
POSTSCRIPT OPERATORS......................................F4
This option brings up a window containing most of the
operators used with the Postscript language. Use it as a
quick reference when searching for that elusive line.
COPY LINE INTO BUFFER.....................................F5
Any one line can be stored in this buffer for subsequent
insertion or replacement elsewhere using F6. The MEMORY
indicator within the command line changes to show the
current line number held in the buffer. Use F5 again to
clear the buffer and restore the MEMORY indicator. You can
also activate the line buffer by clicking in the MEMORY
window at the bottom.
USE LINE BUFFER (insert or replace).......................F6
LIST FONT LINES...........................................F7
A little black box will appear within the command line
showing every line that was found to contain a font. Hit
F7 again to remove the box.
SMOOTH/FAST SCROLL........................................F8
Shifts between regular fast scrolling and a very slow but
smooth screen scroll. You can switch between the two with
F8 or by clicking within this box with the mouse.
AUTO/MANUAL SCROLL........................................F9
Watch the screen scroll all by itself! Any key stops the
listing (or if you are using fast scroll, hold down the
right mouse button to slow things down). Toggle between
manual and auto with F9 or by clicking within the box.
SEARCH............................................<Control>S
Enter a string (upper and lower case sensitive) to search
for. The cursor will jump to the line first found to
contain the same string. Use F10 to continue searching
from the next line.
SEARCH & REPLACE..................................<Control>R
You will be prompted not only for a search string but also
for a replacement. FontSwap2 will hunt down and replace
every occurrence without asking for confirmation!
BLOCK START.......................................<Control>A
This is the beginning of a block you will later PRINT, SAVE
to disk or DELETE. The chosen block of text will appear in
bold format. ESC will clear the contents of the block as
will exiting the text editor.
BLOCK END.........................................<Control>Z
USE THE BLOCK.....................................<Control>U
Here you will be shown an alert box allowing you to PRINT,
SAVE to disk or DELETE the bold block of text. If you
change your mind at the last minute, choose SAVE and then
CANCEL from the fileselector.
GOTO ANY LINE.....................................<Control>G
You will be prompted to enter a line number to go to. You
can also click on the line number indicator to call this
function.
TOP OF FILE (jump to the start).....<Control>T or <CLR-HOME>
BOTTOM OF FILE (jump to the end)..................<Control>B
PAGE UP (scroll up one screen)...............<Shift>Up-Arrow
PAGE DOWN (scroll down one screen).........<Shift>Down-Arrow
INFORMATION (help screens are always available).........HELP
QUIT TO THE OPTION SCREEN (all changes remain)..........UNDO
PRINT EVERYTHING......................................<ALT>P
Make sure your printer is online. The printout is
continuous so you may wish to set the 'skip perforation'
mode on your printer. Hit any key or the mouse button to
cancel printing at any time.
PRINT THE PAGE....................................<Control>P
Only text on the screen is sent to the printer.
MARK A LINE.......................................<Control>M
The line at the cursor changes to light text for instant
recall at any time using <Control>J. ESC clears the mark.
JUMP TO THE MARK (Flies to the marked line!)......<Control>J
LINE NUMBER INDICATOR.............................<Control>L
This switches the line number indicator within the command
line on and off. This speeds up the screen scroll a bit.
INSERT A BLANK LINE AT THE CURSOR.....................Insert
DELETE THE LINE AT THE CURSOR..................<Shift>Delete
SAFETY BUFFER..................................<Control>Undo
You can restore any changes made to the last line by
placing the cursor back to the beginning of the line and
hitting <Control> & Undo at the same time.
This text editor was not meant to have all the features of a
word processor. I have included only those that I thought
would be needed when making changes to a Postscript file.
(6) Forces re-processing of the entire Postscript file. FontSwap2
will clear all font lines and typefaces found and start analyzing
again from the beginning! You may need this option if you bypassed
processing after the initial load (UNDO or both buttons aborts
processing). FontSwap2 is smart enough to remember font lines even
after extensive editing or deletions using the text editor but I
have included this option as a safeguard anyway.
(7) Quit to the desktop (UNDO does the same thing). You will be
prompted for confirmation if there is an active file in memory.
(8) Dave's undocumented Postscript demo. Wow, what's that?
Don't forget that HELP is available anytime, in any screen.
CONFIG
OK, let's talk about the configuration option at the start of the
program. When run, FontSwap2 looks for a data file called
FONTSWAP.DAT within the same directory. This file can contain your
own list of font descriptions. No doubt you will own fonts that I
have not included within the default setup. If FONTSWAP.DAT is not
found, the default library will become active. The default library
includes the following typefaces:
Times-BoldItalic
Times-Bold
Times-Italic
Times-Roman
Helvetica-BoldOblique
Helvetica-Bold
Helvetica-Oblique
Helvetica
BrushScript
Hobo
AvantGarde-BookOblique
AvantGarde-Book
AvantGarde-DemiOblique
AvantGarde-Demi
Bookman-LightItalic
Bookman-Light
Bookman-DemiItalic
Bookman-Demi
NewCenturySchlbk-BoldItalic
NewCenturySchlbk-Bold
NewCenturySchlbk-Italic
NewCenturySchlbk-Roman
Palatino-BoldItalic
Palatino-Bold
Palatino-Italic
Palatino-Roman
Courier-BoldOblique
Courier-Bold
Courier-Oblique
Courier
Stencil
LucidaHebrew-Typewriter
LucidaHebrew
LucidaSymbol
LucidaSans-TypewriterBoldOblique
LucidaSans-TypewriterOblique
LucidaSans-TypewriterBold
LucidaSans-Typewriter
LucidaSans-BoldItalic
LucidaSans-Italic
LucidaSans-Bold
Lucida-BoldItalic
Lucida-Bold
Lucida-Italic
LucidaSans
Lucida
ZapfDingbats
ZapfChancery-MediumItalic
To create or edit your own FONTSWAP.DAT file simply click on
CONFIG at the opening screen. If present, FONTSWAP.DAT will be
loaded from disk and you will be able to edit it within the text
editor. If not, you can build your own from scratch. The first
line MUST contain the following string,
FontSwap2 Data File
This will automatically be inserted into the text editor for you.
Do not delete it! Type in your font names, one on each line to a
maximum of 132 (133 lines if you count 'special line one').
Now I am going to make things confusing (sorry).
Many typeface descriptions contain the same words and/or the same
strings of words. One problem FontSwap1 had was confusing fonts
within the same family. Example:
AvanteGarde-BoldOblique might be confused with AvanteGarde-Bold
---------------- ----------------
\ /
---------> These strings match <---------
Why? Because FontSwap2 searches each line from left to right. If
it were told to search for AvanteGarde-Bold first, it would see
AvanteGarde-Bold within AvanteGarde-BoldOblique! To prevent this
from happening, we search the long font description first and not
finding it, continue our search for the shorter font description.
I therefore request that you type in your font descriptions (the
ones that contain the same strings) in descending order (longest
to shortest). Here is a good example:
Bookman-LightItalic
Bookman-Light
Bookman-DemiItalic
Bookman-Demi
Take a look again at the default font list above for more
examples. You can use all of the features available within the
text editor to add and delete fonts until you are happy with your
finished list. Please do not include blank lines anywhere in the
list. Pressing UNDO will prompt you to save FONTSWAP.DAT to disk.
It will overwrite any existing file of the same name, so be
careful! After editing or creating a new FONTSWAP.DAT file there
is no reason to re-boot. The new font file is now active in memory
and you may continue by loading a Postscript file.
It would be nice if someone could upload a FONTSWAP.DAT file
containing every typeface offered by Imagen, mind you, the larger
the font list, the longer processing takes. Try and keep your
FONTSWAP.DAT file lean!
In order to find the exact spelling for each font you must look
into the UMETRICS folder on your Ultrascript disk. Here, each
typeface has its own corresponding .AFM file. Some examples are:
Courier uses COUR.AFM
Lucida Italic uses LUCI.AFM
Double click on any one of these files from the desktop to view
them. Find the fourth line from the top. This line begins with
'FontName', then a space, then the actual font name. For example:
FontName Lucida-Italic
-------------
/
/
This is the font name you should enter into FONTSWAP.DAT. Just the
way you see it. One font per line. No spaces. Make yourself up a
list as you view your .AFM files, then enter this list into
FONTSWAP.DAT all at once. You may be OK using just the default
library. It contains the most popular typefaces.
I have successfully converted Postscript files from Fleet Street
Publisher 2.0 and Pagestream 1.8 without any problems.
Please feel free to contact me,
GEnie mail to D.Becker8
My home address is,
211-7291 Moffatt Road
Richmond, BC, Canada
V6Y1X9
Check out my other programs available on-line,
cdBASE (compact disk database)
Portfolio Partner (ST/Portfolio address base)
SmartDate (automatically sets your system date)
April 2, 1990 Notes
--------------------
I find my SLOW scroll routine to be incompatible with TurboST.
This is unfortunate because TurboST really speeds up my fast text
scroll within the editor. I have therefore re-written the SLOW
scroll routine to be compatible with TurboST. The new routine is a
bit jumpy (but I can't see SLOW scroll getting a lot of use anyway.)
*********************************************************************
* The CONFIG editor will now automatically sort your font listing *
* correctly when you press "CONTROL/SHIFT A" *
*********************************************************************