having fontinst write font map file

Lars Hellström Lars.Hellstrom@math.umu.se
Fri, 26 Feb 1999 08:57:43 -0500


It certainly seems a good idea to have fontinst either write out the map
file itself, or possibly write out some file from which the map file can be
easily generated. The latter model ought to make it easier to target more
than one driver.

If we're going to implement this however, then there is another matter
which we really should resolve first, namely in which order the font
transforms are applied. Recall that the syntax of \transformfont is

    \transformfont{FONT-NAME}{TRANSFORMED FONT}

and that the syntax for a TRANSFORMED FONT is

    \fromafm{AFMFILE}                                  or
    \frompl{PLFILE}                                    or
    \frommtx{MTXFILE}                                  or
    \scalefont{INTEGER EXPRESSION}{TRANSFORMED FONT}   or
    \xscalefont{INTEGER EXPRESSION}{TRANSFORMED FONT}  or
    \yscalefont{INTEGER EXPRESSION}{TRANSFORMED FONT}  or
    \slantfont{INTEGER EXPRESSION}{TRANSFORMED FONT}   or
    \reencodefont{ETX}{TRANSFORMED FONT}

At least to me, this suggests that

    \transformfont{c}{\yscalefont{1500}{\slantfont{167}{\frommtx{a}}}}

should generate the same (up to possible rounding errors) file c.mtx as

    \transformfont{b}{\slantfont{167}{\frommtx{a}}}
    \transformfont{c}{\yscalefont{1500}{\frommtx{b}}}

This is not the case. Instead it generates the same c.mtx as

    \transformfont{b}{\yscalefont{1500}{\frommtx{a}}}
    \transformfont{c}{\slantfont{167}{\frommtx{b}}}

since \mtxtomtx always does x-scaling first, y-scaling second, and slanting
last. Another illogical thing in this is that if a font transform is
applied more than once in a \transformfont statement, then only the
innermost application will actually be carried out. This is clearly not
what the average user would expect.

One way of resolving this with the metric transforms \scalefont,
\xscalefont,     \yscalefont, and \slantfont would be to view the (already
existing) fontinst integers x-scale, y-scale, and slant-scale as components
of the transform matrix

  (   x-scale   slant-scale )
  (      0        y-scale   )

which is computed as the product of several elementary transform matrices
(one for each metric transform applied), where

  \scalefont{n}{  }         corresponds to     (   n     0   )
                                               (   0     n   )

  \xscalefont{n}{  }        corresponds to     (   n     0   )
                                               (   0   1000  )

  \yscalefont{n}{  }        corresponds to     ( 1000    0   )
                                               (   0     n   )

  \slantfont{n}{  }         corresponds to     ( 1000    n   )
                                               (   0   1000  )

(since we interpret the integer 1000 as the real number 1 here, the
elementary operation in these matrix multiplications should be \scale
rather than \mul, just in case you wondered).

Lars Hellström


PS: Does anyone know how the "fontinst v1.9 prerelease project" is coming
along?  I have sent the equivalent of fontinst.dtx+fontinst.ins to
Sebastian for attachment of new copyright message etc., but that was more
than two weeks ago.