Behaviour of \latinfamily

Rebecca and Rowland
Thu, 28 May 1998 00:08:43 +0100

>Rebecca and Rowland writes:
> > Ah!  Information.  How can you tell that fontinst is looking for an
> >mtx file?
>   \if_file_exists{
>      \font_family\font_weight\raw_shape
>         \raw_variant\raw_encoding\font_width.mtx
>   }\then
>     \immediate\write16{INFO>~found~\font_family\font_weight
>           \raw_shape\raw_variant\raw_encoding\font_width.mtx}
>      \latin_encodings
>   \fi

Right - I see.  No wonder I couldn't work it out on my own.  The only
useful information I can get out of that is that a file ending with .mtx is
being checked for existance.

> > Does a list exist of which transformations and re-encodings fontinst will
> > do on its own?  I'm trying to document the process, you see, and I can't
> > work out any of these points from the source code or log files.
>well, you can, you know.

No, *I* can't (well, not without more effort than any sane person would put
in.  What am I saying?  I'm certainly not sane (this is official, by the
way - Wednesday is my day to see the psychologist) and I'm not daft enough
to try).

>you just need to apply some judious editing to make it readable.

The problem is that I'd have to follow this process for the entire fontinst
source code, and be sure I'd made no mistakes.  To begin with, it would
take a *very* long time (several weeks at a guess): I'd have to convert the
entire code into an equivalent to the form you've given below, and then
write on paper the precise flow of the program through each macro for every
function I was interested in.  I'd certainly make several mistakes which I
have no means of detecting.

The job is *possible*, but very, very, very, very difficult for me.  On the
other hand, some people can do this sort of thing with several orders of
magnitude less effort than me.  Better than that, some people have already
done this and *know* how fontinst works.  Unfortunately, none of them seem
able or willing to produce documentation for fontinst that normal human
beings can understand.  That's why I'm trying to produce end-user
documentation myself: as far as I can tell, no one person is currently in a
position to do that, but a combination of fontinst experts (you lot) and
someone who can write comprehensible documentation (me, on a good day)
might do the trick.

> for
>instance, here is fake_shape in a rational form, with ptmr hard-wired
>in. i leave fake_width as an example for the reader....

I appreciate this.  I've compared your translation (which I've had to
translate myself using a bit of paper to understand it) with the original
source code and I can see no way of deriving one from the other.  Maybe it
*is* possible, but God knows how.  There's so many unknown variables
involved that it's just noise to me.  (For example: what is \font_family,
what sets it, where, why, and how does this relate to the calling of
\fake_shape_?  I've tried working out such things, and been completely
baffled by the code.  This is why I say I can't work anything out from the
source code.)

>IF file exists{ptmr8a.afm} THEN
> IF file exists{ptmr8r.mtx} THEN
>    \transformfont{ptmr8r}{\reencodefont{8r}{\fromafm{ptmr8a}}
> FI
> IF file exists{8r.mtx} THEN
>   \installrawfont{ptmr8r}{ptmr8r,8r}{8r}{8r}{\latex family}{\latex
>weight\latex width}{\latex shape}{}
> FI
> IF file exists{ptmr8r.afm} THEN
>   IF file exists{ptmr8r.mtx} THEN
>   ELSE
>    IF file exists{8r.mtx} THEN
>      \installrawfont{ptmr8r}{ptmr8r,8r}{8r}{8r}{\latex family}{\latex
>weight\latex width}{\latex shape}{}
>    FI
>   FI

I have trouble understanding what's supposed to be going on here.  You say
this is `fake_shape'.  What is the intended purpose of this code?  As far
as I can tell, the process you've described (which appears to be different
to what the code actually does as far as I can see) is as follows:


If ptmr8a.afm exists and ptmr8r.mtx does not exist, then execute:


otherwise, if ptmr8a.afm exists and 8r.mtx exists, then execute:

\installrawfont{ptmr8r}{ptmr8r,8r}{8r}{8r}{\latex family}{\latex
weight\latex width}{\latex shape}{}


If ptmr8a.afm and ptmr8r.mtx don't exist and 8r.mtx does exist, then execute:

\installrawfont{ptmr8r}{ptmr8r,8r}{8r}{8r}{\latex family}{\latex
weight\latex width}{\latex shape}{}


Three big questions: what exactly does \transformfont do (I've read the LGC
and the original fontinst docs)?  From my own notes, I've got this data and


creates an mtx fount file from old_font

old_font must be in this form:

old_font = \fromafm{xxx} (needs xxx.afm)
         = \frommtx{xxx} (needs xxx.mtx)
         = \scalefont{int expr}{old_font}
         = \xscalefont{int expr}{old_font}
         = \yscalefont{int expr}{old_font}
         = \slantfont{int expr}{old_font}
         = \reencodefont{xxx}{old_font} (needs xxx.etx which is an encoding


What form the int exprs can take, and what they mean exactly (AJ's fontinst
docs gives a list of integer expressions which does not include \slantfont,
and \slantfont is the one example of an integer expression used in
\transformfont.  Clearly something is wrong somewhere.)

Can you say \frompl{xxx} (needs  (not mentioned in any
documentation)  If not, how can you turn a pl file into an mtx file so you
can transform it?

What exactly does \installrawfont do?

The \fake_shape_ definition mentions ligfull installation (if possible) and
expert encoding amongst other things.  How do these relate to your
explanation above, and what does a ligfull installation *mean*?

> > You said above that fontinst was looking for an mtx file, and here you say
> > it's looking for an afm file.  Can you explain what's going on?  I gather
> > fontinst can work with pl, afm, or mtx files.  Which sort is it looking for
> > here, and if it looks for more than one, what's the search order?
>it must have .mtx for the \installfont. so if that exists, it uses
>it. else it calls \transformfont to build one  from the .afm file
> > you're talking about.  fontinst just sits there until you start executing
> > commands.  Which commands cause it to exhibit this behaviour?
>as Uklrik says
>\latinfamily calls\latin_weights which executes \latin_widths which
>executes \latin_shapes which executes \latin_encodings

Yes, but what does that mean?  You've told me the order of execution but I
don't know what any of those macros do, nor do I know anything about how
they are called.  You see what I mean about the explanations being noise?
How much sense could you make from:

\latinfamily calls\xyykjshj which executes \lweoijns which
executes \kajhfgkjn which executes \awndgzjn?

You know all about the macros Ulrik referred to; I know nothing about them.
Yes, I have tried to make some sense out of the source code.

> > But I've never seen fontinst place any entries in a 8r.fd file, even though
> > it's created 8r.fd files for me quite happily.  I've also not worked out
>does it any more?

It did last time I used it; I've been wondering how to get it to write
*useful* 8r fd files rather than have to make them by hand.  The version
information in my version of fontinst is:

% Unofficial fontinst 1.6
% -----------------------
% This file is part of an unofficial fontinst 1.6. It was created
% by Sebastian Rahtz ( and not by Alan Jeffrey
% (the real author of fontinst). Please contact Sebastian with
% any questions or complaints
% 1997/09/16

> > seems that I'm supposed to be able to work out all sorts of things that
> > aren't stated explicitly.  Well, I've tried, and got no-where.
> >
>they *are* explicit. the TeX code is umambiguous. its just not

True...   I should be more careful with what I mean.