home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
PRINTING
/
SF2AU091.ZIP
/
SFP2AUTO.DOC
< prev
next >
Wrap
Text File
|
1992-04-15
|
22KB
|
544 lines
SFP2Auto
Create HP AutoFont Support files from HP LaserJet Softfonts
Version 0.91
Copyright (c) 1992 by Small Planet Software
All Rights Reserved
THIS PROGRAM IS DISTRIBUTED FREELY. THIS PROGRAM IS
PROVIDED ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE
QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.
SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
IN NO EVENT WILL ANY COPYRIGHT HOLDER BE LIABLE TO YOU FOR
DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY
TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED
BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO
OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR
OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
Every reasonable effort has been made to assure the quality and completeness
of this program, if you have any questions, comments, or suggestions or if
you believe that you have found a bug please contact the author at the
address given at the end of this document.
All trademarks used within this document are trademarks of their respective
owners.
INTRODUCTION
------------
SFP2Auto was born out of a desire to be able to easily install many different
softfonts into any application. Many applications can use softfonts directly,
but many others, including some very common ones, are unable to use softfonts
unless they are specially installed. What is most frequently needed by the
application is the character width information.
Many commercial third party alternatives exist to install softfonts into
popular applications. If you have already purchased one of those, you may
have no need for SFP2Auto. However, as new versions of applications come
out, or you purchase new applications, you may find that you need to buy
better or newer versions of install packages. This seems like a shame--not to
mention a waste of money.
What alternatives exist?
------------------------
Hewlett Packard introduced the concept of AutoFont Support Technology along
with their brand of scalable typeface technology shortly before they
introduced the LaserJet III printer. The central idea was to place all of the
information that an application needed to know about a font in single, well
defined file. The file format (like the popular TIFF image format) was
designed to be extensible so that it could change and adapt as time passed
without ever becoming so obsolete that it needed to be completely replaced.
The resulting files, called Tagged Font Metric files, are what SFP2Auto
produces.
Most new applications can read HP AutoFont Support files and most new font
rendering programs can produce HP AutoFont Support files when they create a
font. What has been missing is a way to produce AutoFont Support files from
existing softfonts.
By using AutoFont Support files, you can be guaranteed (as much as anything is
guaranteed in the software industry) that you will have access to all your
fonts in both present and future versions of your applications.
AUTOFONT SUPPORT FILES
----------------------
AutoFont Support files are complex. Each file consists of a number of
variable length fields identified by tags (a tag is just a number). Some
fields are required, some are recommended and some are optional. The amount
of information in an AutoFont Support file far exceeds the amount of
information in a LaserJet softfont. Luckily, however, all of the required
fields can be constructed from the metrics present in the softfont.
It should be understood from the beginning that the quality of the metrics in
the AutoFont Support file produced by SFP2Auto are only as good as the quality
of the metrics in the softfont. By this we mean, if you have an application
that creates softfonts (from scalable typeface data, for example) you should
definitely use the AutoFont Support file produced by the font rendering
application if possible. SFP2Auto is constructing a support file "after the
fact," it is far better to produce the file with the original font.
There are two different kinds of AutoFont Support file--they are called type 0
and type 1, respectively. There are two types because HP is actually trying
to solve a number of different problems with AutoFont support files. One of
the problems that they are trying to solve is the problem of character sets.
There are a really large number of symbols available in fonts today and more
are being added all the time. For the purpose of constructing a font or using
these symbols in a computer they are grouped into sets of 256. In order to
make sure that what appears on the screen and what appears on the printed page
are the same character, it is necessary to make sure that the screen driver
and the printer use the same set of characters. Groups of characters are
usually called symbol sets. If you have ever performed a Print Screen to your
LaserJet printer and gotten a page of "gibberish," you have seen the results
of mixing symbol sets. Your PC was almost certainly using the PC-8 symbol set
and the printer was using some other symbol set (probably Roman-8).
The problem with symbol sets is that they are only good if everyone knows
what they contain. Application writers are acutely aware of the fact that
a new symbol set, created after they distribute there application, is
essentially unusable within their application. The problem is this: the
application knows what symbol sets your printer has and knows how to "draw"
a whole bunch of characters that are not resident in your printer. But if
you choose character 65 from symbol set XYZZY and the application hasn't been
coded to know what characters are actually in symbol set XYZZY, there's
nothing that the application can do to print the correct character (unless
you've also told it that a particular font has symbol set XYZZY).
In an attempt to combat this problem, type 0 AutoFont Support files map each
character in a font to a particular predefined code in the HP Master Symbol
Library (MSL). The MSL contains thousands of characters uniquely identified
by a single number. For example, in the MSL character 68 is a lowercase "t"
and character 1043 is the "ffi" ligature regardless of the symbol set of the
font or what position the character occupies in the font. The disadvantage
of type 0 AutoFont Support files is that the MSL is incomplete. For SFP2Auto,
an additional disadvantage is the fact that it is impossible to tell, simply
by looking at the font, what each character _really_ is.
A type 1 AutoFont Support file maps each character to its position in a
particular symbol set. In a type 1 file, the character at position 13 might
be mapped to position 185 in the Roman-8 symbol set (which would imply that
it was the upside down question mark character). The disadvantage of type 1
files is that only a single symbol set can be represented in each AutoFont
Support file. It is not possible to "mix and match" symbol sets in the
character mapping table.
Although all application programs _should_ support either form of AutoFont
Support file, many don't. For example, at the time of this writing, Word
Perfect's PTR program ignores type 1 AutoFont Support files.
INSTALLATION OF AUTOFONT FILES
------------------------------
Installation of AutoFont files is one place in which the AutoFont Support file
specification is a bit rigid. The specification states that there should be a
directory called \AUTOFONT (on C:, for example, although at Small Planet
Software it is on D:) The \AUTOFONT directory contains all of your AutoFont
Support files and a special text file called GLUE.TXT. The actual font files
should be kept in another directory or, perhaps, several other directories.
The file GLUE.TXT binds fonts to AutoFont Support files. Internally, the file
is divided into sections (in a manner similar to the way that Windows uses
square-bracketed section names in .INI files). When an application needs to
find the AutoFont Support file for a font, it opens \AUTOFONT\GLUE.TXT and
locates the appropriate section. For every font that has an AutoFont Support
file, there is a group of lines in the GLUE.TXT file that describes the font
and names the appropriate AutoFont Support file.
The diagram below attempts to represent the relationships between the various
components:
C:\FONTS C:\AUTOFONT C:\AUTOFONT
AAAAAA.SFP -*--+
| +--*- AAAAAA.TFM
BBBB12.SFP **--| |
|---GLUE.TXT-----|-**- BBBBSS.TFM
BBBB14.SFP **--| |
| +-*-* CCCCCC.TFM
CCCCCC.SFP *-*-|
|
D:\PSFONTS |
|
BBBBSS.PFB **--+
For example, here is an entry from the AutoFont Support file at Small Planet
Software:
{A} ; LaserJet bitmap fonts
FONT = Gourmand
/family = 1706
/resource = D 24987
/font file = d:\fonts\EA010AAA.ESP
/symset = 10J 5
/orient = P
/ptsize = 10.00
/tfm = d:\autofont\EA010AAA.TFM
This entry, in the [PCL fonts] section of the GLUE.TXT file describes an
uncompressed LaserJet bitmap font called "Gourmand". The actual softfont is
d:\fonts\ea010aaa.esp. The AutoFont Support file for this font is
d:\autofont\ea010aaa.tfm. The other lines in this entry describe other font
related details. This other information is actually available from the
softfont and AutoFont files, but it is more convienient to supply all of it in
one place since the application using this information has to read GLUE.TXT
anyway.
HOW DO I USE SFP2AUTO:
----------------------
If you have never used AutoFont Support before, the first thing you should
do is create a directory called \AUTOFONT. Many applications recommend
that you place this directory on drive C:, however, at Small Planet Software
we have been using it on drive D: without significant difficulty. You must
put it in the root directory, however. After you have created the directory,
follow the instructions below and SFP2Auto will do the rest.
SFP2Auto is easy to use. To run SFP2Auto, simply enter the name of the
softfont for which you wish to build an AutoFont Support file. The complete
usage syntax is:
SFP2AUTO softfont <autofont> </MSL:file> </AUTO:d:\path\glue.txt> </$>
</NOMSL>
The parameters in angle brackets (<>) are optional. A configuration file
(described below) can be used to set default options.
What each parameter means:
--------------------------
softfont : The name of the LaserJet softfont. SFP2Auto will build
an AutoFont support file for this softfont. At present,
wildcard masks (like *.SFP) are not allowed.
autofont : (optional) The name of the AutoFont Support file to create.
The default name is the name of the softfont with the
extension changed to TFM. By default, this file is created
in the \AUTOFONT directory. This is generally the best
choice. SFP2Auto will not replace an existing file. If a
name conflict occurs, SFP2Auto generates a new name that
does not conflict with any existing filename.
/MSL:file : (optional) Specifies an MSL mapping file (described below).
The default name is the font symbol set with the extension
MSL. For example, when generating an AutoFont Support file
for a softfont with symbol set 0U, SFP2Auto looks for the
mapping file 0U.MSL by default.
/NOMSL : (optional) Tells SFP2Auto not to look for the default
mapping file. It is an error to specify both /MSL:file and
/NOMSL at the same time.
/AUTO:file : This should name the GLUE.TXT file that you wish to update.
The configuration file (described below) is the best place
to set this option. If this option does not name a file
called GLUE.TXT, the autofont file named will be created but
will not be installed. The path on this option is assumed
to be the autofont directory.
If the file GLUE.TXT does not exist, SFP2Auto will create
it. You should always use the explicit pathname of the
glue file (i.e. C:\AUTOFONT\GLUE.TXT) and _not_ just the
filename.
/$ : Prints out program registration information. This option
has essentially no effect on unregistered copies.
Please consult the file APPLICAT.DOC for more information about how to install
fonts with AutoFont Support files into your favorite applications.
What are MSL files?
-------------------
MSL files allow you to specify the mapping from positions in the font to HP
Master Symbol Library numbers. SFP2Auto comes with several mapping files.
The format of the MSL files is simple. Each file is a plain text file; the
first number on each line is the position in the font, the second number on
each line is the MSL number for that character. Comments can be inserted by
preceding them with a percent sign (%). For example, here is the beginning
of the 6J.MSL file:
% PB (Microsoft Publishing) 6J
32 0
33 200
34 1018
35 198
36 1001
37 1002
38 1004
.
.
.
If you convert a font with the /NOMSL option (or there is no MSL file for
the symbol set being converted), SFP2Auto will create a type 1 AutoFont
Support file. Some applications will not read type 1 AutoFont Support files.
These applications are buggy!
If you find that you need an MSL file for a symbol set that is not provided,
please feel free to contact the author (at the address given below). At this
time, there is no easy way to redistribute a description of the HP MSL. If
you do not have access to the MSL, the author will be happy to help in any way
possible.
THE CONFIGURATION FILE:
-----------------------
A configuration file can be used to set the default font directory and the
default AutoFont Support directory. SFP2Auto looks for the configuration file
each time it is run. If you are using DOS 3.0 or later, the configuration
file should be stored in the same directory as SFP2AUTO.EXE and should be
called SFP2AUTO.CFG. If you are using DOS 2.xx, you must set the environment
variable SFP2AUTO to point to the appropriate configuration file.
What goes in the configuration file?
------------------------------------
The configuration file is a simple text file. Each line is divided into
three parts. The first and second parts are seperated by a space, the
second and third by an equal sign. Case is insignificant. The various
parts are called the progid, parameter, and value, respectively. Each line,
therefore, has the following form:
progid param=value
Comments can be inserted in the configuration file by beginning a line
with a semicolon. The semicolon must be in column 1.
At present, there are only two options that are used in the configuration
file:
SFP2AUTO SFDIR=directory
This option specifies the default directory for softfonts. If you do not
supply a directory when you enter the name of a softfont, SFP2Auto will look
first in the current directory and then in the directory named by the SFDIR
parameter.
SFP2AUTO AUTOFONT=d:\path\glue.txt
This option should point explicitly to the GLUE.TXT file in your AutoFont
Support directory. For example, C:\AUTOFONT\GLUE.TXT would be correct if
your AutoFont Support directory is on drive C:. You should always include
the drive and complete path to the GLUE.TXT file on this parameter!
HOW DO I USE SPS-REG?
---------------------
SPS-REG is the Small Planet Software registration program. When you have
registered your copy of SFP2Auto, you will be given instructions for using
SPS-Reg to "personalize" your copy of SFP2Auto. You cannot use SPS-Reg
until you have registered your copy. Please register your shareware today!
CAVEATS, BUGS, AND DEFICIENCIES
-------------------------------
The present version of SFP2Auto leaves room for improvement. This section
describes some of the known inadequacies of the current release of SFP2Auto.
Some of these problems may be fixed in later versions. You are welcome to
comment on any of these issues if you find that they affect your use of this
program.
* SFP2Auto may not produce the correct AutoFont Support file for landscape
fonts. This is correctable but has not yet been implemented.
* One of the things that an AutoFont Support file can include is kerning
information. Kerning improves the appearance of many letter combinations
by moving the letters closer together or, for other combinations, farther
apart. Unfortunately, LaserJet softfonts do not contain kerning
information. However, Small Planet Software has implemented a flexible
kerning algorithm that could be provided as an option to SFP2Auto users.
This will probably be added in a future version.
* Although SFP2Auto creates the best possible AutoFont Support files from
the information it has in the softfont file, it makes the following
imperfect choices:
- The Character Descent tag (tag #438) should identify the position of the
lowest extension in the character's design. In the file produced by
SFP2Auto, this value is only correct for characters that descend below
the baseline. For all other characters, the Character Descent is
identified as the baseline, even if the character comes no where near
the baseline. I know how to fix this but I haven't bothered yet. If it
presents a problem (perhaps because accents are much too high, for
example), please let me know.
- The Type Structure tag (tag #410) should identify the surface treatment
of the typeface. SFP2Auto always provides a type structure value of 3.
This indicates a "solid" typeface (as opposed to outline, contour,
patterned, etc.).
- The Appearance Width tag (tag #414) should indicate if the font is
designed as a variation on what would be considered the normal
appearance for the font. SFP2Auto always provides an appearance width
value of 142. This indicates a "normal" font.
- The Serif Style tag (tag #415) should indicate the kind of serifs that
the characters in the font have. SFP2Auto always provides a serif style
value of 60. This indicates a "Serif Triangle" font.
HOW TO CONTACT THE AUTHOR
-------------------------
The author can be contacted via postal mail to:
Norman Walsh
#42I Southwood Apts
Amherst, MA 01002
USA
or electronically via internet mail to:
walsh@cs.umass.edu
Internet mail is accesible from a large number of colleges and universities
as well as many large, national BBS services (including CompuServe).
OTHER PRODUCTS AVAILABLE FROM SMALL PLANET SOFTWARE
---------------------------------------------------
Sfware
------
The Sfware utilities allow you to download, rotate, compress, expand, view,
and perform special effects on softfonts. The effects provided include bold,
fill, convert to fixed spacing, halftone, hollow, invert, mirror, outline,
convert to proportional spacing, resize, reverse, shade, shadow, slant,
stripe, tilt, three-d, hollow-three-d, and filled-three-d effects. The
effects can be tailored and customized for any font with various parameters
and shading patterns. Sfware is distributed under a shareware license
agreement.
MergeSFP
--------
Merges multiple LaserJet softfonts into a single file. If you are generating
special purpose fonts, you may discover that you need characters from several
different symbol sets (and, hence, several different LaserJet softfonts) in
order to create a complete character set. MergeSFP allows you to construct a
single LaserJet softfont containing the appropriate characters from several
different softfonts.
PKtoSFP
-------
PKtoSFP converts TeX fonts into HP Laserjet softfonts. PKtoSFP can create
AutoFont Support files. PKtoSFP is the inverse of SFPtoPK.
SFPtoPK
-------
SFPtoPK converts HP LaserJet softfonts into TeX fonts. SFPtoPK can use
AutoFont Support files to provide accurate spacing and kerning information to
TeX. SFPtoPK is the inverse of PKtoSFP.
PKscale
-------
Changes the magnification of TeX PK files. This can be especially useful if
you are working with devices of differing resolutions. PKscale is included in
the SFPtoPK package.