[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
else
foreach PL ( *8r.pl *9z.pl )
pltotf $PL
end
foreach VPL ( *.vpl )
vptovf $VPL
end
endif
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
else
echo $bye >> ${Kode}.lst
endif
end
pdflatex nfssfont < ${Kode}.lst
mv nfssfont.pdf nfssfont_${Font}-${Kode}.pdf
open -a "$Viewer" nfssfont_${Font}-${Kode}.pdf
end
set Name = fontsmpl_${Font}
pdflatex fontsmpl <<Koniec
$Font
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
+pund8ac+pundo8ac+punm8ac+punmo8ac+punx8a+punxo8a+punm8ax+punmo8ax
LucidaBright bh slh slhd8a+slhdi8a+slhr8a
+slhri8a
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
%
\batchmode
\input fontinst.sty
\resetstr{PSfontsuffix}{.pfb}
\recordtransforms{inst.recs}
%\fontinstversion
%%%%%%%%%%%%%%%%%%%%%
%%% Lucida Bright %%%
%%%%%%%%%%%%%%%%%%%%%
\setint{slant}{194} % 11,4°
\setint{uslant}{-125} % -7,1°
%\setint{slant}{170} % 87,5% of 11,4°
\setint{smallcapsscale}{750}
% 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:
\transformfont{slhru8r}{\slantfont{\int{uslant}}{\fromafm{slhri8r}}}
\transformfont{slhdu8r}{\slantfont{\int{uslant}}{\fromafm{slhdi8r}}}
%%%
\installfonts
%%%
\installfamily{OT1}{slh}{}
\installfont {slhr7t} {slhr8r,newlatin} {ot1} {OT1}
{slh}{m}{n}{}
\installfont {slhrc7t} {slhr8r,newlatin} {ot1c}{OT1}
{slh}{m}{sc}{}
\installfont {slhd7t} {slhd8r,newlatin} {ot1} {OT1}
{slh}{b}{n}{}
\installfont {slhdc7t} {slhd8r,newlatin} {ot1c}{OT1}
{slh}{b}{sc}{}
\installfont {slhri7t}{slhri8r,newlatin option nosc}{ot1i}{OT1}
{slh}{m}{it}{}
\installfont {slhro7t}{slhro8r,newlatin option nosc}{ot1i}{OT1}
{slh}{m}{sl}{}
\installfont {slhru7t}{slhru8r,newlatin option nosc}{ot1} {OT1}
{slh}{m}{ui}{}
\installfont {slhdi7t}{slhdi8r,newlatin option nosc}{ot1i}{OT1}
{slh}{b}{it}{}
\installfont {slhdo7t}{slhdo8r,newlatin option nosc}{ot1i}{OT1}
{slh}{b}{sl}{}
\installfont {slhdu7t}{slhdu8r,newlatin option nosc}{ot1} {OT1}
{slh}{b}{ui}{}
%
\installfamily {T1}{slh}{}
\installfont {slhr8t} {slhr8r,newlatin} {t1} {T1}
{slh}{m}{n}{}
\installfont {slhrc8t} {slhr8r,newlatin} {t1c} {T1}
{slh}{m}{sc}{}
\installfont {slhd8t} {slhd8r,newlatin} {t1} {T1}
{slh}{b}{n}{}
\installfont {slhdc8t} {slhd8r,newlatin} {t1c} {T1}
{slh}{b}{sc}{}
\installfont {slhri8t}{slhri8r,newlatin option nosc} {t1} {T1}
{slh}{m}{it}{}
\installfont {slhro8t}{slhro8r,newlatin option nosc} {t1} {T1}
{slh}{m}{sl}{}
\installfont {slhru8t}{slhru8r,newlatin option nosc} {t1} {T1}
{slh}{m}{ui}{}
\installfont {slhdi8t}{slhdi8r,newlatin option nosc} {t1} {T1}
{slh}{b}{it}{}
\installfont {slhdo8t}{slhdo8r,newlatin option nosc} {t1} {T1}
{slh}{b}{sl}{}
\installfont {slhdu8t}{slhdu8r,newlatin option nosc} {t1} {T1}
{slh}{b}{ui}{}
%
\installfamily{TS1}{slh}{}
\installfont {slhr8c} {slhr8r,textcomp} {ts1}{TS1}
{slh}{m}{n}{}
\installfontas{slhr8c} {TS1}
{slh}{m}{sc}{}
\installfont {slhd8c} {slhd8r,textcomp} {ts1}{TS1}
{slh}{b}{n}{}
\installfontas{slhd8c} {TS1}
{slh}{b}{sc}{}
\installfont {slhri8c}{slhri8r,textcomp} {ts1i}{TS1}
{slh}{m}{it}{}
\installfont {slhro8c}{slhro8r,textcomp} {ts1i}{TS1}
{slh}{m}{sl}{}
\installfont {slhru8c}{slhru8r,textcomp} {ts1i}{TS1}
{slh}{m}{ui}{}
\installfont {slhdi8c}{slhdi8r,textcomp} {ts1i}{TS1}
{slh}{b}{it}{}
\installfont {slhdo8c}{slhdo8r,textcomp} {ts1i}{TS1}
{slh}{b}{sl}{}
\installfont {slhdu8c}{slhdu8r,textcomp} {ts1i}{TS1}
{slh}{b}{ui}{}
%%%
\endinstallfonts
\endrecordtransforms
\bye
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
%
\batchmode
\input fontinst.sty
\recordtransforms{inst.recs}
%\fontinstversion
%%%%%%%%%%%%%%%%%%%%%pund8r+pundo8r+punm8r+punmo8r+punl8r+punlo8r
+pund8rc+pundo8rc+punm8rc+punmo8rc+pund8rx+pundo8rx+punm8rx+punmo8rx
%%% Adobe Univers %%%
%%%%%%%%%%%%%%%%%%%%%
\setint{smallcapsscale}{750}
%%%
\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{punmo8rc}{\reencodefont{8r}{\fromafm{punmo8ac}}}
\transformfont{pund8rc} {\reencodefont{8r}{\fromafm{pund8ac}}}
\transformfont{pundo8rc}{\reencodefont{8r}{\fromafm{pundo8ac}}}
\transformfont{punm8rx} {\reencodefont{8r}{\fromafm{punm8ax}}}
\transformfont{punmo8rx}{\reencodefont{8r}{\fromafm{punmo8ax}}}
%%%
\installfonts
%%%
\installfamily{OT1}{pun}{}
\installfont {punl7t} {punl8r,punl9z,newlatin}
{ot1} {OT1}{pun}{l}{n}{}
\installfont {punlc7t} {punl8r,punl9z,newlatin}
{ot1c}{OT1}{pun}{l}{sc}{}
\installfont {punm7t} {punm8r,punm9z,newlatin}
{ot1} {OT1}{pun}{m}{n}{}
\installfont {punmc7t} {punm8r,punm9z,newlatin}
{ot1c}{OT1}{pun}{m}{sc}{}
\installfont {pund7t} {pund8r,pund9z,newlatin}
{ot1} {OT1}{pun}{b}{n}{}
\installfont {pundc7t} {pund8r,pund9z,newlatin}
{ot1c}{OT1}{pun}{b}{sc}{}
\installfont {punx7t} {punx8r,punx9z,newlatin}
{ot1} {OT1}{pun}{bx}{n}{}
\installfont {punlo7t} {punlo8r,punlo9z,newlatin option nosc}
{ot1i}{OT1}{pun}{l}{it}{}
\installfont {punmo7t} {punmo8r,punmo9z,newlatin option nosc}
{ot1i}{OT1}{pun}{m}{it}{}
\installfont {pundo7t} {pundo8r,pundo9z,newlatin option nosc}
{ot1i}{OT1}{pun}{b}{it}{}
\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}
{ot1i}{OT1}{pun}{bx}{it}{}
\installfont {punmo7tc}{punmo8rc,punmo9zc,newlatin option nosc}
{ot1i}{OT1}{pun}{mc}{it}{}
\installfont {pundo7tc}{pundo8rc,pundo9zc,newlatin option nosc}
{ot1i}{OT1}{pun}{bc}{it}{}
\installfont {punm7tx} {punm8rx,punm9zx,newlatin}
{ot1} {OT1}{pun}{mx}{n}{}
\installfont {punmo7tx}{punmo8rx,punmo9zx,newlatin option nosc}
{ot1i}{OT1}{pun}{mx}{it}{}
%
\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}{}
%
\installfamily{TS1}{pun}{}
\installfont {punl8c} {punl8r,punl9z,textcomp} {ts1}
{TS1}{pun}{l}{n}{}
\installfontas{punl8c}
{TS1}{pun}{l}{sc}{}
\installfont {punm8c} {punm8r,punm9z,textcomp} {ts1}
{TS1}{pun}{m}{n}{}
\installfontas{punm8c}
{TS1}{pun}{m}{sc}{}
\installfont {pund8c} {pund8r,pund9z,textcomp} {ts1}
{TS1}{pun}{b}{n}{}
\installfontas{pund8c}
{TS1}{pun}{b}{sc}{}
\installfont {punlo8c} {punlo8r,punlo9z,textcomp} {ts1i}
{TS1}{pun}{l}{it}{}
\installfont {punmo8c} {punmo8r,punmo9z,textcomp} {ts1i}
{TS1}{pun}{m}{it}{}
\installfont {pundo8c} {pundo8r,pundo9z,textcomp} {ts1i}
{TS1}{pun}{b}{it}{}
\installfont {punm8cc} {punm8rc,punm9zc,textcomp} {ts1}
{TS1}{pun}{mc}{n}{}
\installfontas{punm8cc}
{TS1}{pun}{mc}{sc}{}
\installfont {pund8cc} {pund8rc,pund9zc,textcomp} {ts1}
{TS1}{pun}{bc}{n}{}
\installfontas{pund8cc}
{TS1}{pun}{bc}{sc}{}
\installfont {punmo8cc}{punmo8rc,punmo9zc,textcomp} {ts1i}
{TS1}{pun}{mc}{it}{}
\installfont {pundo8cc}{pundo8rc,pundo9zc,textcomp} {ts1i}
{TS1}{pun}{bc}{it}{}
\installfont {punm8cx} {punm8rx,punm9zx,textcomp} {ts1}
{TS1}{pun}{mx}{n}{}
\installfontas{punm8cx}
{TS1}{pun}{mx}{sc}{}
\installfont {punx8c} {punx8r,punx9z,textcomp}
{ts1}{TS1}{pun}{bx}{n}{}
\installfontas{punx8c}
{TS1}{pun}{bx}{sc}{}
\installfont {punmo8cx}{punmo8rx,punmo9zx,textcomp} {ts1i}
{TS1}{pun}{mx}{it}{}
\installfont {punxo8c} {punxo8r,punxo9z,textcomp} {ts1i}
{TS1}{pun}{bx}{it}{}
%%%
\endinstallfonts
\endrecordtransforms
\bye
% Local Variables:
% fill-column: 99
% End:
The fontinst "auxiliary" finstmsc.tex is simply:
\batchmode
\input finstmsc.sty
\input inst.recs
\donedrivers
\bye
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:
\resetstr{PSfontsuffix}{.pfb}
\recordtransforms{inst.recs}
\adddriver{dvips} {inst.map}
%\adddriver{pltotf} {pltotf.cmd}
%\adddriver{dvipdfm}{dvipdfm.Test}
%\adddriver{macdvi} {preview.Test}
%\adddriver{oztex} {default.Test}
%\etxtoenc{OT1}{7t}
%\etxtoenc{T1}{8t}
%\etxtoenc{TS1}{8c}
%\etxtoenc{OML}{7m}
%\etxtoenc{OMS}{7y}
%\etxtoenc{OMX}{7v}
%\etxtocmap{8p}{8p}
%\etxtoenc{8p}{8p}
%\etxtoenc{8px}{8px}
\setstr{encodingname}{TeXTextExtrasEncoding}
\setstr{codingscheme}{EXTENDED TEX TEXT EXTRA FONT ENCODING - LATIN}
%\declarepsencoding{ot1}{TeXTextEncoding}{\download{ot1.enc}}
%\declarepsencoding{ts1}{TeXTextCompanionEncoding}{\download{ts1.enc}}
%\declarepsencoding{8p}{TeXTextExtrasEncoding}{\download{8p.enc}}
>
> 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
software.
--
Greetings
Pete
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