[OS X TeX] A question about Metafont

Peter Dyballa Peter_Dyballa at Web.DE
Mon Oct 8 06:18:14 EDT 2007

Am 07.10.2007 um 18:18 schrieb André Bellaïche:

> I had to study a paper by Bruno Voisin and the Font installation  
> guide by Philip Lehmann to figure out what are all  
> these .pfb, .vpl, .pl, .mtw, .vf files (for .fd and .sty, I knew  
> already). Then I had to enter many command lines without being  
> allowed a single error.

Then you should know that MTX (not .mtw), VPL, and PL files are only  
temporary: the exist at some stage can then be removed. The best one  
say about all these files and the MAP file fragments: they're  
strictly algorithmic, i.e. it's easy to write a script that does all  
the work automatically. For example:

	#!/bin/csh -f
	#	@(#) Inst2.csh  -*- coding: iso-8859-15; -*-
	#       Time-stamp: <2006-01-08 15:38:14 pete>
	set Zahl     = 1
	set FontMap  = .../Fonts/FontNames.Map
	set init     = "\bigtest\init"
	set bye      = "\bigtest\bye"
	set Inst     = `basename $cwd`
	set Fam      = `grep -w $Inst $FontMap | awk '{print $2}'`
	set Font     = `grep -w $Inst $FontMap | awk '{print $3}'`
	set Namen    = `grep -w $Inst $FontMap | awk '{print $NF}' | tr '+'  
' '`
	set Anzahl   = ${#Namen}
	set myTFMdir = `kpsepath tfm | tr ':' '\012' | egrep -v '^(\.|\!|/ 
var)' | sed -e 's://:/:'`
	set TFMdir   = ${myTFMdir}${Fam}/${Font}
	set AFMdir   = `echo $TFMdir   | sed -e s:tfm:afm:`
	set VFdir    = `echo $TFMdir   | sed -e s:tfm:vf:`
	set T1dir    = `echo $TFMdir   | sed -e s:tfm:type1:`
	set ENCdir   = `echo $myTFMdir | sed -e s:tfm:enc/fontinst/${Fam}:`
	set MAPdir   = `echo $myTFMdir | sed -e s:tfm:map/fontinst/updmap:`
	set STYdir   = `echo $myTFMdir | sed -e s:fonts/tfm:tex/latex/${Fam}:`
	set Viewer   = "TeXShop.app"
	echo "myTFMdir ist $myTFMdir"
	echo "Inst     ist $Inst"
	echo "Fam      ist $Fam"
	echo "FontMap  ist $FontMap"
	echo "Font     ist $Font"
	echo "TFMdir ist $TFMdir"
	echo "AFMdir ist $AFMdir"
	echo "VFdir  ist $VFdir"
	echo "T1dir  ist $T1dir"
	echo "ENCdir ist $ENCdir"
	echo "MAPdir ist $MAPdir"
	echo "STYdir ist $STYdir"
	fontinst ${Font}2inst.tex
	tex finstmsc.tex
	mv inst.map ${Font}.map
	if ( ! -d $TFMdir ) mkdir -p $TFMdir
	if ( ! -d $AFMdir ) mkdir -p $AFMdir
	if ( ! -d $VFdir )  mkdir -p $VFdir
	if ( ! -d $T1dir )  mkdir -p $T1dir
	if ( ! -d $STYdir ) mkdir -p $STYdir
	if ( ! -d $ENCdir ) mkdir -p $ENCdir
	if ( ! -d $MAPdir ) mkdir -p $MAPdir
	if (`uname` == Darwin) then
	    apply pltotf *8r.pl *9z.pl
	    apply vptovf *.vpl
	    foreach PL ( *8r.pl *9z.pl )
	        pltotf $PL
	    foreach VPL ( *.vpl )
	        vptovf $VPL
	    mv *.tfm       $TFMdir
	    mv *.vf        $VFdir
	    mv *.sty       $STYdir
	    cp *.fd        $STYdir
	    cp ${Font}.map ${MAPdir}
	    echo "Remember to invoke 'sudo updmap-sys --nohash --enable Map=$ 
{Font}" #  --nomkmap !?
	    cp *9[sz].afm  $AFMdir
	    cp *9[sz].pfb  $T1dir
	# Create proof sheets:
	foreach Kode ( 7t 8t 8c )
	    if ( -f ${Kode}.lst ) rm ${Kode}.lst
	    set Anzahl  =  `ls -1 *${Kode}.vpl | wc -l`
	    foreach font ( `ls -1 *${Kode}.vpl | sed -e 's/.vpl/ /g'` )
	        @ Anzahl--
	        echo $font >> ${Kode}.lst
	        if ( $Anzahl != 0 ) then
	            echo $init >> ${Kode}.lst
	            echo $bye >> ${Kode}.lst
	    pdflatex nfssfont < ${Kode}.lst
	    mv nfssfont.pdf nfssfont_${Font}-${Kode}.pdf
	    open -a "$Viewer" nfssfont_${Font}-${Kode}.pdf
	set Name = fontsmpl_${Font}
	pdflatex fontsmpl <<Koniec
	mv fontsmpl.pdf ${Name}.pdf
	open -a "$Viewer" ${Name}.pdf
	# Finish up by removing all debris:
	rm *.aux *.ps *.recs nfssfont.log *.pl *.vpl #*.lst *.mtx *.log

In my case the script reads from a file $FontMap some TAB separated  
values like these

	univers			adobe		pun	pund8a+pundo8a+punm8a+punmo8a+punl8a+punlo8a 
	LucidaBright            bh              slh     slhd8a+slhdi8a+slhr8a 

and knows about the amount of work coming. The fontinst input TeX  
file can be created from a template. Here is a more simple example,  
that be used to create a template:

	%%% -*- mode: LaTeX; coding: iso-8859-15; -*-
	%	Time-stamp: <2005-06-21 12:46:41 pete>
	%	@(#) slh-inst.tex V 1.25: Install Lucida Bright textfonts
	\input fontinst.sty
	%%% Lucida Bright %%%
	\setint{slant}{194} % 11,4°
	\setint{uslant}{-125} % -7,1°
	%\setint{slant}{170} % 87,5% of 11,4°
	% We're starting with some real things!
	%%%% This is the usual set:
	%  \transformfont{slhr8r}    {\reencodefont{8r} {\fromafm{slhr8a}}}
	%  \transformfont{slhri8r}   {\reencodefont{8r} {\fromafm{slhri8a}}}
	%  \transformfont{slhd8r}    {\reencodefont{8r} {\fromafm{slhd8a}}}
	%  \transformfont{slhdi8r}   {\reencodefont{8r} {\fromafm{slhdi8a}}}
	%% Here are the slanted alternates:
	  \transformfont{slhro8r} {\slantfont{\int{slant}} {\fromafm{slhr8r}}}
	  \transformfont{slhdo8r} {\slantfont{\int{slant}} {\fromafm{slhd8r}}}
	%% Here are the upright italic variants:
	  \installfont  {slhr7t}  {slhr8r,newlatin}            {ot1} {OT1} 
	  \installfont  {slhrc7t} {slhr8r,newlatin}            {ot1c}{OT1} 
	  \installfont  {slhd7t}  {slhd8r,newlatin}            {ot1} {OT1} 
	  \installfont  {slhdc7t} {slhd8r,newlatin}            {ot1c}{OT1} 
	  \installfont  {slhri7t}{slhri8r,newlatin option nosc}{ot1i}{OT1} 
	  \installfont  {slhro7t}{slhro8r,newlatin option nosc}{ot1i}{OT1} 
	  \installfont  {slhru7t}{slhru8r,newlatin option nosc}{ot1} {OT1} 
	  \installfont  {slhdi7t}{slhdi8r,newlatin option nosc}{ot1i}{OT1} 
	  \installfont  {slhdo7t}{slhdo8r,newlatin option nosc}{ot1i}{OT1} 
	  \installfont  {slhdu7t}{slhdu8r,newlatin option nosc}{ot1} {OT1} 
	 \installfamily {T1}{slh}{}
	  \installfont  {slhr8t}  {slhr8r,newlatin}             {t1}  {T1} 
	  \installfont  {slhrc8t} {slhr8r,newlatin}             {t1c} {T1} 
	  \installfont  {slhd8t}  {slhd8r,newlatin}             {t1}  {T1} 
	  \installfont  {slhdc8t} {slhd8r,newlatin}             {t1c} {T1} 
	  \installfont  {slhri8t}{slhri8r,newlatin option nosc} {t1}  {T1} 
	  \installfont  {slhro8t}{slhro8r,newlatin option nosc} {t1}  {T1} 
	  \installfont  {slhru8t}{slhru8r,newlatin option nosc} {t1}  {T1} 
	  \installfont  {slhdi8t}{slhdi8r,newlatin option nosc} {t1}  {T1} 
	  \installfont  {slhdo8t}{slhdo8r,newlatin option nosc} {t1}  {T1} 
	  \installfont  {slhdu8t}{slhdu8r,newlatin option nosc} {t1}  {T1} 
	  \installfont  {slhr8c}  {slhr8r,textcomp}             {ts1}{TS1} 
	  \installfontas{slhr8c}                                     {TS1} 
	  \installfont  {slhd8c}  {slhd8r,textcomp}             {ts1}{TS1} 
	  \installfontas{slhd8c}                                     {TS1} 
	  \installfont  {slhri8c}{slhri8r,textcomp}            {ts1i}{TS1} 
	  \installfont  {slhro8c}{slhro8r,textcomp}            {ts1i}{TS1} 
	  \installfont  {slhru8c}{slhru8r,textcomp}            {ts1i}{TS1} 
	  \installfont  {slhdi8c}{slhdi8r,textcomp}            {ts1i}{TS1} 
	  \installfont  {slhdo8c}{slhdo8r,textcomp}            {ts1i}{TS1} 
	  \installfont  {slhdu8c}{slhdu8r,textcomp}            {ts1i}{TS1} 

and this is a bit complicated example:

	%%% -*- mode: LaTeX; coding: iso-8859-15; -*-
	%	Time-stamp: <2005-08-08 12:26:24 pete>
	%	@(#) pun-inst.tex V 1.25: Install Adobe Univers textfonts
	\input fontinst.sty
	%%% Adobe Univers %%%
	  \transformfont{punl8r}  {\reencodefont{8r}{\fromafm{punl8a}}}
	  \transformfont{punlo8r} {\reencodefont{8r}{\fromafm{punlo8a}}}
	  \transformfont{punm8r}  {\reencodefont{8r}{\fromafm{punm8a}}}
	  \transformfont{punmo8r} {\reencodefont{8r}{\fromafm{punmo8a}}}
	  \transformfont{pund8r}  {\reencodefont{8r}{\fromafm{pund8a}}}
	  \transformfont{pundo8r} {\reencodefont{8r}{\fromafm{pundo8a}}}
	  \transformfont{punx8r}  {\reencodefont{8r}{\fromafm{punx8a}}}
	  \transformfont{punxo8r} {\reencodefont{8r}{\fromafm{punxo8a}}}
	  \transformfont{punm8rc} {\reencodefont{8r}{\fromafm{punm8ac}}}
	  \transformfont{pund8rc} {\reencodefont{8r}{\fromafm{pund8ac}}}
	  \transformfont{punm8rx} {\reencodefont{8r}{\fromafm{punm8ax}}}
	  \installfont  {punl7t}      {punl8r,punl9z,newlatin}             
{ot1} {OT1}{pun}{l}{n}{}
	  \installfont  {punlc7t}     {punl8r,punl9z,newlatin}             
	  \installfont  {punm7t}      {punm8r,punm9z,newlatin}             
{ot1} {OT1}{pun}{m}{n}{}
	  \installfont  {punmc7t}     {punm8r,punm9z,newlatin}             
	  \installfont  {pund7t}      {pund8r,pund9z,newlatin}             
{ot1} {OT1}{pun}{b}{n}{}
	  \installfont  {pundc7t}     {pund8r,pund9z,newlatin}             
	  \installfont  {punx7t}      {punx8r,punx9z,newlatin}             
{ot1} {OT1}{pun}{bx}{n}{}
	  \installfont  {punlo7t}   {punlo8r,punlo9z,newlatin option nosc} 
	  \installfont  {punmo7t}   {punmo8r,punmo9z,newlatin option nosc} 
	  \installfont  {pundo7t}   {pundo8r,pundo9z,newlatin option nosc} 
	  \installfont  {punm7tc}   {punm8rc,punm9zc,newlatin}             
{ot1} {OT1}{pun}{mc}{n}{}
	  \installfont  {pund7tc}   {pund8rc,pund9zc,newlatin}             
{ot1} {OT1}{pun}{bc}{n}{}
	  \installfont  {punxo7t}   {punxo8r,punxo9z,newlatin option nosc} 
	  \installfont  {punmo7tc}{punmo8rc,punmo9zc,newlatin option nosc} 
	  \installfont  {pundo7tc}{pundo8rc,pundo9zc,newlatin option nosc} 
	  \installfont  {punm7tx}   {punm8rx,punm9zx,newlatin}             
{ot1} {OT1}{pun}{mx}{n}{}
	  \installfont  {punmo7tx}{punmo8rx,punmo9zx,newlatin option nosc} 
	 \installfamily {T1}{pun}{}
	  \installfont  {punl8t}      {punl8r,punl9z,newlatin}              
{t1}  {T1}{pun}{l}{n}{}
	  \installfont  {punlc8t}     {punl8r,punl9z,newlatin}              
{t1c} {T1}{pun}{l}{sc}{}
	  \installfont  {punm8t}      {punm8r,punm9z,newlatin}              
{t1}  {T1}{pun}{m}{n}{}
	  \installfont  {punmc8t}     {punm8r,punm9z,newlatin}              
{t1c} {T1}{pun}{m}{sc}{}
	  \installfont  {pund8t}      {pund8r,pund9z,newlatin}              
{t1}  {T1}{pun}{b}{n}{}
	  \installfont  {pundc8t}     {pund8r,pund9z,newlatin}              
{t1c} {T1}{pun}{b}{sc}{}
	  \installfont  {punx8t}      {punx8r,punx9z,newlatin}              
{t1}  {T1}{pun}{bx}{n}{}
	  \installfont  {punlo8t}   {punlo8r,punlo9z,newlatin option nosc}  
{t1}  {T1}{pun}{l}{it}{}
	  \installfont  {punmo8t}   {punmo8r,punmo9z,newlatin option nosc}  
{t1}  {T1}{pun}{m}{it}{}
	  \installfont  {pundo8t}   {pundo8r,pundo9z,newlatin option nosc}  
{t1}  {T1}{pun}{b}{it}{}
	  \installfont  {punxo8t}   {punxo8r,punxo9z,newlatin option nosc}  
{t1i} {T1}{pun}{bx}{it}{}
	  \installfont  {punm8tc}   {punm8rc,punm9zc,newlatin}              
{t1}  {T1}{pun}{mc}{n}{}
	  \installfont  {pund8tc}   {pund8rc,pund9zc,newlatin}              
{t1}  {T1}{pun}{bc}{n}{}
	  \installfont  {punmo8tc}{punmo8rc,punmo9zc,newlatin option nosc}  
{t1i} {T1}{pun}{mc}{it}{}
	  \installfont  {pundo8tc}{pundo8rc,pundo9zc,newlatin option nosc}  
{t1i} {T1}{pun}{bc}{it}{}
	  \installfont  {punm8tx}   {punm8rx,punm9zx,newlatin}              
{t1}  {T1}{pun}{mx}{n}{}
	  \installfont  {punmo8tx}{punmo8rx,punmo9zx,newlatin option nosc}  
{t1i} {T1}{pun}{mx}{it}{}
	  \installfont  {punl8c}      {punl8r,punl9z,textcomp}          {ts1} 
	  \installfont  {punm8c}      {punm8r,punm9z,textcomp}          {ts1} 
	  \installfont  {pund8c}      {pund8r,pund9z,textcomp}          {ts1} 
	  \installfont  {punlo8c}   {punlo8r,punlo9z,textcomp}         {ts1i} 
	  \installfont  {punmo8c}   {punmo8r,punmo9z,textcomp}         {ts1i} 
	  \installfont  {pundo8c}   {pundo8r,pundo9z,textcomp}         {ts1i} 
	  \installfont  {punm8cc}   {punm8rc,punm9zc,textcomp}          {ts1} 
	  \installfont  {pund8cc}   {pund8rc,pund9zc,textcomp}          {ts1} 
	  \installfont  {punmo8cc}{punmo8rc,punmo9zc,textcomp}         {ts1i} 
	  \installfont  {pundo8cc}{pundo8rc,pundo9zc,textcomp}         {ts1i} 
	  \installfont  {punm8cx}   {punm8rx,punm9zx,textcomp}          {ts1} 
	  \installfont  {punx8c}      {punx8r,punx9z,textcomp}            
	  \installfont  {punmo8cx}{punmo8rx,punmo9zx,textcomp}         {ts1i} 
	  \installfont  {punxo8c}   {punxo8r,punxo9z,textcomp}         {ts1i} 
	% Local Variables:
	% fill-column: 99
	% End:

The fontinst "auxiliary" finstmsc.tex is simply:

	\input finstmsc.sty
	\input inst.recs

It uses some recorded data from the fontinst run to create the MAP  
file fragment (or do something else). It uses an "RC" file like this,  
that serves many purposes, depending on what is not commented:

	\adddriver{dvips}  {inst.map}
	%\adddriver{pltotf} {pltotf.cmd}
	%\adddriver{macdvi} {preview.Test}
	%\adddriver{oztex}  {default.Test}

> And as I needed oldstyle figures and small capitals, I had to work  
> a little more.

I try not to use commercial fonts, so I only have one that uses real  
small caps: Cardo. And I decided not to follow completely the Font  
Installation Guide. It also has only one variant, yet ...

> Today, I am facing the following problem: A friend of mine, a  
> mathematician, has written a rather philosophical book, maybe with  
> one or two equations. The manuscript is in LaTeX, and for the  
> present time, typeset in Computer Modern (rather ugly for novels  
> and philosophy). The publisher is willing to accept any pdf file,  
> and all the titles in the series in which the manuscript has been  
> accepted are typeset in Garamond. To convert the book of my friend  
> into a Garamond pdf file, I have to do the same kind of work  
> described above (or is there a better way?). Fortunately, Garamond  
> is the standard example in font installation guides.

Walter Schmidt created a garamond package for urw++'s free Garamond  
font, ugm (contributed to Ghostscript): /CTAN:nonfree/fonts/urw/ 
garamond. Paul Pichaurau has created mathdesign packages with  
(commercial) Garamond.

> Moreover, he works on a PC, so I shall not be able to put all the  
> needed files (made on my Mac) into the right places. I hope that if  
> I put all the files in the same directory where his files are, it  
> will work.

It is possible. Even on an MS Losedows PC you can find some sane  



When in doubt, use brute force.
                             -- Ken Thompson

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/

More information about the MacOSX-TeX mailing list