[texhax] Kerning?

Heiko Oberdiek heiko.oberdiek at googlemail.com
Sat Mar 3 21:20:54 CET 2012


On Sat, Mar 03, 2012 at 06:45:01PM +0100, Christian Pleul wrote:

> On 02.03.2012, at 18:24, Heiko Oberdiek wrote:
> 
> > On Fri, Mar 02, 2012 at 03:50:38PM +0100, Christian Pleul wrote:
> > 
> >>> Unhappily the Latin Modern fonts don't correct the kerning.
> >>> Then manual fixing of the kerning remains
> >>> (e.g., by applying the difference of "Te" vs. "\hbox{T}\hbox{e}"
> >>> to the left side of the "T").
> >> 
> >> Did not get the last sentences. How could it be manually fixed?
> > 
> > ...-\kern-0.1ptTe...
> > 
> > The value "-0.1pt" depends on the font, font size, ...
> > Or use the difference of width(\hbox{Te})-width(\hbox{T}\hbox{e})
> > as approximation; the width can be measured by \settowidth, for instance.
> 
> What do you think about the following values?
> 
> \documentclass{minimal}
> \usepackage[T1]{fontenc}
> \usepackage[utf8]{inputenc}
> \usepackage{lmodern}
> %\usepackage{tgpagella}
> \begin{document}
> 	\noindent\emph{Experten-Teams}\\
> 	\emph{Experten\kern.5pt-\kern-2ptTeams}
> \end{document}

A macro \PrintKern that prints the value of the implicite kerning
between two characters:

\newcommand*{\PrintKern}[2]{%
  \begingroup
    \sbox0{#1#2}%
    \sbox2{#1\kern0pt\relax#2}%
    \dimen0=\wd0 %
    \advance\dimen0 by -\wd2 %
    \typeout{* SetKern{#1}{#2}: \the\dimen0}%
  \endgroup
}

% Usage example:
\PrintKern{T}{e}

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list