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 >
Text File  |  1992-04-15  |  22KB  |  544 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.                                   SFP2Auto
  31.  
  32.          Create HP AutoFont Support files from HP LaserJet Softfonts
  33.  
  34.                                 Version 0.91
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.                  Copyright (c) 1992 by Small Planet Software
  61.  
  62.                              All Rights Reserved
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.         THIS  PROGRAM  IS  DISTRIBUTED  FREELY.   THIS  PROGRAM   IS
  76.         PROVIDED  ``AS  IS''  WITHOUT  WARRANTY  OF ANY KIND, EITHER
  77.         EXPRESSED  OR IMPLIED,  INCLUDING   BUT  NOT   LIMITED   TO,
  78.         THE  IMPLIED WARRANTIES OF MERCHANTABILITY  AND FITNESS  FOR
  79.         A PARTICULAR PURPOSE.     THE  ENTIRE   RISK   AS   TO   THE
  80.         QUALITY   AND PERFORMANCE  OF  THE  PROGRAM  IS  WITH   YOU.
  81.         SHOULD   THE  PROGRAM  PROVE   DEFECTIVE,  YOU   ASSUME  THE
  82.         COST  OF   ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  83.  
  84.         IN NO EVENT WILL ANY  COPYRIGHT HOLDER BE LIABLE TO  YOU FOR
  85.         DAMAGES,  INCLUDING  ANY  GENERAL,  SPECIAL,  INCIDENTAL  OR
  86.         CONSEQUENTIAL DAMAGES  ARISING OUT  OF THE  USE OR INABILITY
  87.         TO USE  THE PROGRAM  (INCLUDING BUT  NOT LIMITED  TO LOSS OF
  88.         DATA OR DATA BEING  RENDERED INACCURATE OR LOSSES  SUSTAINED
  89.         BY  YOU  OR  THIRD  PARTIES  OR  A FAILURE OF THE PROGRAM TO
  90.         OPERATE WITH  ANY OTHER  PROGRAMS), EVEN  IF SUCH  HOLDER OR
  91.         OTHER  PARTY  HAS  BEEN  ADVISED  OF THE POSSIBILITY OF SUCH
  92.         DAMAGES.
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99. Every reasonable effort has been made to assure the quality and completeness
  100. of this program, if you have any questions, comments, or suggestions or if
  101. you believe that you have found a bug please contact the author at the
  102. address given at the end of this document.
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119. All trademarks used within this document are trademarks of their respective
  120. owners.
  121.  
  122.  
  123. INTRODUCTION
  124. ------------
  125.  
  126. SFP2Auto was born out of a desire to be able to easily install many different
  127. softfonts into any application.  Many applications can use softfonts directly,
  128. but many others, including some very common ones, are unable to use softfonts
  129. unless they are specially installed.  What is most frequently needed by the
  130. application is the character width information.
  131.  
  132. Many commercial third party alternatives exist to install softfonts into
  133. popular applications.  If you have already purchased one of those, you may
  134. have no need for SFP2Auto.  However, as new versions of applications come
  135. out, or you purchase new applications, you may find that you need to buy
  136. better or newer versions of install packages.  This seems like a shame--not to
  137. mention a waste of money.
  138.  
  139.  
  140. What alternatives exist?
  141. ------------------------
  142.  
  143. Hewlett Packard introduced the concept of AutoFont Support Technology along
  144. with their brand of scalable typeface technology shortly before they
  145. introduced the LaserJet III printer.  The central idea was to place all of the
  146. information that an application needed to know about a font in single, well
  147. defined file.  The file format (like the popular TIFF image format) was
  148. designed to be extensible so that it could change and adapt as time passed
  149. without ever becoming so obsolete that it needed to be completely replaced.
  150. The resulting files, called Tagged Font Metric files, are what SFP2Auto
  151. produces.
  152.  
  153. Most new applications can read HP AutoFont Support files and most new font
  154. rendering programs can produce HP AutoFont Support files when they create a
  155. font.  What has been missing is a way to produce AutoFont Support files from
  156. existing softfonts.
  157.  
  158. By using AutoFont Support files, you can be guaranteed (as much as anything is
  159. guaranteed in the software industry) that you will have access to all your
  160. fonts in both present and future versions of your applications.
  161.  
  162.  
  163. AUTOFONT SUPPORT FILES
  164. ----------------------
  165.  
  166. AutoFont Support files are complex.  Each file consists of a number of
  167. variable length fields identified by tags (a tag is just a number).  Some
  168. fields are required, some are recommended and some are optional.  The amount
  169. of information in an AutoFont Support file far exceeds the amount of
  170. information in a LaserJet softfont.  Luckily, however, all of the required
  171. fields can be constructed from the metrics present in the softfont.
  172.  
  173. It should be understood from the beginning that the quality of the metrics in
  174. the AutoFont Support file produced by SFP2Auto are only as good as the quality
  175. of the metrics in the softfont.  By this we mean, if you have an application
  176. that creates softfonts (from scalable typeface data, for example) you should
  177. definitely use the AutoFont Support file produced by the font rendering
  178. application if possible.  SFP2Auto is constructing a support file "after the
  179. fact," it is far better to produce the file with the original font.
  180.  
  181. There are two different kinds of AutoFont Support file--they are called type 0
  182. and type 1, respectively.  There are two types because HP is actually trying
  183. to solve a number of different problems with AutoFont support files.  One of
  184. the problems that they are trying to solve is the problem of character sets.
  185. There are a really large number of symbols available in fonts today and more
  186. are being added all the time.  For the purpose of constructing a font or using
  187. these symbols in a computer they are grouped into sets of 256.  In order to
  188. make sure that what appears on the screen and what appears on the printed page
  189. are the same character, it is necessary to make sure that the screen driver
  190. and the printer use the same set of characters.  Groups of characters are
  191. usually called symbol sets.  If you have ever performed a Print Screen to your
  192. LaserJet printer and gotten a page of "gibberish," you have seen the results
  193. of mixing symbol sets.  Your PC was almost certainly using the PC-8 symbol set
  194. and the printer was using some other symbol set (probably Roman-8).
  195.  
  196. The problem with symbol sets is that they are only good if everyone knows
  197. what they contain.  Application writers are acutely aware of the fact that
  198. a new symbol set, created after they distribute there application, is
  199. essentially unusable within their application.  The problem is this: the
  200. application knows what symbol sets your printer has and knows how to "draw"
  201. a whole bunch of characters that are not resident in your printer.  But if
  202. you choose character 65 from symbol set XYZZY and the application hasn't been
  203. coded to know what characters are actually in symbol set XYZZY, there's
  204. nothing that the application can do to print the correct character (unless
  205. you've also told it that a particular font has symbol set XYZZY).
  206.  
  207. In an attempt to combat this problem, type 0 AutoFont Support files map each
  208. character in a font to a particular predefined code in the HP Master Symbol
  209. Library (MSL).  The MSL contains thousands of characters uniquely identified
  210. by a single number.  For example, in the MSL character 68 is a lowercase "t"
  211. and character 1043 is the "ffi" ligature regardless of the symbol set of the
  212. font or what position the character occupies in the font.  The disadvantage
  213. of type 0 AutoFont Support files is that the MSL is incomplete.  For SFP2Auto,
  214. an additional disadvantage is the fact that it is impossible to tell, simply
  215. by looking at the font, what each character _really_ is.
  216.  
  217. A type 1 AutoFont Support file maps each character to its position in a
  218. particular symbol set.  In a type 1 file, the character at position 13 might
  219. be mapped to position 185 in the Roman-8 symbol set (which would imply that
  220. it was the upside down question mark character).  The disadvantage of type 1
  221. files is that only a single symbol set can be represented in each AutoFont
  222. Support file.  It is not possible to "mix and match" symbol sets in the
  223. character mapping table.
  224.  
  225. Although all application programs _should_ support either form of AutoFont
  226. Support file, many don't.  For example, at the time of this writing, Word
  227. Perfect's PTR program ignores type 1 AutoFont Support files.
  228.  
  229. INSTALLATION OF AUTOFONT FILES
  230. ------------------------------
  231.  
  232. Installation of AutoFont files is one place in which the AutoFont Support file
  233. specification is a bit rigid.  The specification states that there should be a
  234. directory called \AUTOFONT (on C:, for example, although at Small Planet
  235. Software it is on D:)  The \AUTOFONT directory contains all of your AutoFont
  236. Support files and a special text file called GLUE.TXT.  The actual font files
  237. should be kept in another directory or, perhaps, several other directories.
  238.  
  239. The file GLUE.TXT binds fonts to AutoFont Support files.  Internally, the file
  240. is divided into sections (in a manner similar to the way that Windows uses
  241. square-bracketed section names in .INI files).  When an application needs to
  242. find the AutoFont Support file for a font, it opens \AUTOFONT\GLUE.TXT and
  243. locates the appropriate section.  For every font that has an AutoFont Support
  244. file, there is a group of lines in the GLUE.TXT file that describes the font
  245. and names the appropriate AutoFont Support file.
  246.  
  247. The diagram below attempts to represent the relationships between the various
  248. components:
  249.  
  250.  
  251.         C:\FONTS           C:\AUTOFONT        C:\AUTOFONT
  252.  
  253.           AAAAAA.SFP -*--+
  254.                          |                +--*- AAAAAA.TFM
  255.           BBBB12.SFP **--|                |
  256.                          |---GLUE.TXT-----|-**- BBBBSS.TFM
  257.           BBBB14.SFP **--|                |
  258.                          |                +-*-* CCCCCC.TFM
  259.           CCCCCC.SFP *-*-|
  260.                          |
  261.         D:\PSFONTS       |
  262.                          |
  263.           BBBBSS.PFB **--+
  264.  
  265.  
  266. For example, here is an entry from the AutoFont Support file at Small Planet
  267. Software:
  268.  
  269.         {A}  ; LaserJet bitmap fonts
  270.  
  271.         FONT = Gourmand
  272.         /family = 1706
  273.         /resource = D 24987
  274.         /font file = d:\fonts\EA010AAA.ESP
  275.         /symset = 10J 5
  276.         /orient = P
  277.         /ptsize = 10.00
  278.         /tfm = d:\autofont\EA010AAA.TFM
  279.  
  280. This entry, in the [PCL fonts] section of the GLUE.TXT file describes an
  281. uncompressed LaserJet bitmap font called "Gourmand".  The actual softfont is
  282. d:\fonts\ea010aaa.esp.  The AutoFont Support file for this font is
  283. d:\autofont\ea010aaa.tfm.  The other lines in this entry describe other font
  284. related details.  This other information is actually available from the
  285. softfont and AutoFont files, but it is more convienient to supply all of it in
  286. one place since the application using this information has to read GLUE.TXT
  287. anyway.
  288.  
  289. HOW DO I USE SFP2AUTO:
  290. ----------------------
  291.  
  292. If you have never used AutoFont Support before, the first thing you should
  293. do is create a directory called \AUTOFONT.  Many applications recommend
  294. that you place this directory on drive C:, however, at Small Planet Software
  295. we have been using it on drive D: without significant difficulty.  You must
  296. put it in the root directory, however.  After you have created the directory,
  297. follow the instructions below and SFP2Auto will do the rest.
  298.  
  299. SFP2Auto is easy to use.  To run SFP2Auto, simply enter the name of the
  300. softfont for which you wish to build an AutoFont Support file.  The complete
  301. usage syntax is:
  302.  
  303.    SFP2AUTO softfont <autofont> </MSL:file> </AUTO:d:\path\glue.txt> </$>
  304.                                 </NOMSL>
  305.  
  306. The parameters in angle brackets (<>) are optional.  A configuration file
  307. (described below) can be used to set default options.
  308.  
  309. What each parameter means:
  310. --------------------------
  311.  
  312.   softfont      : The name of the LaserJet softfont.  SFP2Auto will build
  313.                   an AutoFont support file for this softfont.  At present,
  314.                   wildcard masks (like *.SFP) are not allowed.
  315.  
  316.   autofont      : (optional) The name of the AutoFont Support file to create.
  317.                   The default name is the name of the softfont with the
  318.                   extension changed to TFM.  By default, this file is created
  319.                   in the \AUTOFONT directory.  This is generally the best
  320.                   choice.  SFP2Auto will not replace an existing file.  If a
  321.                   name conflict occurs, SFP2Auto generates a new name that
  322.                   does not conflict with any existing filename.
  323.  
  324.   /MSL:file     : (optional) Specifies an MSL mapping file (described below).
  325.                   The default name is the font symbol set with the extension
  326.                   MSL.  For example, when generating an AutoFont Support file
  327.                   for a softfont with symbol set 0U, SFP2Auto looks for the
  328.                   mapping file 0U.MSL by default.
  329.  
  330.   /NOMSL        : (optional) Tells SFP2Auto not to look for the default
  331.                   mapping file.  It is an error to specify both /MSL:file and
  332.                   /NOMSL at the same time.
  333.  
  334.   /AUTO:file    : This should name the GLUE.TXT file that you wish to update.
  335.                   The configuration file (described below) is the best place
  336.                   to set this option.  If this option does not name a file
  337.                   called GLUE.TXT, the autofont file named will be created but
  338.                   will not be installed.  The path on this option is assumed
  339.                   to be the autofont directory.
  340.  
  341.                   If the file GLUE.TXT does not exist, SFP2Auto will create
  342.                   it.  You should always use the explicit pathname of the
  343.                   glue file (i.e. C:\AUTOFONT\GLUE.TXT) and _not_ just the
  344.                   filename.
  345.  
  346.   /$            : Prints out program registration information.  This option
  347.                   has essentially no effect on unregistered copies.
  348.  
  349. Please consult the file APPLICAT.DOC for more information about how to install
  350. fonts with AutoFont Support files into your favorite applications.
  351.  
  352. What are MSL files?
  353. -------------------
  354.  
  355. MSL files allow you to specify the mapping from positions in the font to HP
  356. Master Symbol Library numbers.  SFP2Auto comes with several mapping files.
  357. The format of the MSL files is simple.  Each file is a plain text file; the
  358. first number on each line is the position in the font, the second number on
  359. each line is the MSL number for that character.  Comments can be inserted by
  360. preceding them with a percent sign (%).  For example, here is the beginning
  361. of the 6J.MSL file:
  362.  
  363.         % PB (Microsoft Publishing) 6J
  364.         32 0
  365.         33 200
  366.         34 1018
  367.         35 198
  368.         36 1001
  369.         37 1002
  370.         38 1004
  371.         .
  372.         .
  373.         .
  374.  
  375.  
  376. If you convert a font with the /NOMSL option (or there is no MSL file for
  377. the symbol set being converted), SFP2Auto will create a type 1 AutoFont
  378. Support file.  Some applications will not read type 1 AutoFont Support files.
  379. These applications are buggy!
  380.  
  381. If you find that you need an MSL file for a symbol set that is not provided,
  382. please feel free to contact the author (at the address given below).  At this
  383. time, there is no easy way to redistribute a description of the HP MSL.  If
  384. you do not have access to the MSL, the author will be happy to help in any way
  385. possible.
  386.  
  387.  
  388. THE CONFIGURATION FILE:
  389. -----------------------
  390.  
  391. A configuration file can be used to set the default font directory and the
  392. default AutoFont Support directory.  SFP2Auto looks for the configuration file
  393. each time it is run.  If you are using DOS 3.0 or later, the configuration
  394. file should be stored in the same directory as SFP2AUTO.EXE and should be
  395. called SFP2AUTO.CFG.  If you are using DOS 2.xx, you must set the environment
  396. variable SFP2AUTO to point to the appropriate configuration file.
  397.  
  398.  
  399. What goes in the configuration file?
  400. ------------------------------------
  401.  
  402. The configuration file is a simple text file.  Each line is divided into
  403. three parts.  The first and second parts are seperated by a space, the
  404. second and third by an equal sign.  Case is insignificant.  The various
  405. parts are called the progid, parameter, and value, respectively.  Each line,
  406. therefore, has the following form:
  407.  
  408. progid param=value
  409.  
  410. Comments can be inserted in the configuration file by beginning a line
  411. with a semicolon.  The semicolon must be in column 1.
  412.  
  413. At present, there are only two options that are used in the configuration
  414. file:
  415.  
  416. SFP2AUTO SFDIR=directory
  417.  
  418. This option specifies the default directory for softfonts.  If you do not
  419. supply a directory when you enter the name of a softfont, SFP2Auto will look
  420. first in the current directory and then in the directory named by the SFDIR
  421. parameter.
  422.  
  423. SFP2AUTO AUTOFONT=d:\path\glue.txt
  424.  
  425. This option should point explicitly to the GLUE.TXT file in your AutoFont
  426. Support directory.  For example, C:\AUTOFONT\GLUE.TXT would be correct if
  427. your AutoFont Support directory is on drive C:.  You should always include
  428. the drive and complete path to the GLUE.TXT file on this parameter!
  429.  
  430.  
  431. HOW DO I USE SPS-REG?
  432. ---------------------
  433.  
  434. SPS-REG is the Small Planet Software registration program.  When you have
  435. registered your copy of SFP2Auto, you will be given instructions for using
  436. SPS-Reg to "personalize" your copy of SFP2Auto.  You cannot use SPS-Reg
  437. until you have registered your copy.  Please register your shareware today!
  438.  
  439. CAVEATS, BUGS, AND DEFICIENCIES
  440. -------------------------------
  441.  
  442. The present version of SFP2Auto leaves room for improvement.  This section
  443. describes some of the known inadequacies of the current release of SFP2Auto.
  444. Some of these problems may be fixed in later versions.  You are welcome to
  445. comment on any of these issues if you find that they affect your use of this
  446. program.
  447.  
  448.  * SFP2Auto may not produce the correct AutoFont Support file for landscape
  449.    fonts.  This is correctable but has not yet been implemented.
  450.  
  451.  * One of the things that an AutoFont Support file can include is kerning
  452.    information.  Kerning improves the appearance of many letter combinations
  453.    by moving the letters closer together or, for other combinations, farther
  454.    apart.  Unfortunately, LaserJet softfonts do not contain kerning
  455.    information.  However, Small Planet Software has implemented a flexible
  456.    kerning algorithm that could be provided as an option to SFP2Auto users.
  457.    This will probably be added in a future version.
  458.  
  459.  * Although SFP2Auto creates the best possible AutoFont Support files from
  460.    the information it has in the softfont file, it makes the following
  461.    imperfect choices:
  462.  
  463.     - The Character Descent tag (tag #438) should identify the position of the
  464.       lowest extension in the character's design.  In the file produced by
  465.       SFP2Auto, this value is only correct for characters that descend below
  466.       the baseline.  For all other characters, the Character Descent is
  467.       identified as the baseline, even if the character comes no where near
  468.       the baseline.  I know how to fix this but I haven't bothered yet.  If it
  469.       presents a problem (perhaps because accents are much too high, for
  470.       example), please let me know.
  471.  
  472.     - The Type Structure tag (tag #410) should identify the surface treatment
  473.       of the typeface.  SFP2Auto always provides a type structure value of 3.
  474.       This indicates a "solid" typeface (as opposed to outline, contour,
  475.       patterned, etc.).
  476.  
  477.     - The Appearance Width tag (tag #414) should indicate if the font is
  478.       designed as a variation on what would be considered the normal
  479.       appearance for the font.  SFP2Auto always provides an appearance width
  480.       value of 142.  This indicates a "normal" font.
  481.  
  482.     - The Serif Style tag (tag #415) should indicate the kind of serifs that
  483.       the characters in the font have.  SFP2Auto always provides a serif style
  484.       value of 60.  This indicates a "Serif Triangle" font.
  485.  
  486. HOW TO CONTACT THE AUTHOR
  487. -------------------------
  488.  
  489. The author can be contacted via postal mail to:
  490.  
  491.         Norman Walsh
  492.         #42I Southwood Apts
  493.         Amherst, MA 01002
  494.         USA
  495.  
  496. or electronically via internet mail to:
  497.  
  498.         walsh@cs.umass.edu
  499.  
  500. Internet mail is accesible from a large number of colleges and universities
  501. as well as many large, national BBS services (including CompuServe).
  502.  
  503.  
  504. OTHER PRODUCTS AVAILABLE FROM SMALL PLANET SOFTWARE
  505. ---------------------------------------------------
  506.  
  507. Sfware
  508. ------
  509. The Sfware utilities allow you to download, rotate, compress, expand, view,
  510. and perform special effects on softfonts.  The effects provided include bold,
  511. fill, convert to fixed spacing, halftone, hollow, invert, mirror, outline,
  512. convert to proportional spacing, resize, reverse, shade, shadow, slant,
  513. stripe, tilt, three-d, hollow-three-d, and filled-three-d effects.  The
  514. effects can be tailored and customized for any font with various parameters
  515. and shading patterns.  Sfware is distributed under a shareware license
  516. agreement.
  517.  
  518. MergeSFP
  519. --------
  520. Merges multiple LaserJet softfonts into a single file.  If you are generating
  521. special purpose fonts, you may discover that you need characters from several
  522. different symbol sets (and, hence, several different LaserJet softfonts) in
  523. order to create a complete character set.  MergeSFP allows you to construct a
  524. single LaserJet softfont containing the appropriate characters from several
  525. different softfonts.
  526.  
  527. PKtoSFP
  528. -------
  529. PKtoSFP converts TeX fonts into HP Laserjet softfonts.  PKtoSFP can create
  530. AutoFont Support files.  PKtoSFP is the inverse of SFPtoPK.
  531.  
  532. SFPtoPK
  533. -------
  534. SFPtoPK converts HP LaserJet softfonts into TeX fonts.  SFPtoPK can use
  535. AutoFont Support files to provide accurate spacing and kerning information to
  536. TeX.  SFPtoPK is the inverse of PKtoSFP.
  537.  
  538. PKscale
  539. -------
  540. Changes the magnification of TeX PK files.  This can be especially useful if
  541. you are working with devices of differing resolutions.  PKscale is included in
  542. the SFPtoPK package.
  543.  
  544.