Behaviour of \latinfamily

Ulrik Vieth vieth@thphy.uni-duesseldorf.de
Tue, 26 May 1998 11:56:35 +0200


> I'm particularly interested in:

> 1) Exactly which files it looks for when it says, for example:

INFO> to make LaTeX (family,weight,shape,width) pck,m,n,: seek pckk8r
INFO> to make LaTeX (family,weight,shape,width) pck,m,sc,: seek pckkc8r
INFO> to make LaTeX (family,weight,shape,width) pck,m,sl,: seek pckko8r
INFO> to make LaTeX (family,weight,shape,width) pck,m,it,: seek pckki8r
INFO> to make LaTeX (family,weight,shape,width) pck,m,n,c: seek pckk8rn
INFO> to make LaTeX (family,weight,shape,width) pck,m,sc,c: seek pckkc8rn
INFO> to make LaTeX (family,weight,shape,width) pck,m,sl,c: seek pckko8rn
INFO> to make LaTeX (family,weight,shape,width) pck,m,it,c: seek pckki8rn
INFO> to make LaTeX (family,weight,shape,width) pck,m,n,: seek pckm8r
> (pckm8a.afm)

> In the last case, it's clear that it's not found pckm8r.

These messages are issued by tools/finst/fontinst.sty and eventually
end up in the log file of /tmp/Fam_xxx/Fam_xxx.tex (which is normally
deleted automatically if the fontinst run completed successfully).
Try runnig 

  perl make-fam.pl -debug -outdir ../cooked/<whatever> <famcode>
                   ^^^^^^
to preserve the log files and temporary files, if you really want to
see what's going on behind the scenes.

Another point to note is that after the above-mentioned message is
issued by the macro \latin_shape, stating that fontinst is apparently
looking for some 8r-encoded .mtx file, various other macros are called, 
such as \fake_width or \fake_shape, which in turn look for 8a-encoded
.afm files and issue the necessary  \transformfont and \reencodefont
commamds to produce a suitable 8r-encoded .mtx file.


> 2) Exactly which transformations fontinst does when it's found a
> particular file.  For example, when it said it was looking for
> pckm8r, it found pckm8a, and then went on to do this:

INFO> to make LaTeX (family,weight,shape,width) pck,m,n,: seek pckm8r

This message came from 
  \latin_shape{FONTSHAPE}{RAWSHAPE}{ENCODINGSHAPE}{LATEXSHAPE} 

where \raw_shape is empty and \latex_shape is 'n'.

As a first step, \latin_shape calls 
  
  \csname fake_width_\font_width\endcsname,

where \font_width is empty, i.e. \fake_width_ is called, 
which happens to do nothing.

As a second step, \latin_shape calls 
  
  \csname fake_shape_\raw_shape\endcsname 

where \raw_shape is empty, i.e. \fake_shape_ is called, 
which does the following:

* it checks if pckm8a.afm exists, then

* if checks if pckm8r.afm exists, else

* it calls 

  \transformfont{pckm8r}{\reencodefont{8r}{\fromafm{pckm8a}}}

  which produces the following output:

> (pckm8a.afm)
> Metrics written on pckm8a.mtx.
> (pckm8a.mtx)
> Raw font written on pckm8a.pl.
> (:TeX-inputs:za finst:8r.etx) (pckm8a.mtx)
> Transformed metrics written on pckm8r.mtx.
> (pckm8r.mtx)
> Raw font written on pckm8r.pl.

* it calls

  \installrawfont{FONT-NAME}{FILE-LIST}{ETX}{ENCODING}
     {FAMILY}{SERIES}{SHAPE}{SIZE}

  \installrawfont{pckm8r}{pckm8r,8r}{8r}{8r}{pck}{m}{n}{}

> (pckm8r.mtx) (:TeX-inputs:za finst:8r.mtx) (:TeX-inputs:za finst:8r.etx)
> (:TeX-inputs:za finst:8r.etx
> Warning: \ligature for unknown slot `ffi'.
> Warning: \ligature for unknown slot `ffl'.
> Warning: \ligature for unknown slot `ff'.
> ) (:TeX-inputs:za finst:8r.etx)
> Font written on pckm8r.pl.

After skipping over some code relating to expert fonts, we return
to the calling macro \latin_shape, which issues the message

INFO> found pckm8r.mtx

and eventually calls \latin_encodings, starting with

INFO> run installfont with <pckm7t><pckm8r,latin><OT1><OT1><pck><m><n>


> 3) And I'm also puzzled at the way it produces fd files.  Can anyone
> provide a definitive explanation of how it decides what to put in an
> fd file, and how to tell fontinst to add a particular fount and
> fount substiution to an fd file.

The calling sequence of fontinst goes something like \latinfamily ->
\latin_weights -> \latin_widths -> \latin_shapes -> \latin_encodings,
where each step goes throgh a list of individual calls for a number
of predefined weights, widths, shapes and encodings.  

Whenever it finds a suitable match, it produces a .pl or .vpl file and
a corresponding .fd file entry.  In the end, it adds substitutions
for missing weights or shapes.

> Hope someone can help a bit

Hope this helps more than a bit.  I'm afraid studying the code will 
be unavoidable, if you really want to know what's going on.

Cheers, Ulrik.