0

Some time ago, I posted this question. I forgot about it, and it popped up just yesterday thanks toa comment. It is in a sorry state, and I have been suggested to ask a new one with the only issue that is left there. Which is the following. I tried using the bickham package, getting errors related to a non-found tfm file. More precisely, let me paste an excerpt of the question here.

< Excerpt >

I really do not know what went wrong when I tried bickham. All I can see is that one of my files currently reads:

    \documentclass[a4paper]{report}
    \usepackage{amsfonts,fontinst,bickham}
    \installfont{bickham}{latin}{t1}{T1}{ptm}{m}{n}{}
\begin{document}
$$\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$
$$\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$
$$\mathfrak{abcdefghijklmnopqrstuvwxyz}$$
$$\mathcal{a\,b\,c\,d\,e\,f\,g\,h\,i\,j\,k\,l\,m\,n\,o\,p\,q\,r\,s\,t\,u\,v\,w\,x\,y\,z}$$
\end{document}

And compiling that yields:

[…]

     This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
     restricted \write18 enabled.
     entering extended mode
     (./mathcal_fontinst.tex
     LaTeX2e <2014/05/01>
     Babel <3.9k> and hyphenation patterns for 78 languages loaded.
     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/report.cls
     Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo))
     (/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/amsfonts.sty)
     (/usr/local/texlive/2014/texmf-dist/tex/fontinst/base/fontinst.sty
     No file fontinst.rc.
     ) (/Users/michelegorini/Library/texmf/tex/latex/bickham/bickham.sty
     (/usr/local/texlive/2014/texmf-dist/tex/latex/xkeyval/xkeyval.sty
     (/usr/local/texlive/2014/texmf-dist/tex/generic/xkeyval/xkeyval.tex
     (/usr/local/texlive/2014/texmf-dist/tex/generic/xkeyval/keyval.tex))))
     (./mathcal_fontinst.aux)
     (/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsa.fd)
     (/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/umsb.fd)
     (/Users/michelegorini/Library/texmf/tex/latex/bickham/ubickham.fd)
     kpathsea: Running mktextfm bickham-r
     mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input bickham-r
     This is METAFONT, Version 2.7182818 (TeX Live 2014) (preloaded base=mf)
 kpathsea: Running mktexmf bickham-r

 ! I can't find file `bickham-r'.
 &lt;*&gt; ...jfour; mag:=1; nonstopmode; input bickham-r

 Please type another input file name
 ! Emergency stop.
 &lt;*&gt; ...jfour; mag:=1; nonstopmode; input bickham-r

 Transcript written on mfput.log.
 grep: bickham-r.log: No such file or directory
 mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input bickham-r' failed to make bickham-r.tfm.
 kpathsea: Appending font creation commands to missfont.log.

 ./mathcal_fontinst.tex:6: Font U/bickham/m/n/10=bickham-r at 10.0pt not loadabl
 e: Metric (TFM) file not found.
 &lt;to be read again&gt; 
                    relax 
 extract@font ...ont font@name external@font relax 
                                                   font@name relax csname f@e...

 define@newfont ...ong@fontshape else extract@font 
                                                   fi endgroup 
 pickup@font ...ifx font@name relax define@newfont 
                                                   fi 
 getanddefine@fonts ...size endcsname }pickup@font 
                                                   let textfont@name font@nam...

 select@group ...me c@mv@math@version endcsname }#3
                                                   globaldefs @ne math@fonts ...
 l.6 $$\mathcal{ABCDEFGHIJKLMNOPQRSTUVWXYZ}
                                           $$
 ?

Greek, Greek, Gibberish. That is with the \installfont commented. Uncomment it, and this is what happens:

     This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
     restricted \write18 enabled.
     entering extended mode
     (./mathcal_fontinst.tex
     LaTeX2e <2014/05/01>
     Babel <3.9k> and hyphenation patterns for 78 languages loaded.
     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/report.cls
     Document Class: report 2007/10/19 v1.4h Standard LaTeX document class
     (/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo))
     (/usr/local/texlive/2014/texmf-dist/tex/latex/amsfonts/amsfonts.sty)
     (/usr/local/texlive/2014/texmf-dist/tex/fontinst/base/fontinst.sty
     No file fontinst.rc.
     ) (/Users/michelegorini/Library/texmf/tex/latex/bickham/bickham.sty
     (/usr/local/texlive/2014/texmf-dist/tex/latex/xkeyval/xkeyval.sty
     (/usr/local/texlive/2014/texmf-dist/tex/generic/xkeyval/xkeyval.tex
     (/usr/local/texlive/2014/texmf-dist/tex/generic/xkeyval/keyval.tex))))
     ./mathcal_fontinst.tex:3: Too many }'s.
     \input_metrics ...t \curr_file_list \else \egroup 
                                                       \bgroup #1\expandafter \pr...
 \installfont ...al =\x_relax \input_metrics {}{#2}
                                                   \etxtovpl {#3}{#1}\install...
 l.3 ...llfont{bickham}{latin}{t1}{T1}{ptm}{m}{n}{}

 ?

< /Excerpt >

It seems that tfm file just won't be found. THe strange thing is, if I open the folder of the bickham package, I see lots of tfms, precisely the folder contains the files in the following screenshot:

enter image description here

That folder, however, is definitely found, since the package is called. And a few .fds from the folder are also loaded. I have been told I should install the fonts, but if I have the fd and tfm files TeX should not have to know whether I have the fonts installed on my computer since those are the files it uses. So why is this tfm file simply not found?

MickG
  • 5,426
  • You don't want to load fontinst. You don't want the \installfont line. These are used to generate the .tfm, .vf etc. in the first place. bickham already provides those. And please don't use $$ in LaTeX documents - it is long deprecated. *But*, as I said before, none of this will work without the fonts themselves. You need to acquire the fonts from Adobe and produce type1 versions for TeX to use. The .tfm files etc. are enough for TeX itself. You can produce a .dvi that way. However, without the fonts, all you'll have is boxes. Right now, you have information about the ... – cfr Mar 13 '15 at 13:10
  • *size* of each glyph in the font. That's what the .afm files provide. This gets used in the .tfm files for TeX. Regular LaTeX uses that information in typesetting - it just treats everything as a box, so it only needs to know the size of the boxes, when it should move the boxes a little bit relative to each other etc. It doesn't need to know what is in the boxes. But you don't have the glyphs i.e. the little picture of each character in the font. This is needed to view the .dvi, convert it to .ps or, in the case of pdfLaTeX, to produce the PDF directly. – cfr Mar 13 '15 at 13:12
  • For pdfLaTeX, you'd also need to tell TeX about the .map file if you've not installed the fonts. That's easy but, as I say, there really isn't any point since pdfTeX needs the type1 versions for the PDF. – cfr Mar 13 '15 at 13:18
  • @cfr I read TFM not found. So why is it not found? I mean OK maybe I can't produce a PDF with only those files, but the error should not say TFM file not found, but rather something different. So why can it not find the TFM? As for the $$, don't worry, I've stopped, but this file is very old, and there is no point editing it now. – MickG Mar 13 '15 at 15:14
  • Also, my Font Book says I have a Bickham Script MM font. – MickG Mar 13 '15 at 15:15
  • And I've just used it with XeTeX. – MickG Mar 13 '15 at 15:19
  • Also, I get more or less the same result by loading just amsfonts and declaring a math alphabet for bickham with code copied from the package. – MickG Mar 13 '15 at 15:23
  • XeTeX uses your system fonts. TeX and pdfTeX cannot do that. So having it in Font Book is relevant in the first case but not the second. To use it with XeTeX, you don't need any of that stuff from the bickham package anyway. It isn't failing to find the .tfm. It is failing to find an .mf because you've not added the .map fragment. You can say \pdfmapfile{+bickham.map} and it will stop trying to use a metafont version. But it won't find the type1 version unless you ensure that's available. – cfr Mar 13 '15 at 16:21
  • But if «it isn't failing to find the .tfm», why does it say Font U/bickham/m/n/10=bickham-r at 10.0pt not loadabl e: Metric (TFM) file not found.? – MickG Mar 13 '15 at 16:45
  • It is failing to find it but this is because it thinks it is supposed to make it first. So it tries to make it and then it looks there. But the problem is that it cannot make it. And it can't make it because there is no .mf. And it thinks it is meant to make it because you haven't told it otherwise. That's why you need it to read the .map file fragment. By default, it assumes it is dealing with a metafont font unless it knows otherwise. If the font is type1 or truetype or whatever, it knows otherwise from .map files. – cfr Mar 13 '15 at 18:35
  • Umm… pdfTeX warning: /usr/texbin/pdflatex (file bickham.map): cannot open font map f ile. After adding \pdfmapfile{+bickham.map}, that is. – MickG Mar 13 '15 at 19:47
  • But you have the file in your working directory? – cfr Mar 13 '15 at 21:54
  • I downloaded the package, created a test document in the unzipped directory and ran pdfLaTeX. It found the map file fragment fine. Of course, I got a fatal error preventing compilation as I don't have the type1 fonts, but it found the map file. – cfr Mar 13 '15 at 22:05
  • Well the .map is together with bickham.sty which is found. It is in the local branch, where I put new packages or other files that should be visible system-wide. – MickG Mar 13 '15 at 22:07
  • But putting the document in the directory of the package changes the behaviour to !pdfTeX error: /usr/texbin/pdflatex (file BickhamScriptPro-Semibold.pfb): canno t open Type 1 font file for reading ==> Fatal error occurred, no output PDF file produced!. – MickG Mar 13 '15 at 22:08
  • However, putting the .map (a duplicate of it) in the document's directory changes nothing. – MickG Mar 13 '15 at 22:11
  • You mean you didn't have the files from the package in your working directory before?! How was it finding the .sty file in that case? Note that the error you are now seeing is normal - you don't have the type1 fonts any more than I do. If you remove the map line and compile with latex, you can produce a perfectly good .dvi. You'll just get errors when you try to view it because you don't have the fonts. – cfr Mar 13 '15 at 22:13
  • Slightly unrelated: I updated to TeX Live 2015 (or whatever there is just above 2014), but TeX is still loading the old versions of the packages. How can I correct that? – MickG Mar 13 '15 at 22:13
  • You know, there is a directory which is there precisely for new packages to be found by TeX. On my mac, it is Home/Library/texmf/tex/latex. In there, I have the bickham directory in which all the files in the screenshot you see in the question are located. – MickG Mar 13 '15 at 22:15
  • If TL 2015 has been released, you are better informed than me. As far as I know, TL 2014 is the latest. Re. putting the .map in the document's directory: of course, that's not enough. If you don't have the other files, it won't find them. Either you have all the relevant files in your directory, or you install them in a TEXMF tree properly. Otherwise, they won't be found. – cfr Mar 13 '15 at 22:15
  • What do you mean by "properly"? Just putting them there isn;t enough? FOr a package, it is. What should I do? – MickG Mar 13 '15 at 22:16
  • Ah no, I was misled by the names I gave the aliases of the directories where the standard packages are :). I have 2012, 2013 and 2014, and 2014 is being used. – MickG Mar 13 '15 at 22:18
  • You have to install the package properly. LaTeX looks for particular file types in particular places. It will look for the .sty file and .fd files there but it will not look for .map or .vf or .tfm files. Look at where these files are in your main TEXMF tree and mirror that structure if you want to do it that way. (Unless you are planning to acquire the fonts, I wouldn't bother but it is obviously your call.) – cfr Mar 13 '15 at 22:18
  • It seems I do not have any other .map file. WHat other kinds of files are in the same place as .maps? – MickG Mar 13 '15 at 22:34
  • Ah no wait. Found them. texmf-dist/fonts/map. Copied the structure into the local branch, i.e. created Home/Library/texmf/texmf-dist/map. Put the .map there. Created, always in that texmf-dist, the vf and afm folders, and put relevant files there. Result: no change. I think I'm giving up. Tomorrow, I'll write up an answer explaining what is going on here, so this question is finally considered as answered and bumped off the unanswered list. Of course, you are more qualified for that, and I would thank you if you did that. Right now it's bedtime, so goodnight and thanks. – MickG Mar 13 '15 at 22:39
  • .../texmf-dist/ is the root of the tree. Skip it. You can't skip the directories below. You need e.g. fonts/map/dvips/bickham/bickham.map. Similarly for the other files. If you say kpsewhich -var TEXMFMAIN and compare with kpsewhich -var TEXMFHOME you will get the roots of the two trees. The structure beneat those roots needs to be the same. – cfr Mar 13 '15 at 23:03

1 Answers1

4

Statement of Limitation

This answer concerns the use of type1 fonts with TeX and pdfTeX. Claims do not apply to XeTeX or LuaTeX. Nor am I concerned here with the use of METAFONT fonts. These topics are mentioned only incidentally. If you want information about the preparation, installation or use of fonts in any of these situations, this answer will only confuse you!

Answer

The code in the question reflects considerable confusion. The code is a LaTeX document which tries to call fontinst as a package. This confuses 2 fundamentally distinct activities and omits a third:

  1. Preparing the files which LaTeX (and TeX) need to use a font.
  2. Installing a font together with the files prepared to support its use.
  3. Using an installed font in a document.

When you write a LaTeX (or TeX) document, 1 and 2 must already have been completed.

fontinst is a package which you can use to complete some of the steps required at stage 1. On its own, it is not sufficient to complete stage 1. Moreover, it has nothing to do with stages 2 or 3. fontinst's work is done before completion of stage 1.

It should never be called as a package in a regular LaTeX document.

Here is what CTAN has to say about it:

TeX macros for con­vert­ing Adobe Font Met­ric files to TeX met­ric and vir­tual font for­mat. Fon­tinst helps mainly with the num­ber crunch­ing and shov­el­ling parts of font in­stal­la­tion. This means in prac­tice that it cre­ates a num­ber of files which give the TeX met­rics (and re­lated in­for­ma­tion) for a font fam­ily that (La)TeX needs to do any type­set­ting in these fonts. Fon­tinst fur­ther­more makes it easy to cre­ate fonts con­tain­ing glyphs from more than one base font, tak­ing ad­van­tage of (e.g.) "ex­pert" font sets.

Fon­tinst can­not ex­am­ine files to see if they con­tain any use­ful in­for­ma­tion, nor au­to­mat­i­cally search for files or work with bi­nary file for­mats; those tasks must nor­mally be done man­u­ally or with the help of some other tool, such as the pltotf and vp­tovf pro­grams.

When you download a font support package, however, stage 1 is typically already complete. Indeed, the whole point of using such a package is that you don't have to worry about stage 1.

Once you have bickham, therefore, you only need to worry about stages 2 and 3. At least, that would be the case with a typical font support package. In the case of bickham, there is the additional requirement to obtain the fonts from Adobe. Without those fonts, nothing is actually going to work.

However, if you insist on continuing anyway because you either have no interest in producing actual documents or you just don't believe me when I tell you you need a copy of the fonts for this to work, you may proceed as follows.

Quick Method

I use this when creating a font support package for testing. It is quick and saves installing and reinstalling when I find I've made a mistake.

Put a simple test document and the .map, .fd, .tfm, .pfb and, if applicable .vf and .sty files into a directory together with a test file:

  • Of course, if you do not have the .pfb files, you can't put them in the directory. That's a problem, as will become obvious.

In the case of bickham, for pdfLaTeX use

\documentclass{article}
\pdfmapfile{+bickham.map}
\usepackage{bickham}
\begin{document}
    abc $\mathcal{abc}$ abc
\end{document}

For LaTeX use

\documentclass{article}
\usepackage{bickham}
\begin{document}
    abc $\mathcal{abc}$ abc
\end{document}

What happens if the .pfb is missing?

In this case:

  • pdfLaTeX will encounter a fatal error the first time you try to use one of the fonts. This is because it cannot produce the PDF without the type1 font your document requires.
  • LaTeX, however, will successfully produce a .dvi.

Why the difference? TeX regards the entire universe as made up of boxes. Different boxes have different heights, widths and depths, and sometimes there are rules about what to do when a particular box is followed by another one. The .tfm and .vf files provide information about the boxes relevant to typesetting the fonts supported by bickham. The .tfms, in particular, tell TeX the dimensions of the box for each character in the font supported by the package. They also provide the kerning information. For example, a .tfm for a particular font might tell TeX that if the character in slot 131 is followed by the character in slot 126, then the box for the latter should be shifted a little bit to the left or right. They might even tell TeX that the two boxes should be replaced by the box for the character in slot 45.

As far as TeX is concerned, .tfm files just are fonts. That's because fonts are just information about boxes.

TeX doesn't know or care that fonts typically also contain pictures of each character - glyphs. It doesn't need the glyphs to figure out how to arrange the boxes.

So, when you use LaTeX to compile the example above, TeX finds everything it needs. It produces the .dvi file just fine. Only when you come to view the document will you get errors. Specifically, your viewer will complain that it can neither find not construct the fonts the document is asking for.

So the example above produces the following:

the bickham gap

The characters in Computer Modern display fine, of course. The gap is where the bickham glyphs should be displayed. Note that the correct amount of space is left for them (I assume) since TeX knows how big each character's box is and whether adjustments are needed when b follows a or c follows b. But without the glyph itself, your viewer can't show you the content of those boxes.

In contrast, pdfLaTeX encounters a fatal error because pdfTeX puts the pictures in the document. It uses both information about the boxes from the .tfm files and the pictures from the .pfb. If it cannot find the type1 font, therefore, compilation fails.

There is therefore no point in installing bickham unless you have the type1 fonts available or like playing with invisible boxes in .dvis.

Installation

Nonetheless, if for some bizarre reason you want to do this, the recommendation is to install into your local texmf tree.

kpsewhich -var TEXMFLOCAL

will tell you were this is. Probably /usr/local/texlive/texm-local.

Start by downloading bickham.tds.zip from CTAN. Copy this file to the directory you identified as TEXMFLOCAL. (You will need, probably, to authenticate to do this.)

Change to TEXMFLOCAL, unzip and install:

cd $(kpsewhich -var TEXMFLOCAL)
sudo unzip bickham.tds.zip
sudo rm bickham.tds.zip
sudo mktexlsr $(kpsewhich -var TEXMFLOCAL)

Make sure that you have eradicated all traces of bickham from TEXMFHOME.

sudo updmap-sys --enable Map=bickham.map

Now you can generate fatal errors or play with invisible boxes without needing the package files in your working directory. Congratulations.

You now modify the pdfLaTeX example to delete the \pdfmapfile line i.e. the example for pdfLaTeX is now identical to that for LaTeX. This is because you've added the .map file fragment from bickham to the files which pdfTeX uses to map from TeX fonts to type1 fonts. (Basically, a kind of directory which tells pdfTeX where the pictures are kept for each such font it knows about.)

  • Note that this will break things when you try to use the fonts because, as mentioned several times already, pdfTeX will look for the .pfb files. Using updmap-sys to enable the bickham.map fragment or adding it using \pdfmapfile is essentially telling pdfTeX fibs. You are claiming to have font files you don't. So it is no use complaining when it fails to compile with fatal errors. You've deliberately given it a phone book with spurious information. When it goes AWOL to look for Santa at the North Pole, the responsibility will be entirely yours.
cfr
  • 198,882