italic correction

Lars Hellström Lars.Hellstrom@math.umu.se
Wed, 22 Dec 1999 09:56:19 -0500


Alexei Kostin wrote:
>I use Fontinst 1.801 and got the following problem:
>
>If `ItalicAngle' is equal zero in an afm file, than the \if_italic flag
>is set `false' by the \calculate_it_slant macro. In result, even if some
>glyphs should have an italic correction, it is zeroed up in the
>\afm_char macro. IMHO, this logic is quite wrong: many upright fonts
>contain glyphs which require italic corrections. For example, one may
>take /f from Times-Roman or Times-Bold.
>
>Any ideas?

In fontinst v1.8 the only thing you can do is to manually intervene with a
metric file that changes the italic correction using something like

  \resetglyph{f}
     \glyph{f}{1000}
     \resetitalic{<new value>}
  \endresetglyph

for every glyph that gets a bad italic correction. Furthermore you'll have
to figure out the <new value>s yourself.

In fontinst v1.9 the italic correction is computed by two integer
expressions \uprightitalcorr and \slanteditalcorr, which you can change
yourself using \resetcommand (you've got to read the source comments to see
what the arguments are, though; it's in the "converting an AFM file to an
MTX file" subsection"). \slanteditalcorr is used for fonts with positive
italic slant and \uprightitalcorr is used for all others. Setting
\uprightitalcorr equal to \slanteditalcorr would probably achieve what you
want.

Actually this reminds me of something I thought about a while back, namely
that the italic correction fontinst by default computes is probably a bit
too small since it doesn't include the standard right leading for the font.
The problem is that there is no way of getting this information. I believe
though that the difference between the advance width and bounding box right
edge position for the letter s (in the n shape) should be a good
approximation. The command for doing this would be

  \resetcommand\slanteditalcorr#1#2#3#4#5{\max{\add{\sub{#3}{#1}}{50}}{0}}

if one assumes that the leading is 50. In case anyone gives this a try,
then please tell the list about your results.

Lars Hellström