[Fontinst] Kerning information from AFM files

Lars Hellström lars.hellstrom at residenset.net
Mon Jul 4 18:19:18 CEST 2005


At 13.51 +0200 2005-07-03, Peter Dyballa wrote:
>Hello!
>
>I am not completely sure about it, but it would sound strange to me if
>Fontinst wouldn't use the KPX lines in AFM files ...

To me too, especially since line 674 of ficonv.dtx says:

\afm_let{KPX}{KP}

I.e., the exact same macro parses KPX lines as parses KP lines.

>What happens when the glyph names used in these lines are not
>understood because they are not those Fontinst expects? They're
>probably neglected too as the glyphs' data.

No, they're not. Lines 662--673 of that same file says

\afm_def{KP}(#1~#2~#3~#4){
   \if\first_char#1=.\else
   \if\first_char#2=.\else
      \afm_length\a_count{#3}
      \ifnum \a_count>\minimum_kern
         \out_line{\string\setkern{#1}{#2}{\the\a_count}}
      \else\ifnum \a_count<-\minimum_kern
         \out_line{\string\setkern{#1}{#2}{\the\a_count}}
      \fi\fi
   \fi\fi
}

which means every KP or KPX line generates one \setkern instruction, unless
one of the following exceptions occur:
1. Either glyph name begins with a period; this has to do with ignoring
`.notdef'.
2. The absolute value of the kern is less than or equal to the minimumkern
integer variable; this is a feature.

>What happens when a helpful
>MTX files translates:
>
>\ifisglyph{afii08941}\then	\setglyph{lira} \glyph{afii08941}{1000}
>\endsetglyph \Fi
>
>Would this translation hold into the KernData section of an AFM file,
>i.e. would Fontinst use this information?

That's not a "translation" in the sense you mean, so: No, it does not copy
any kern data. Think about what it literally says.

"\setglyph{lira}" means: Hey, fontinst! I'm going to construct a `lira'
glyph (unless one already exists, in which case you can ignore the
following).

"\glyph{afii08941}{1000}" means: First do a `afii08941' (i.e., do the same
things as you would do to get a `afii08941') at 100%.

"\endsetglyph" means: That's it, you're done!


It does not make sense for this general mechanism to mess around with
kerning data. For copying the kerns of a glyph, one preferably uses
\setleftrightkerning. There are numerous examples of this in the latinmtx
directory.

Lars Hellström




More information about the fontinst mailing list