[luatex] Kerning: when does it not work?

Paul Isambert zappathustra at free.fr
Wed May 4 12:45:47 CEST 2011


Le 04/05/2011 12:16, Heilmann, Till A. a écrit :
> On 04/05/2011 11:11 AM, Paul Isambert wrote:
>
>> [...]
>> So, Till, you're most unfortunate. On the other hand, could the fine
>> typography you're trying to achieve (as exemplified by your attention to
>> kerns) tolerate such things as urls in the main text? Wouldn't they be
>> better placed in a footnote of their own, with linebreak done by hand?
>> Oh, yes, I'm drowning the fish, as we say in French :)
> My oh my, what have I gotten myself into?! ;-)
>
> In my real-life project, URLs (like the [numeral]/[numeral] combination) are mostly part of automatically generated bibliographic entries and so occur either
>
> a) in citations inside footnotes (with Dominik's authortitle-dw style and typeset in TeX Gyre Heros) or
>
> b) in the bibliography (typeset in TeX Gyre Bonum--don't ask about the peculiar mix of serif and sans-serif, these are my publisher's guidelines).
>
> So there is not much I can do about line breaks manually in these cases, I guess.

Except redefine \url to suit your needs, I guess. That is definitely 
doable. That won't solve the biblatex issue, though.

> Let me see, if I got this right: Kern values (not just the ones added in OTF feature files, for example, but all existing kerns for a given font)

Actually, if I'm not mistaken, when loading a font and then applying a 
feature file, the origin of kerns in unknown (i.e. from the font or the 
feature file), so those are just font kerns.

>   can be and will be suppressed by TeX and/or several of its packages in a number of different situations for a number of different reasons (penalties, glues, math mode ...)

Actually, they aren't suppressed, they're not inserted: kerning requires 
two glyphs in a row; if the condition doesn't hold, there there is no 
kerning, which makes sense, except perhaps in the case of a penalty, 
which case Taco is willing to consider, though.

As for math mode, kerns are inserted there; what doesn't work is my 
hack, simply because the way things are done in the url package has 
annnoying consequences.

>   Therefore, sorting this out would require a lot of work from a lot of people in a lot of different places. Maybe collecting and documenting all the stumbling blocks obstructing correct kerning would be a first step towards an eventual long-term solution?

Well, there isn't much to say. To sum up, the problem is: the url 
package typesets urls in math mode and inserts 0-width glues; my hack 
was meant to deal with the latter, but is useless in math mode. 
Actually, even if it had worked, it would be just a hack; a rewriting of 
the url package would still be better.

The url package is based on a dirty trick, i.e. the tweaking of TeX so 
that apparently impossible things are achieved by more or less arcane 
code using techniques that seem totally irrelevant to the problem at 
hand in the first place. Before LuaTeX, dirty tricks were necessary evil 
and TeX wizards an unavoidable caste; now many a dirty trick is solved 
by a few lines in Lua, and TeX is a real democracy. Well, almost.

Anyway, the solution is: rewrite the package. The only thing to be 
considered by the LuaTeX team here is kerning across penalties, which is 
actually not relevant here.

> Admittedly, my problems with kerning are but one detail of typesetting and not being able to correct poor kerning in a few--but recurring--instances does not mean the end of the world. (There will always be cases you have to adjust manually anyway, like between letters/punctuation marks and footnote reference marks.) I am nevertheless somewhat surprised that I seem to be one of first/few people asking about this issue.

Well, that's the chance addition of a feature file and some packages, 
plus a good eye. Not so surprising, after all, all the more as LuaTeX 
isn't used by that many people yet.

>   As I said: It is a detail. But then again, typography is all about details.

Yes. Which is why sometimes the human hand is necessary and one cannot 
always rely on automation. As in your case right now. What, me, drowning 
the fish again?

Best,
Paul


More information about the luatex mailing list