****************************************************************************** Copyright (c) 1992 - 1994 Y&Y, Inc. All rights reserved. ****************************************************************************** ============================================================================== Installing font sets in Adobe Type 1 Format on the NeXT (file: nextfont.txt) ============================================================================== Acknowledgments and Suggestion: ------------------------------- Much of the information here was kindly provided by Dr. Tom Marchioro. Help was also provided by Steve Frank regarding `spacifying' TeX fonts. And Henry McGilton helped improve the installation scripts. NOTE: Please read the main part of the installation instructions. You can pretty much ignore the Appendices, however. They are there only in case you want, or need more detailed information. NOTE: If you are using NeXT-Step on Intel platforms, and you already own some fonts from Adobe, then you may be able to install the fonts using the `font installer.app'. But you need *also* to set up TFM files for TeX and the configuration file for DVIPS, so please read on. (0) Introduction: ---------------- NOTE: The installation instructions are for both system 2.x and system 3.x. They differ in just one place, as indicated below. Font sets from Y&Y in Adobe Type 1 format for use on NeXT come with: (*) PFA files (actual outline font programs themselves); (*) AFM files (human readable Adobe Font Metric files); (*) TFM files (TeX font metric files --- not supplied with all font sets); as well as: (*) Explanatory text file --- `nextfont.txt' (which you are now reading); (*) Shell script that does most of the installation --- `nextinst' (*) Mapping of TeX TFM font names to PostScript FontNames --- `psfonts.*' The `mapping' file is used by DVIPS. Each font set comes with its own font name mapping file. The `*' above stands for `cm', `am', `lt', `lb', `mt' and so on. That is, the actual file names are `psfonts.cm', `psfonts.am', `psfonts.lt', `psfonts.lb', and `psfonts.mt'. In this text, please mentally substitute the appropriate file name extension for the place holder `*'. NOTE: Please ignore `psfonts...' files with extensions that end in `x' or `z'. These configuration files are for use with DVIPS on Unix systems other than NeXT. These files will not work with DPS on NeXT. Some font sets also contain: (*) Shell script for creating a `space' character --- `spacify' The CM fonts, the AMS fonts, and the LaTeX+SliTeX fonts do not have a `space' character in code position 32, since TeX does not use space characters. To make it easier to use the text fonts with programs other than TeX, you may want to put a `space' characters in code position 32. This can be conveniently done using the shell script `spacify', since the fonts supplied do actually contain a `space' character, just in a different place. The appropriate time to perform this modification is indicated below. (See Appendix A.3 for additional details). (1) Installation Summary: ------------------------ The shell script `nextinst' automates most of the font installation process. There are basically two steps to the automated part of the installation: (1) Create the appropriate directory structure and copy PFA (outline font) programs and AFM (Font Metric) files into these directories; (2) Let the system know about the new fonts; If you are planning to use the fonts with TeX, then appropriate TFM (TeX Font Metric) files may have to be installed as well: (3) Copy the TFM metric files for use with TeX; This third step is not required if the TFM files already exist, or if you are not planning to use the fonts with TeX. Finally, if you use DVIPS for printing, then a fourth step is required: (4) Add entries to the `psfonts.map' file giving the mapping between TeX TFM font names and the corresponding PostScript FontNames. (2) Batch installation of PFA and AFM files: -------------------------------------------- The installation process is greatly simplified by using the shell script `nextinst' provided on the distribution diskette of the font set. (FIRST): create a temporary directory, and make this the current directory. Then copy all of the PFA (outline font programs) and AFM (Adobe Font Metric) files from the distribution diskettes into this directory. WARNING: Do not copy any PFA files that contain the string `news' in their name (e.g. `cmexnews.pfa', `euexnews.pfa', `lbmenews.pfa' etc.) if you are installing these fonts on a NeXT. Font files with the string `news' in their name are bug-work-arounds specifically for NeWSPrint on Sun machines running OpenLook. If you have TeX set up, then you most probably already have TeX Font Metric (TFM) files for the Computer Modern fonts, the AMS Fonts, as well as the LaTeX + SliTeX fonts. Hence there normally is no need to copy TFM files for these. But if you are installing the Lucida Bright + Lucida New Math font set or the MathTime font set, then also copy the TFM files into the temporary directory. (SECOND): For the CM fonts, the AMS fonts, and the LaTeX+SliTeX fonts, you may wish to run the shell script `spacify' at this point to modify the PFA and AFM files so that a `space' character appears in character position 32, as mentioned above (See Appendix A.3). If you do want to `spacify' your fonts, copy the file `spacify' into the temporary directory. Then turn `spacify' into an executable script: chmod 755 spacify Finally invoke the shell script by typing its name, `spacify'. (No `spacify' script is provided with the Lucida Bright text fonts, since these already have a space character in the expected position). (THIRD): Copy the batch installation shell script `nextinst' into the temporary directory. Also copy the font name mapping file (`psfonts.cm', `psfonts.am', `psfonts.lt', `psfonts.lb', or `psfonts.mt' ...) which is used by this script. The file `nextinst' is a C-shell script that does most of the font installation for you automatically. Before using it, you have to turn `nextint' into an executable script: chmod 755 nextinst (FOURTH): Become superuser (root) --- if you have not done so already --- and invoke the shell script simply by typing its name in a shell (in which you (1) must be logged in as root and (2) have to be in the temporary directory where all of the files are): ./nextinst (NOTE: the `./' must be typed because, on most NeXT machines, the current directory is NOT in the active path for the Superuser. This is basically a safety feature to prevent the superuser from accidentally invoking applications in the wrong directory). (See Appendix A.6 for why you have to become superuser). The shell script will chug away, telling you about each font as it creates a directory for it and copies the appropriate PFA and AFM files. The script also automatically installs the TFM files (if there are any --- if not, you may get a message stating "foreach: no match" or something like that). The script also copies the font name mapping file `psfonts.*' into the directory `/usr/lib/tex/ps'. When the script has completed its operation, you should be able to start up an application, such as Edit, and see the fonts in the font panel. Note that for NeXTSTEP 2.x systems, you must quit applications and restart them so that the Font Manager can become aware of newly installed fonts. For NeXTSTEP 3.x systems, you need only dismiss the font panel and bring it back again to make the Font Manager aware of the newly installed fonts. (3) Font Name Mapping File for DVIPS: ------------------------------------- Next, to use the fonts with DVIPS, you must let DVIPS know how to map from the TeX names of the fonts (i.e. the names of the TFM files) to the PostScript FontNames (i.e. the names Display PostScript uses for fonts). If you are using System 2.x you must edit the file `/usr/lib/tex/ps/psfonts.map' and add the contents of the file `psfonts.*' (remember, `*' is just a place holder for the abbreviation of the font set that you are installing). You can achieve the desired effect using the Unix utility `cat'. Give the following commands in a shell --- again, you will have to be superuser (root) to do this: cd /usr/lib/tex/ps mv psfonts.map psfonts.map.save cat psfonts.map.save psfonts.* > psfonts.map rm psfonts.map.save (You do not actually type `*', of course --- `*' is either `cm', `am', `lt', `lb', `mt' ... depending on which font set you are installing.) This appends the contents of the file `psfonts.*' to the file `psfonts.map.' If you are using the latest version of DVIPS then there is a convenient alternative (see Appendix A.5) --- just add the line: p+ psfonts.* to the end of the `config.ps' file. This will in effect append the entries in `psfonts.*' to the list of fonts in Adobe Type 1 format that are available to DVIPS. NOTE: Make sure the line you add to `config.ps' has a line terminator! If you use `Edit.app' to add this line it will NOT add a line terminator, unless you explicitly type a carriage return at the end of the line. To be safe, type a carriage return and then a * on the next line (indicating that it is a comment line)! This is necessary because until recently DVIPS ignored such unterminated lines (this problem has been fixed in the most recent versions of DVIPS available from the archives, but not in the version that ships with NeXTstep 3.0, or prior). (FINALLY): exit `superuser' state. The newly installed Type 1 fonts should now be available to all NeXT applications through the font panel, as well as being usable with TeX. You will have to restart TeXview for it to know about the fonts, however, because TeXview loads the file `psfonts.map' on start-up. (4) LucidaBright + LucidaNewMath: ---------------------------------- If you have installed the LucidaBright + LucidaNewMath font set you will be able to replace Computer Modern fonts in your TeX documents with LucidaBright and LucidaNewMath fonts by putting one of the lines: \input lcdplain % (for plain TeX), or \input lcdlatex % (for LaTeX) at the top of your document. Plain TeX and LaTeX have hard-wired assumptions about where special characters such as accents are --- based on the assumption that you are using the Computer Modern fonts. Since The TFM files supplied with the fonts are set up for StandardEncoding, which is the text font's `native' encoding, you also need to override the TeX macros dealing with these special characters. Do this by adding: \input stanacce.tex after the above statement at the beginning of the TeX source file. The file `stanacce.tex' may be found on your distribution diskette. See the `readme.txt' file that comes with this font set for additional details. (5) MathTime: ------------- If you have installed the MathTime font set you will be able to replace Computer Modern fonts in your TeX documents with MathTime, Times, Helvetica, and Courier by putting one of the lines: \input mtplain % (for plain TeX), or \input mtlatex % (for LaTeX) at the top of your document (Note that MathTime requires virtual font support). Plain TeX and LaTeX have hard-wired assumptions about where special characters such as accents are --- based on the assumption that you are using the Computer Modern fonts. Since The TFM files supplied with the fonts are set up for StandardEncoding, which is the text font's `native' encoding, you also need to override the TeX macros dealing with these special characters. Do this by adding: \input stanacce.tex after the above statement at the beginning of the TeX source file. The file `stanacce.tex' may be found on your distribution diskette. See the `readme.txt' file that comes with this font set for additional details. (6) Too Many Fonts! ------------------- NeXTstep 3.0 has a bug that limits the number of fonts that can be shown in the font panel to less than 256. If you have `too many fonts' you can either wait for NeXTstep 3.1 (may 1993?) which will hopefully fix the problem, or use the `buildafmdir' executable from NeXTstep 2.0 instead. (7) Adobe Type 1 Fonts: ----------------------- Y&Y can provide most of the fonts commonly used with TeX in Type 1 format for a variety of platforms, including NeXT. But Trilithon Software is the Adobe authorized reseller for Adobe's Type 1 fonts in format suitable for NeXT: Trilithon Software, 3000 Alpine Road, Portola Valley, CA 94028 (415) 851-7901 (voice) (415) 851-7902 (fax) email: info@trilithon.com Trilithon also offers such NeXT utilities as MacToPfa and PfbToPfa for converting fonts from Macintosh and IBM PC format to NeXT format. *************** NOTE: the rest is for reference only ************************** ============================================================================= APPENDIX: The Gory Details and Some Additional Information: ============================================================================= A.1 Font Directory Structure and Outline Font File Names: -------------------------------------------------------- For use on the NeXT, each font requires a separate directory (with extension `.font') that contains both the outline font program itself --- in PFA (`Printer Font ASCII') format --- and the metric information --- in AFM (`Adobe Font Metric') format. On the NeXT, the name of the PFA file containing the outline font itself must be the PostScript FontName of the font. The corresponding AFM file must have that name also, but with extension `.afm'. Furthermore, the directory containing both of these files must have that name, but with extension `.font'. (This differs from the way this is done on the IBM PC where the outline font files have short names assigned by the vendor. It also differs from the way it is done on the Macintosh, where the outline font file has a name obtained by contraction of the PostScript FontName using the so-called `5 + 3 + 3 ...' rule). A.2 TeX File Directory Structure -- non-standard system setups: -------------------------------------------------------------- One of the advantages of the NeXT computer is that the operating system is set up almost identically on every NeXT, and in particular the TeX distribution has a standardized form. This script provided here assumes that form! If you have made custom modifications to your TeX distribution - say, by moving the tex files out of `/usr/lib/tex' - then you will need to modify the path names used by the `nextinst' script. For example, some users have a `/usr/local/tex' hierarchy parallel to `/usr/lib/tex' (usually because `/usr/local/tex' tends to get cluttered). Hence, all the `*.tfm' files may be in `/usr/local/tex/fonts' (which may actually be a link to `/LocalLibrary/Fonts/TeXFonts'). The file `psfonts.*' can then be placed in `/usr/local/tex/ps', referring to it from `config.ps' using the p+ option. The files `lcdplain.tex' and `lcdlatex.tex' and other such TeX macro files would then go into `/usr/local/tex/inputs'. (If you are unsure about this, contact your NeXT system administrator). A.3 Putting a `space' character in character code position 32: -------------------------------------------------------------- The CM fonts, the AMS fonts, and the LaTeX + SliTeX fonts do not have a `space' character, since TeX does not use space characters. In fact, they have another character in code position 32, usually `suppress' (a short diagonal stroke use to construct `lslash' and `Lslash'). As a convenience, a `space' character has been added to the text fonts in character position 160. But this is awkward to access. To make it easier to use the text fonts with programs other than TeX, you may want interchange the characters in code position 32 and 160. (Just keep in mind that you will then not be able to easily access the character that originally was in code position 32). This change has to be made in both the AFM and the PFA file before installation. While this can certainly be done by hand, it is more convenient to use the shell script called `spacify'. A.4 End-of-Line Characters: --------------------------- The font sets are distributed on DOS formatted floppies, which the NeXT computer can read. DOS and NeXT used different characters to denote EOL or "End of Line". In particular, lines in DOS text (ASCII) files normally end with ^M (control-M) followed by ^J (control-J). The text files on the distribution diskette have the ^M's stripped out so that they will work properly on the NeXT. Should there be any files that have spurious ^M's in them, then strip these out using an incantation something like: tr -d '\015' < oldfile > newfile Where `tr' is a Unix utility for TRanslating characters; the '-d' option tells `tr' to remove the character; and \015 is the octal designation of ^M. Substitute appropriate file names for `oldfile' and `newfile' A.5 Adding entries to `psfonts.map': ------------------------------------ The most recent version of DVIPS (i.e. dvips5490, which comes with NeXTstep 3.0, or higher) makes it possible to place the new font name mapping entries in a separate file, and then to modify `config.ps' to append this font mapping file using `p+'. Older versions of DVIPS require that the new entries be added directly to the `psfonts.map' file. This is the only real difference between installation instructions for system 2.x and system 3.x. A.6 Why SuperUser? ------------------ The part of the installation script for which you need to be superuser is: cp -rp *.font /LocalLibrary/Fonts/ cp psfonts.* /usr/lib/tex/ps/ buildafmdir /LocalLibrary/Fonts This puts the font directories in /LocalLibrary/Fonts and lets the system built a new list of available fonts. You may wish to instead put the fonts in a user's `Library/Fonts' home folder, but then they will only be available to that specific user. A.7 Replacing PFA and AFM files safely -------------------------------------- The following does not apply if you are installing the fonts for the first time. But if you replace PFA and AFM files of fonts that are already installed, you have to be careful to also update the metric cache files that Display PostScript maintains. Remove the `.fontlist' and `.fontdirectory' and `.AFMcache' files, and then run `buildafmdir', as well as `cacheAFMData' to regenerate all of the cached information. A.8 TeX Metric Files: ----------------------- For use with TeX you will also need TeX metric files (TFM). In the case of the CM fonts, the AMS fonts, the LaTeX + SliTeX fonts, you most likely already have appropriate TFM files installed (they are part of the standard distribution). For other Type 1 fonts, you will need to copy the TFM files to the directory in which TeX expects to find them (that is, where all the other TFM files are). This typically is `/usr/lib/tex/fonts/tfm'. The installation script takes care of this for you if you place the TFM files in the current directory before invoking it. A.9 Font Encoding Vector: ------------------------- In documents, we specify characters by numeric code, usually in the range 0 - 255. The coresponding glyph may be specified by a short character name. The mapping from the character code number to the glyph is called the encoding vector. There is no generally accepted `standard' encoding vector (or rather, there are too many `standard' encoding vectors!). Font in Adobe Type 1 format from Y&Y are supplied with ready-made TFM files (except for the Computer Modern fonts in Type 1 format). These are set up for the font's `native' or `raw' encoding. The encoding for CM, AMS, and LaTeX + SliTeX fonts is predetermined and fixed. Other text fonts in Adobe Type 1 format usually have Adobe StandardEncoding as their `native' encoding. Adobe StandardEncoding is the default for both DVIPSONE and DVIPS (although DVIPSONE can reencode fonts on-the-fly to any user specified encoding vector, and DVIPS can use the virtual font mechanism to permute a font's encoding vector). If your DVI processor reencodes the fonts, then corresponding TFM files will have to be created appropriate for that encoding. Typically DVI processors come with utilities (with names such as AFMtoTFM, AFM2TFM, AFtoTF) for creating new TFM files from AFM (Adobe Font Metric) files (Fonts in Type 1 format should always be supplied with AFM files). Math fonts typically have a fixed encoding, and so the same TeX metric file (TFM) is used by all DVI processors. Just make sure that your DVI processor does NOT reencode math fonts. A.10 Trouble Shooting Problems with Mismatches in Encoding: --------------------------------------------------------- A good check to be sure the fonts are encoded properly is to typeset the attached sample TeX source file `acc.tex' which just checks to be sure all of the TeX ligatures and math accents come out correctly. If your TFM fonts are not properly encoded for the DVI processor you are using --- or if your TeX macros are set up for a different encoding --- then the math accents will almost certainly come out wrong. Examine `acce.tex', and then examine it's output to be sure your fonts are properly encoded: \magnification=\magstep4 % this is set up for plain TeX \nopagenumbers \null\vskip 10pt \input lcdplain % for example, use Lucida Bright + Lucida New Math fonts \input stanacce % text fonts assumed to be using Adobe StandardEncoding \baselineskip=16pt \parskip=12pt % Test accents in math mode: $$\hat a \quad \dot a \quad \ddot a \quad \tilde a \quad \breve a$$ $$\grave a \quad \check a \quad \bar a\quad \vec a \quad \acute a$$ % Test special characters: \centerline{\oe\ \AE\ \OE\ \ss\ \O\ \o\ \ae\ \l\ \L} % Test real ligatures `f i' => `fi' and `f l' => `fl' \centerline{Ligatures: fi fl} % Test pseudo ligatures `quoteleft quoteleft' => `quotedblleft' \centerline{!` ?` - -- --- ``quote''} \vskip .2in % Check that it works in bold and italic also \centerline{``the rain in spain''} \centerline{\it ``the rain in spain''} \centerline{\bf ``the rain in spain''} \vskip .2in % The following pseudo ligatures apply to Lucida Bright: \centerline{<> ,,German'' Polish \char32 l \char32 L} \bye ******************************************************************************* Y&Y Inc, Tuttle's Livery #2F, 45 Walden St. Concord MA 01742 USA (508) 371-3286 *******************************************************************************