Behaviour of \latinfamily

Rebecca and Rowland rebecca@astrid.u-net.com
Fri, 29 May 1998 04:35:32 +0100


At 9:31 am +0100 28/5/98, Sebastian Rahtz wrote:
>Rebecca and Rowland writes:
> > >   \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.
>and then \latin_encodings is executed

Oh yes...  It's easy to miss things like that when the preceding code makes
virtually no sense.

> > 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
>no, i don't think they have.

They've done it enough to use fontinst intelligently, which is all that you
need.  The available documentation is inadequate, and I've been told time
and again that the only way to understand it is to read the source code.
Several people *do* understand fontinst, these people tell me to read the
source code, so avoiding mindless paranoia, the sensible assumption is that
these people worked it out from reading the source.  Maybe not working out
*everything*, but much more than I can.  I get stuck at the start of
\latinfamily, and can go no further.

> i, for one, just skim the TeX code when i
>want to understand something, but i have never set down and attempted
>to put the logic down on paper.

But...  You use a brand of common sense which matches that used by the
original author of fontinst, so you understand the broad operation of the
package.  I've not got a clue.  I've installed lots of founts using
fontinst, and in every case, it's been a case of re-name the founts
according to the perfectly comprehensible naming scheme, and throw a
mystical incantation at fontinst and see what happens.  Sometimes it works
as expected, sometimes it doesn't.  I have no idea what logic is used
inside fontinst, and no idea how it decides what output to produce from
what input.

>it took me several minutes to render
>the code into the slightly more readable form i emailed the other day,
>but it was just sugar

On the other hand, it took me 1/2 hour to turn what you emailed into
something I could understand (quite a lot of that was working out a form of
notation that I could understand and would fit on a single sheet of A4 - it
took a few tries).  Do you see what I mean about several orders of
magnitude harder for me?  I'm not thick, but I don't think like the average
computer programmer.

> > 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
>it was just search and replace editing, more or less!
>
> > *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,
>oh come, use common sense. what do you *think* the variable
>\font_family is????????? who cares where its set,

I care, because understanding this one macro isn't *very* relevant to
understanding how fontinst works in broad terms.  If I know what sets
\font_family, what it sets it to, and why, *then* I might be able to
achieve a common sense understanding of what's going on.  Until then, I'm
in the dark as far as common sense is concerned.

I've tried working through the source code, and I couldn't work out what
\font_family is set to.  Of course it matters exactly what the code says:
`common sense' helps not at all, because who knows what the author was
thinking when he wrote that?  `Common sense' dictates that \raw_encoding is
8a or 0.  Why is \raw_encoding set to 8r?  That's contrary to common sense
in *my* book, so clearly common sense can't help me understand fontinst.

> thats irrelevant to
>understanding this macro.

Not to me it's not; or rather, understanding this macro *in isolation*
provides me with no information about the operation of fontinst.  (Yes, I
really do mean `no' as in zero: nothing at all).

I've found that common sense always fails me in this sort of work.  I
haven't a clue what \font_family is without finding out where it comes
from.  I tried working through the \latinfamily to find out, but failed
here:

\def\latinfamily#1#2{
   \edef\temp_command{#1}
   \expandafter\parse_family\temp_command
      \empty_command\empty_command\end_parse_family

\parse_family makes no sense to me, so I can't get anywhere in
understanding \latinfamily.

> > NEED TO KNOW:
> >
> > 1)
> > What form the int exprs can take, and what they mean exactly (AJ's fontinst
>um, an integer is a whole number, isnt it? is it any more complicated
>than that?

Yes.  I know what an integer is,  but the LGC documentation says `int
expr', *not* `int'.  If the documentation had said `integer', I would know
what sort of thing was needed.  It doesn't: it says integer expression with
no definition.

Of course, given that there is no information on how the integer is
interpreted by each command, I'd still have no idea how to use the commands
intelligently.

Early on in the AJ's fontinst documentation, a list of integer expressions
is provided:

<number>
\int{int}
\width{glyph}
(etc).

And the example of fontinst use contains:

\slantfont{167}{...}

where `167' must be, according to the documentation, an integer expression.
That's fine: 167 is in the list of integer expressions given earlier, but
its meaning as used in \slantfont is undefined by the documentation.
Therefore, I am confused.  What *does* \slantfont{167}{} mean?  I can guess
that it means slant a font a certain amount, but how much? 167 degrees?
(180-167) degrees? 167/1000 of a revolution?  167/1000 radians?  Something
else?  Which direction is +ve and which direction is -ve?  What is the
origin used for the transformation?  The documentation's got nothing to say
on this, and my `common sense' can come up with at least two dozen
different ways of interpreting the number 167 in this context with at least
three unknown variables.  Given that my version of `common sense' normally
disagrees with the version of `common sense' used by TeX macro writers, and
given that I've come up with too many different unknown variables to be
able to make any sense out of careful random changes, I can get nowhere.

> > Can you say \frompl{xxx} (needs xxx.pl)?  (not mentioned in any
>yes, sure.

Right - thanks.

> > 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*?
>ligfull installation means that the ligature information in the AFM
>file is copied to the output metric

Right.  How is it possible to do any other sort of installation, and why
would you want to?

> > >\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?
>no, i dont see. i dont know how to say it any clearer!

Well, you give \latinfamily some arguments.  It does something with these
arguments which cause it to process the contents of some files and produce
output in other files.  This I know from my own observations.  What I
*don't* know is what processes cause the output to be produced from the
input.  A brief glance at the fontinst source code is enough to tell me
that:

> > >\latinfamily calls\latin_weights which executes \latin_widths which
> > >executes \latin_shapes which executes \latin_encodings

In other words, telling me this provides me with exactly no new
information: it's something that even I can work out from the fontinst
source code and is understood in detail by very few people indeed.

The thing is, I haven't the slightest idea what any of these macros do in
terms of input and output (input afms etc to output pls and vpls).  I've
failed to work out what they do in terms of the arguments to \latinfamily,
what they do in terms of the input files, and what they do in terms of the
output files.  I'm 100% adrift.

> > \latinfamily calls\xyykjshj which executes \lweoijns which
> > executes \kajhfgkjn which executes \awndgzjn?
>fine. whats the problem? then i just have to see what \lweoijns does.

The problem is that if you don't know what any of the macros do, why they
do it, what the \latinfamily command does in detail, and you can't find out
any of these things, you're sunk.  I can follow the sequence of macros, but
I always run into one which I can't interpret: the first one in this list
is \latinfamily.

> > 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
>Ulrik pointed out a bug in my stuff which had bad effects....

Fine - but I still don't understand anything much to do with fontinst.

> > % (the real author of fontinst). Please contact Sebastian with
> > % any questions or complaints
>it doesnt say i'll be able to answer them :-}

S'all right, I don't expect miracles ;-)

Rowland.