[lltx] luaotfload-merged.lua:7542

Heiko Oberdiek heiko.oberdiek at googlemail.com
Sat Jun 15 16:31:48 CEST 2013


Hi Philipp,

On 15.06.2013 10:49, Philipp Gesang wrote:
> 
> ···<date: 2013-06-15, Saturday>···<from: Heiko Oberdiek>···

>> \directlua{%
>>   if font and font.fonts and font.current then %
>>     local f = font.fonts[font.current()]%
>>   end%
>> }
>> \setbox0\hbox{To}%

>> throws the error on the console:
>>
>> %%% console %%%
>> error: ...r/texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua:7542:
>> attempt to perform arithmetic on local 'factor' (a nil value)
> 
> => http://www.ntg.nl/pipermail/ntg-context/2013/072166.html
> 
> In short: access the fontdata via fonts.hashes.identifiers or
> font.getfont(). Indexing font.fonts is unsafe with fonts that are
> defined by the font loader. Example:
> 
>   local fontdata = fonts.hashes.identifiers
>   local my_getfont = function (id)
>     local f = fontdata[id]
>     if f then
>       return f
>     end
>     --- fallback to raw
>     return font.fonts[id]
>   end
> 
> Though this appears to work I can’t say whether it is safe under
> all circumstances.

Many thanks, at least my work case (\hologo{eTeX}) works now with
LuaLaTeX (but I haven't tested "all circumstances").


Best regards
  Heiko Oberdiek



More information about the lualatex-dev mailing list