[luatex] luatex/luaotf bug: kerns are missing in discretionary nodes

Philipp Gesang Philipp.Gesang at alumni.uni-heidelberg.de
Thu Dec 12 17:37:42 CET 2013

Hi Petr,

···<date: 2013-12-12, Thursday>···<from: Petr Olsak>···

> it seems there is a serious bug in kerning algorithm. When OpenType font 
> is loaded then all kernings are missing in discretionary nodes. You can 
> try the following example:
> ----------------------------------
> \ifx\directlua\undefined \else \input luafonts \fi % otfload code
> % you can use \input luaotfload.sty instead \input luafonts.
> \font\f=[lmroman10-regular] \f
> \hyphenation{vl-ta-va}
> \setbox0=\hbox{VLTAVA}
> \tracingonline=1 \showboxbreadth=25 \nonstopmode \showbox0
> \end
> -------------------------------
> You can try to run the command ``luatex test.tex'' (kernings are lost)
> or ``xetex text.tex'' (kernings are OK).
> It is irrelevant what OpenType font is used.
> If the \font\f line is commented out, the original 7bit font is used and 
> kernings are OK. The nodes refer: ``\discretionary replacing \kern''.
> If the \hyphenation line is commented out but OpenType font is used then 
> kernings are OK. It means that only discretionary nodes remove kerning 
> information from OpenType fonts.

the kerns do show up in base mode:

  \font\f=file:lmroman10-regular:mode=base \f

Same holds for ConTeXt:

  \enabletrackers [otf.kern]

  \definefontfeature [basemode] [default] [mode=base]
  \definefontfeature [nodemode] [default] [mode=node]
  \definefont [basefont] [file:lmroman10-regular.otf*basemode]
  \definefont [nodefont] [file:lmroman10-regular.otf*nodemode]


  \def \test {
    %\tracingonline=1 \showboxbreadth=25 \nonstopmode \showbox0
    \tracingonline=1 \showboxbreadth=25 \nonstopmode \showbox0

    \framed [frame=on] {A AVA VLTAVA.}

    {\basefont \test}
    {\nodefont \test}

The issue has been discussed before, and it looks like working in
base mode is the way to go [1,2,3].


[1] http://www.ntg.nl/pipermail/ntg-context/2011/057074.html
[2] http://tex.stackexchange.com/a/44658/14066
[3] http://tug.org/pipermail/luatex/2011-April/002730.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20131212/002f7f26/attachment.bin>

More information about the luatex mailing list