7

I have noticed that default kerning of hyphenated words (like "Finite-Valued") looks like this:

e-V

e-V

As you can see, the hyphen is too close to the e and too far away from the V. Is there a way to fix this, so the hyphen has proper kerning?

2 Answers2

7

The \kern primitive is your friend.

enter image description here

\documentclass{article}
\begin{document}
Finite-Valued

Finite\kern0.5pt-\kern-2ptV\kern-1.5ptalued % 1 postive kern, 2 negative kerns \end{document}

Mico
  • 506,678
  • 2
    I knew that there was some way to manually move the characters around, but I'd still prefer the kerning to just work, the way it does for every other character pair... – Jan Pokorný Jan 05 '21 at 18:46
  • 1
    @JanPokorný - What you've encountered is that the -V glyph pair is so unusual as not to have been considered to be a realistic possibility, by whoever created the font's kerning table. That said, I doubt that any font truly has a truly complete kerning table, i.e., one that considers all possible character pairs. – Mico Jan 05 '21 at 18:48
  • @JanPokorný - Are you able to use LuaLaTeX to compile your document? The reason I ask is that LuaLaTeX provides ways to update (or complete, if you prefer) a font's kerning table. – Mico Jan 05 '21 at 18:53
  • 1
    Interesting, I was under the impression that there was some automated process that decided the kerning based on the shape of the characters, not just hand-made kerning pairs... – Jan Pokorný Jan 05 '21 at 19:34
  • @JanPokorný Kerning does not obey strict geometric rules; subtler considerations need to be taken into account; other key factors are serifs, bowls and stroke width in the adjacent glyphs. The more I look to the picture in Mico's answer, the more I'm convinced that the kerning is excessive. – egreg Jan 05 '21 at 22:53
  • I know that kerning is all about human perception and thus inexact by definition, but I would still expect that in addition to hand-crafted kerning pairs, there would be some algorithmic fallback that gives good-enough results. Do all typesetting systems just default to "no kerning" for unusual pairs? – Jan Pokorný Jan 06 '21 at 01:41
  • 1
    @JanPokorný As far as I’m aware, that is indeed the default. – bradrn Jan 06 '21 at 07:28
  • 3
    @JanPokorný as far as I know, TeX doesn't actually know what the glyphs look like at all. It just sees each letter as a box with a bunch of parameters like width, height and kerning values. The actual shapes of the letters are only known by the rendering engine, which is a separate process from typesetting. – N. Virgo Jan 06 '21 at 09:06
  • 1
    Each character shape is specific and unique to the design of the font itself. It can't be automated any more than the design itself. TeX gets two pieces of information about each character: the size of its bounding box, and any kerning information supplied by the font. More to the point, TeX does not "look inside" the box. – chepner Jan 06 '21 at 14:31
6

If you are using LuaTeX then you can declare more kerning pairs of used fonts. Example shows how to do it in OpTeX:

\fontfam[lm]

\directlua {fonts.handlers.otf.addfeature { name = "khv", type = "kern", data = { ["-"] = { ["V"] = -150}, } } }

Finite-Valued.

\setff{khv}\rm Finite-Valued.

\bye

wipet
  • 74,238