# [luatex] default font loader for define_font callback

David Carlisle d.p.carlisle at gmail.com
Mon Nov 30 12:06:36 CET 2015

I've been experimenting with a modified font loader (after some hints
from Hans in an earlier thread on how to show the same name as
pdftex in box logging).

The details of that code don't matter here as the structure of the
callback function mimics that of the vf example in section 4.2.2 of the
manual:

if something .. some code else call font.read_tfm.

However I am getting different results from using font.read_tfm than
not having a callback at all.

with the following test case and plain luatex as built in texlive

\tracingonline1

\ifx\directlua\undefined\else
\directlua{
% manual sec 4.2.2, simplified
callback.register('define_font',
function(name,size) local f=font.read_tfm(name,size) return f end)
% even simpler version (acts same as above)
}
\fi

\font\x=cmr12

\setbox0\hbox{\x va}
\showbox0

abc \box0

\bye

Then with pdftex I get

.\kern-0.65277

but with luatex 0.80 and 0.85 the kern is halved and I get

.\kern-0.32639

If I don't register a callback, I get the same value as pdftex.

Is this a bug or am I doing something wrong, what is the recommended form
to have a define_font callback that in some cases needs to "do the
default thing"

David