I'm working through Knuth's Metafont Book as preparation for learning Metapost and I'm running into some problems working through his "experiments". I've installed the latest TeX Live 2013 distribution on my system but I'm having problems.
Here's the code (contained in file io.mf as recommended by Knuth):
mode_setup;
em#:=10pt#; cap#:=7pt#;
thin#:=1/3pt#; thick#:=5/6pt#;
o#:=1/5pt#;
define_pixels(em,cap);
define_blacker_pixels(thin,thick);
define_corrected_pixels(o);
curve_sidebar=round 1/18em;
beginchar("O", 0.8em#, cap#, 0); "The letter O";
penpos1(thick,10); penpos2(.1[thin,thick],90-10);
penpos3(thick,180+10); penpos4(thin,270-10);
x1l=w-x3l=curve_sidebar; x2=x4=.5w;
y1=.49h; y2l=-o; y3=.51h; y4l=h+o;
penstroke z1e{down}..z2e{right}
..z3e{up}..z4e{left}..cycle;
penlabels(1,2,3,4); endchar;
Now, when running the mf
command and loading this file, I get a window that is unfortunately empty. Supposedly a large letter "O" should appear.
$ mf
This is METAFONT, Version 2.718281 (TeX Live 2013)
**io
(io.mf
The letter O [79])
*end
Output written on io.2602gf (1 character, 1724 bytes).
Transcript written on io.log.
$ gftodvi io.2602gf
gftodvi: fatal: tfm file `gray.tfm' not found.
Then, when trying to use the gftodvi
command I get the above error.
- Any ideas why my "window" that should display the letter "O" is blank/empty?
- How do I resolve the gray.tfm error?
- Are the two related?
Note: I'm using Ubuntu 14.04, but the TeXLive installation is NOT from the Ubuntu repository. I used the installer from http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz and created a local "portable" installation.
Best Answer
TeX Live can generate the missing TFM files automatically:
Documentation: kpathsea, section "2.2.9
mktex
scripts".TeX and friends are using the kpathsea library for the file lookup business. Depending on the configuration, the library runs help programs
mktex*
to create missing files. For example,mktextfm
is triggered, if a.tfm
file is not found.The following older version of this answer uses this indirect triggering.
Older version
The following TeX file
test.tex
loads the fonts:Run it through
tex
orlatex
:(I have omitted the generation of
black.tfm
and have replaced the paths with the name of the search path variable.)Then
gftodvi
findsgray.tfm
.