home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / fonts-faq / part12 < prev    next >
Encoding:
Internet Message Format  |  1996-08-15  |  19.5 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!news.mathworks.com!zombie.ncsc.mil!newsgate.duke.edu!news-feed-1.peachnet.edu!paperboy.wellfleet.com!news3.near.net!amber.ora.com!not-for-mail
  2. From: norm@ora.com (Norman Walsh)
  3. Newsgroups: comp.fonts,comp.answers,news.answers
  4. Subject: comp.fonts FAQ: NeXT Info
  5. Supersedes: <font-faq-12_817479312@ora.com>
  6. Followup-To: poster
  7. Date: 14 Aug 1996 10:35:12 -0400
  8. Organization: O'Reilly and Associates, Inc.
  9. Lines: 515
  10. Sender: norm@ruby.ora.com
  11. Approved: news-answers-request@MIT.Edu
  12. Distribution: world
  13. Expires: 27 Sep 1996 14:34:08 GMT
  14. Message-ID: <font-faq-12_840033248@ora.com>
  15. References: <font-faq-1_840033248@ora.com>
  16. Reply-To: norm@ora.com (Norman Walsh)
  17. NNTP-Posting-Host: ruby.ora.com
  18. Summary: This posting answers frequently asked questions about fonts.
  19.          It addresses both general font questions and questions that
  20.          are specific to a particular platform.
  21. X-Web-Homepage: http://www.ora.com/homepages/comp.fonts/
  22. Xref: senator-bedfellow.mit.edu comp.fonts:48309 comp.answers:20523 news.answers:79244
  23.  
  24. Archive-name: fonts-faq/part12
  25. Version: 2.1.5
  26.  
  27. Subject: 7. NeXT Information
  28.   
  29.   If you have any suggestions for this section, please forward your
  30.   suggestions to norm.
  31.   
  32. Subject: 7.1. Tell me about NeXTstep fonts
  33.   
  34.   NeXTstep fonts are Adobe Type 1 fonts stored in ASCII (PFA) format.
  35.   There are several rules about how fonts must be installed before they
  36.   work.
  37.   
  38.   I'd like to thank Henry for rewriting this section.
  39.   
  40.   Basic Format
  41.   ============
  42.   
  43.   NeXTstep fonts live in one of three folders:
  44.   
  45.   /NextLibrary/Fonts
  46.        Contains system fonts.  In general, you will not install any
  47.        new fonts here.
  48.   
  49.   /LocalLibrary/Fonts
  50.        Contains fonts which are accessible to every user on a     system
  51.        or a network.
  52.   
  53.   ~/Library/Fonts
  54.        (where ~ is your home folder) means fonts     which are private to
  55.        a specific user.
  56.   
  57.   A NeXTstep font is actually a folder containing various components of
  58.   the font.  Components are:
  59.   
  60.      * the outline font file - REQUIRED
  61.   
  62.      * the font metrics (AFM) file - REQUIRED
  63.   
  64.      * one or more screen font (bitmap) files - OPTIONAL
  65.   
  66.   Font Folder and Font Filename Requirements
  67.   ==========================================
  68.   
  69.   The name of the folder containing a font and the name of the font file
  70.   itself must follow strict rules - the names can NOT be any old name you
  71.   like. For a font to work correctly, the base folder and font filename
  72.   MUST BE THE SAME as the name of the outline font.  This is usually the
  73.   same as the value of the FontName field in the AFM file or the value of
  74.   the /FontName key in the actual font itself.  Suppose you have a font
  75.   called Headhunter.  The Headhunter font must live within a folder called
  76.   
  77.          Headhunter.font
  78.   
  79.   within one of the three folders mentioned above.  Within the
  80.   Headhunter.font  folder, you must have the two files
  81.   
  82.          Headhunter       ( the outline file )
  83.          Headhunter.afm   ( the AFM file )
  84.   
  85.   If you have a bitmap file for Headhunter, it must live in a file
  86.   
  87.          Headhunter.bepf  ( the bitmap file )
  88.   
  89.   Variations such as Bold, Italic, etc., should be their own font files
  90.   in their own folder. So if you have a font called Headhunter-Bold, you
  91.   need to create a folder called
  92.   
  93.          Headhunter-Bold.font
  94.   
  95.   within one of the three folders mentioned above.  Within the
  96.   Headhunter.font  folder, you must have the two files
  97.   
  98.          Headhunter-Bold       ( the outline file )
  99.          Headhunter-Bold.afm   ( the AFM file )
  100.   
  101.   If you have a bitmap file for Headhunter, it must live in a file
  102.   
  103.          Headhunter-Bold.bepf  ( the bitmap file )
  104.   
  105.   For NeXTstep 1.0 ONLY, you also need to take the following steps:
  106.   -----------------------------------------------------------------
  107.   
  108.      * If they do not already exist, create the following folders:
  109.   
  110.           * ~/Library/Fonts/outline
  111.   
  112.           * ~/Library/Fonts/afm
  113.   
  114.           * ~/Library/Fonts/bitmap
  115.   
  116.      * In each of these folders, create a symbolic link to the
  117.        corresponding component file in each font.
  118.   
  119.   For NeXTstep 2.0 and up:
  120.   ------------------------
  121.   
  122.   The font description is taken from the font folder itself, so you don't
  123.   need to do this. It may be beneficial to simply create these folders
  124.   and put nothing in them, but I'm not sure it matters.
  125.   
  126.   Certain "old" applications which haven't upgraded to the NeXTstep 2.0
  127.   scheme of fonts may depend on these folders being present.
  128.   
  129.   The last step is to get the system to recognize the new font(s).  You
  130.   may have noticed the existence of three files in the Fonts folder:
  131.   .fontdirectory, .fontlist, and .afmcache. These are files the system
  132.   looks at to see which fonts exist.
  133.   
  134.   The easiest way to update them is to simply start up an application and
  135.   open the font panel. It should recognize that the update time stamp on
  136.   the Fonts folder has changed, and update the files accordingly. It is
  137.   probably a good idea to simply delete the three above files beforehand.
  138.   
  139.   You should get a message window saying "incorporating information on
  140.   new fonts. Please wait (this may take xx seconds)". Your new fonts
  141.   should be available now.
  142.   
  143.   If this does not work, you can update them manually. Open up a Terminal
  144.   shell and go to your Fonts folder. At the prompt, type two commands:
  145.   
  146.          buildafmdir     
  147.          cacheAFMData afm  (the parameter is the <afm dir>)
  148.   
  149.   The new fonts will not work if the cacheAFMData command is not run, and
  150.   since it is an undocumented command, it is a common culprit.
  151.   
  152.   [ed: the cacheAFMData step may not be required in 3.0 OS]
  153.   
  154.   I believe this is true.  Looks like the PasteBoard Services runs
  155.   cacheAFMData in 3.0.
  156.   
  157.   You should now be able to see and preview your fonts in the font panel.
  158.   
  159.   If you are still having problems with your font, such as the <<
  160.   Unusable font >> message, consult NeXTAnswers. There are some useful
  161.   suggestions for debugging faulty fonts there.  It is also always
  162.   helpful to look at existing fonts to see how they are installed.
  163.   
  164.   One note on the NeXTAnswers. Supposedly there are only a few discrete
  165.   values which are allowed to appear in the weight field of the font:
  166.   "Ultra Light", "Thin", "Light", "Extra Light", "Book", "Regular",
  167.   "Plain", "Roman", "Medium", "Demi", "Demi-Bold", "Semi-Bold", "Bold",
  168.   "Extra Bold", "Heavy", "Heavyface", "Black", "Ultra", "UltraBlack",
  169.   "Fat", "ExtraBlack", and "Obese". However, I have a few fonts where
  170.   this is not the case ("standard" is a common entry) and have had no
  171.   problems as of yet. But it would probably be wiser to be on the safe
  172.   side.
  173.   
  174.   See below for a definitive list.
  175.   
  176.   This is Info file compfont.info, produced by Makeinfo-1.55 from the
  177.   input file FAQ.texinfo.
  178.   
  179. Subject: 7.2. Tell me more about NeXTstep fonts
  180.   
  181.   Outline files should be in PFA or hexadecimal ASCII format.  The font
  182.   name should be taken either from the outline (font) file or the AFM
  183.   file. In both case the name is given after the word "FontName" at the
  184.   beginning of the file)
  185.   
  186.   As a matter of fact, fonts don't strictly HAVE to be in all hexadecimal
  187.   ASCII format.  The eexec portion of the font can be in binary if you
  188.   wish, and in fact some Mac->NeXTstep or PFB->NeXTstep font converters
  189.   simply strip off the Mac/PFB storage format headers and leave the
  190.   binary sections as binary.
  191.   
  192.   However, if you wish to send such a font across a serial channel to a
  193.   PostScript printer, you will need some way to unpack the binary eexec
  194.   portion to seven-bit ASCII before sending the font.
  195.   
  196.   Converted Fonts After Conversion
  197.   --------------------------------
  198.   
  199.   After conversion they are just like any other freeware or shareware
  200.   font that you can get in NeXTstep-format from the archives. That's just
  201.   outline and AFM files but no bitmapped screen fonts. So small point
  202.   size means poor resolution on screen but they most of should print OK
  203.   if they are any good ( = usually made with Fontographer).
  204.   
  205.   About Conversion Utilities
  206.   --------------------------
  207.   
  208.   NeXTstep utilities
  209.   ..................
  210.   
  211.      * unfont
  212.   
  213.        You can find a package, named something like
  214.        pcATMfont2NeXT.tar.Z, from NeXT archives (cs.orst.edu)
  215.        that converts PC fonts to NeXT format (PFB -> PFA).
  216.   
  217.        The most useful tool for me has been "unfont" which
  218.        converts the .pfb (binary outline) font to ASCII outline
  219.        font.
  220.   
  221.        I usually use it like this
  222.   
  223.                      $ unfont new_font.pfb >NewFont
  224.   
  225.        If the conversion was successful all I have to after that is
  226.          maybe to rename the font correctly and move the outline file
  227.             in the correct .font folder.
  228.   
  229.      * Opener.app
  230.   
  231.        Opener seems to be a very useful application since it can
  232.        open several kinds file packages on NeXTstep that are
  233.        common on other platforms. E.g. ".sit", ".hqx",          ".zoo",
  234.        ".zip", ".z", etc.
  235.   
  236.        I haven't used it a lot but looks very promising.
  237.   
  238.      * T1utils-1.1
  239.   
  240.        This is collection of command-line programs that manipulate
  241.         PS Type 1 fonts and one of them can also do the PFB->PFA
  242.        conversion (t1ascii?).
  243.   
  244.                   Basic unarchiving of Mac and PC files.
  245.   
  246.   On your Unix machine:
  247.   
  248.   xbin
  249.        Converts .hqx to:
  250.       .data
  251.             Rename and transfer to PC (or use opener.app on NeXT?)
  252.   
  253.       .info
  254.             Discard
  255.   
  256.       .rsrc
  257.             Discard
  258.   
  259.   unzip
  260.        Converts .zip to:
  261.       .inf
  262.             Discard
  263.   
  264.       .wfn
  265.             Discard
  266.   
  267.       .pfm
  268.             Discard (unless it can generate a better AFM file)
  269.   
  270.       everything else
  271.             Transfer to NeXT      On a PC:
  272.   
  273.   xbin
  274.        Converts .hqx to:
  275.       .data
  276.             Rename and transfer to PC (or use opener.app on NeXT?)
  277.   
  278.       .info
  279.             Discard
  280.   
  281.       .rsrc
  282.             Discard
  283.   
  284.   extract -f ...
  285.        Converts .cpt to:
  286.       file with no extension
  287.             This is usually the outline font.  Refont and transfer to
  288.                NeXT.
  289.   
  290.       .afm
  291.             Transfer to NeXT.
  292.   
  293.       .pfm
  294.             Discard (unless it can generate a better AFM file)
  295.   
  296.       .bma
  297.             Discard if you have an AFM file.
  298.   
  299.   unsit30 -eb ...
  300.        Converts .sit to:
  301.       file with no extension
  302.             This is usually the outline font.  Refont and transfer to
  303.                NeXT.
  304.   
  305.       .afm
  306.             Transfer to NeXT.
  307.   
  308.       .pfm
  309.             Discard (unless it can generate a better AFM file)
  310.   
  311.       .bma
  312.             Discard if you have an AFM file.
  313.   
  314.   refont
  315.        Converts outline formats from Mac to NeXT format (PFA).
  316.   
  317.   pkunzip
  318.        Converts .zip to:
  319.       .inf
  320.             Discard
  321.   
  322.       .wfn
  323.             Discard
  324.   
  325.       .pfm
  326.             Discard (unless it can generate a better AFM file)
  327.   
  328.       everything else
  329.             Transfer to NeXT      On a NeXT
  330.   
  331.   Opener.app
  332.        Converts archive formats (.sit, .hqx, .zip) to NeXT     format.
  333.   
  334.   unfont
  335.        Converts PFB files to NeXT format.
  336.   
  337.   afm
  338.        Converts AFM files to NeXT format AFM files (CR/LF hackery)
  339.   
  340.   Installation
  341.   ------------
  342.   
  343.   There are scripts (installfont) available that can handle the
  344.   installation process but here is how you do it manually.
  345.   
  346.      * .font
  347.   
  348.        After all that you have to create the .font folder, move the
  349.        outline and .afm files there and start fighting with the strangely
  350.        formatted .afm file. The most common problems are font name
  351.        mismatch between outline and AFM files (family name is incorrect
  352.        or too long, etc) and missing fields (ex. no ItalicAngle entry) in
  353.        the AFM file.
  354.   
  355.      * buildafmdir AND cacheAFMData
  356.   
  357.        buildafmdir puts its complains to Console but cacheAFMData put
  358.        them on stdout or stderr (ie. Terminal Window).
  359.   
  360.        PARSE ERRORS ----------- "Parse error 10000011 ..." comes from
  361.        mismatch between of CharMetrics declared in the .afm and actually
  362.        found. I haven't been able to figure out the other strange parse
  363.        errors.
  364.   
  365.        buildafmdir in the 3.0 release has the limitation of not being
  366.        able to install more that 255 fonts in any one font folder.  This
  367.        is supposed to be fixed in 3.1.
  368.   
  369.      * The Dreaded <<Unusable Font>> Message
  370.   
  371.        <<Unusable Font>> appears in the font panel when you have run
  372.        buildafmdir and it finds things it thinks are wrong with the AFM
  373.        file.  Errors can also be generated by parsing routines inside the
  374.        PasteBoard Services.
  375.   
  376.        <<Unusable Font>> almost NEVER has anything to do with the font
  377.        itself, since buildafmdir doesn't actually look inside the font.
  378.        Errors in the font due to faulty conversion will likely show up at
  379.        the time the PostScript server actually attempts to define the
  380.        font or render characters from the font.
  381.   
  382.        The only error I have ever seen from a converted font was the
  383.        results of a naive Macintosh to PFA converter, which didn't
  384.        understand that the POST resources in a Macintosh format Type 1
  385.        font do not have to be in order, nor do the POST resources all
  386.        have to be contiguous - they can be interspersed with other
  387.        resources.  The results were that a comment resource ended up in
  388.        the middle of the eexec section of the font and the PostScript
  389.        interpreter threw out lots of errors.
  390.   
  391.        <<Unusable Font>> almost ALWAYS occurs because there is something
  392.        wrong with the AFM file you installed.  Here is a partial list of
  393.        problems that can occur with AFM files:
  394.   
  395.           * Carriage-return characters (^M) at ends of lines.
  396.   
  397.             This happens when you get incomplete translations from PC
  398.             files, which use carriage-return-line-feed combinations at
  399.             ends of lines.
  400.   
  401.             Solution: edit away the carriage returns.  Make sure the
  402.             lines are terminated only by line-feed characters.
  403.   
  404.           * Spaces or tabs at ends of lines.
  405.   
  406.             Fixed in NeXTstep 3.1.
  407.   
  408.           * Missing fields.
  409.   
  410.             NeXTstep DEMANDS that certain fields be present in the AFM
  411.             file.  Required fields are: FontName, FullName, FamilyName,
  412.             Weight, EncodingScheme, and ItalicAngle.  If any of these
  413.             fields are missing, you will get the <<Unusable Font>>
  414.             message.
  415.   
  416.             Solution: fill in the required fields.
  417.   
  418.           * Incorrect Weight field.
  419.   
  420.             buildafmdir accepts only a certain set of values for the
  421.             Weight field.  Acceptable values are: "Ultra Light", "Thin",
  422.             "Light", "Extra Light", "Book", "Regular", "Plain", "Roman",
  423.             "Medium", "Demi", "Demi-Bold", "Semi-Bold", "Bold", "Extra
  424.             Bold", "Heavy", "Heavyface", "Black", "Ultra", "UltraBlack",
  425.             "Fat", "ExtraBlack", and "Obese".
  426.   
  427.           * Character information count mismatches.
  428.   
  429.             AFM files contain several sets of information which are
  430.             introduced by a "Startxxxxx nnn" line where the xxxxx is the
  431.             name of the section (such as StartCharMetrics) and nnn is the
  432.             purported number of lines of information of this type to
  433.             follow.  Sad to say, many many AFM files supplied by vendors
  434.             and others are such that the actual number of lines of data
  435.             do not match the number stated on the Startxxxxx line.  When
  436.             this error occurs in the AFM file, buildafmdir emits a Parse
  437.             Error message to the console and the font will be marked
  438.             unusable.  The parse error messages from buildafmdir is of
  439.             the form:
  440.   
  441.                    Parse error nnnnnnnn  xx yy
  442.   
  443.             where nnnnnnnn is the error number, xx is the number of lines
  444.             of information claimed to exist, and yy is the number of
  445.             lines actually read.  The nnnnnnnn are are:
  446.   
  447.                    10000011  mismatch in the StartCharMetrics section
  448.                    10000012  mismatch in the StartTrackKern section
  449.                    10000013  mismatch in the StartKernPairs section
  450.                    10000014  mismatch in the StartComposites section
  451.                    10000015  mismatch in a composite character specification
  452.   
  453.             I have converted many fonts from the Berkeley Macintosh User
  454.             Group CD ROM and fully half of the supplied AFM files are
  455.             incorrect.
  456.   
  457.      * Other AFM file errors.
  458.   
  459.        Parse error numbers 10000001 through 10000010 means some kinds of
  460.        syntax errors in the AFM data file.  Any of these errors mean that
  461.        the AFM file is truly hosed.
  462.   
  463. Subject: 7.3. Porting fonts to the NeXT
  464.   
  465.   Porting PC/Unix Type 1 Fonts
  466.   ============================
  467.   
  468.   You must have the .pfb and .afm files
  469.   
  470.   A PC Adobe font is stored in binary format, so the first step is to
  471.   convert it to ascii.
  472.   
  473.   There are a couple of utilities out there which can do this. I think
  474.   t1utils can do it, and there is a nice utility called pcATMfont2Next
  475.   which has a couple of tools to do this (unfont and pfb2ps). Look for
  476.   the file pcATMfont2Next.tar.Z; it is available on many ftp sites.
  477.   
  478.   Also, since NeXTstep run on Unix, there is the customary problem of
  479.   converting the CRs (carriage returns) that PCs use to the LFs
  480.   (Linefeeds) that Unix uses. The easiest way to do this is to use tr to
  481.   delete the octal for the CR character from both the .afm and outline
  482.   file. The command to do this is:
  483.   
  484.           tr -d '\015' < inputfile  > outputfile
  485.   
  486.   The unfont program will do this automatically when it converts the .pfb
  487.   file, but pfb2ps does not. I'm not sure if t1utils' utility does or not.
  488.   
  489.   Once you have the outline file, you can go ahead and install it by the
  490.   process outlined above.
  491.   
  492.   Otto J. Makela (otto@jyu.fi) posted a terrific cshell script to
  493.   comp.fonts, which automates just about everything for you. It converts
  494.   the .pfb to ASCII format, extracts the name from the FontName field,
  495.   creates the font folder, copies in the component files with the correct
  496.   name, and runs buildafmdir and cacheAFMData when done.  A newer version
  497.   of this script is now available from the standard NeXT step archives
  498.   (Sonata, etc.).
  499.   
  500.   Porting Mac Type 1 Fonts
  501.   ========================
  502.   
  503.   A variety of programs and scripts exist to convert Macintosh format
  504.   Type 1 fonts to UNIX format.  Their ability to do a complete job
  505.   varies.  Common traps which naive font converters fall into are:
  506.   
  507.      * not dealing with Macintosh POST which are out of order.
  508.   
  509.      * not dealing with Macintosh POST which are interspersed with other
  510.        resources.
  511.   
  512.      * not dealing at all with POST Type 4 resources where the font
  513.        program starts in resource fork of the file but the remainder of
  514.        the data is in the data fork.
  515.   
  516.        Most naive converters we've looked at have this problem.  This
  517.        means that most Type 3 fonts won't convert at all.
  518.   
  519.      * not dealing with MacBinary headers.
  520.   
  521. Subject: 7.4. Font availability
  522.   
  523.   [ The archive site at sonata.purdue.edu seems to have disappeared. ]
  524.   
  525. Subject: 7.5. Why can I only install 256 fonts on my NeXT?
  526.   
  527.   Included to NS3.0 there's a new 'buildafm'-routine (for non-NeXTers:
  528.   'buildafm' is a shell script which announces a new font to the
  529.   computer) at /usr/bin/buildafmdir. The new one only allows to install
  530.   about 256 fonts.  Running the new 'buildafmdir' to install a new font
  531.   surpresses every font above this number.  Workaround: Re-install the
  532.   'old buildafmdir' from NS2.1 at /usr/bin/buildafmdir and everything
  533.   should be fine!
  534.   
  535.   (thanks to: Rob Parkhill and d'Art Computers/Germany d'art)
  536.   
  537.   [ed: and my thanks to Borris Balzer for sending this to me]
  538.   
  539.