Foreign Function Interface in LuaTeX
(Hans Hagen, Luigi Scarso)
Abstract
We present a new Foreign Function Interface module for LuaTeX with the same API as ffi module. The paper shows some simple applications of a direct binding to a shared library and some tests done replacing the standard ConTeXt’s Lua text shaper with Harfbuzz library’s one. The results show that Harfbuzz performs better than Lua with some complex scripts like Arabic, while Lua is usually the best choice with a common Latin script. In that respect jit might come into the picture.
Sommario
Presentiamo un nuovo modulo Foreign Function Interface per LuaTeX con la stessa API di LuajitTeX. L’articolo illustra alcuni semplici casi di collegamento diretto con una libreria dinamica ed alcuni test fatti sostituendo il text shaper in Lua di ConTeXt con quello della libreria Harfbuzz. I risultati mostrano che Harfbuzz ha prestazioni migliori nel caso di alfabeti complessi come l’arab, mentre Lua è la scelta migliore per quelli latini. In questo contesto jit potrebbe avere un ruolo importante.