lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AFMs for Blue Sky Type 1 Computer Modern fonts


From: Valeriy E. Ushakov
Subject: Re: AFMs for Blue Sky Type 1 Computer Modern fonts
Date: Fri, 23 Jun 2000 03:12:28 +0400
User-agent: Mutt/1.3.3i

On Thu, Jun 22, 2000 at 21:26:25 +0300, Mikko Huhtala wrote:

> Turns out I cannot make the AFM files supplied with the fonts
> behave. Lout complains about certain kerning pairs being present in
> two copies in the AFM files (eg. the ( k a ) pair in cmr12.afm and
> cmdunh10.afm and probably many others), which in Lout 3.22's opinion
> is a fatal error.

Let's see.  cmr12.afm gives:

    KPX k a -54.396
    KPX k a -27.197

which is obviously an error.  Here's the roman.mf:

 ligtable "k": if serifs: "v": "a" kern -u#, fi\\"w": "e" kern k#,
  "a" kern k#, "o" kern k#, "c" kern k#;

Since reading this horrible macrology is a real pain in the behind,
here are relevant parts of output from tfmtopl cmr12.tfm (that's a
spaghetti as well, but at least it's more readable).

In LIGTABLE we have (uwe: in pl files notation 'C x' means literal
character 'x'):

   (LABEL C k)
   (LABEL C v)
   (KRN C a R -0.054398)
   (LABEL C w)
   (KRN C e R -0.027199)
   (KRN C a R -0.027199)
   (KRN C o R -0.027199)
   (KRN C c R -0.027199)
   (STOP)

My understanding of the Appendix F of MFbook is that ligtable program
stops on first match, so for (k,a) the correct kerning is -0.054398.

But note later on:

(CHARACTER C k
   (CHARWD R 0.516777)
   (CHARHT R 0.694444)
   (COMMENT  ; uwe: comment only, just summarizes LIGTABLE for this char
      (KRN C a R -0.054398)     !!!
      (KRN C e R -0.027199)
      (KRN C a R -0.027199)     !!!
      (KRN C o R -0.027199)
      (KRN C c R -0.027199)
      )
   )

So it seems that Knuth didn't care to remove redundant entries here in
this informative(!) comment(!) and than whatever coversion program was
used - it blindly repeated this error but with a disastrous results or
producing duplicate KPX entries.

It's quite easy to imagine that many programs that parse AFM files
will pick up the LAST entry (it will simply overwrite whatever was
there before) - unlike TeX that uses the FIRST entry.


> If I remove the extra kerning pairs, lout will terminate
> formatting the test document with
> 
> 1416,16: fatal error: EndFontMetrics missing from font file
> /usr/local/lout/lib/font/cmdunh10
> 
> However, the EndFontMetrics command is there on the last line in each of
> the AFM files. Have I missed something or is this a bug in the Blue Sky
> AFMs or in Lout itself? 

AFM format uses counted lists:

    StartKernPairs 183

When you remove the kerning pair, you should decrement the counter
accordingly:

    StartKernPairs 182


I agree that an extra check and an informative error message would be
better than confusing "EndFontMetrics missing ..."


To sum it up - go through AFM's and delete all duplicate kerning pairs
retaining only the first ones, then adjust StartKernPairs counter
accordingly.

For bonus points - notify AFM files maintainer, if any ;-)

Hope this helps.

PS: Hey, that was entertaining, thanks.

SY, Uwe
-- 
address@hidden                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen


reply via email to

[Prev in Thread] Current Thread [Next in Thread]