On Tue, Jun 18, 2019 at 9:23 PM Patrick Gundlach <patrick@gundla.ch> wrote:
Hi Luigi,

this sounds really great!

Is there some documentation available how to access harfbuzz from Lua (jit) / FFI?

Patrick

 
Well, look at 
luatexdir/luaharfbuzz 
I have also used 
https://github.com/khaledhosny/harf
to check 
%% test2-latex.tex
\documentclass{article}
\usepackage{fontspec}
\newfontfamily\deva[Script=Devanagari]{NotoSansDevanagari-Regular.ttf}
\newfontfamily\beng[Script=Bengali]{NotoSansBengali-Regular.ttf}
\newfontfamily\guru[Script=Gurmukhi]{NotoSansGurmukhi-Regular.ttf}
\newfontfamily\gujr[Script=Gujarati]{NotoSansGujarati-Regular.ttf}
\newfontfamily\orya[Script=Oriya]{NotoSansOriya-Regular.ttf}
\newfontfamily\taml[Script=Tamil]{NotoSansTamil-Regular.ttf}
\newfontfamily\telu[Script=Telugu]{NotoSansTelugu-Regular.ttf}
\newfontfamily\knda[Script=Kannada]{NotoSansKannada-Regular.ttf}
\newfontfamily\mlym[Script=Malayalam]{NotoSansMalayalam-Regular.ttf}
\newfontfamily\sinh[Script=Sinhala]{NotoSansSinhala-Regular.ttf}

\begin{document}
{\deva क्रर्कि} % krarki
{\beng ক্রর্কি} % krarki
{\guru ਕ੍ਰਰ੍ਕਿ} % krarki
{\gujr ક્રર્કિ} % krarki
{\orya କ୍ରର୍କି} % krarki
{\taml கோ} % ko
{\telu క్రర్కి} % krarki
{\knda ಕ್ರರ್ಕಿ} % krarki
{\mlym ക്രര്കി} % krarki
{\sinh කෙ} % ke
\end{document}

from 
https://tex.stackexchange.com/questions/454031/examples-for-broken-rendering-of-scripts-in-lualatex

I have renamed luatex 1.11.0 luatex-hb, build the lualatex format 
 luatex-hb --ini '\input lualatex\dump
and run 
 luatex-hb -fmt=lualatex.fmt  test2-latex.tex
(assuming texlive 2019,  all files & format in the same folder and of course that you are able to compile from svn)

Seems to work. Well, it did it last time, not time to check it now,  busy in other stuffs....

A few words on this task.
I have done it very  hurriedly (from commits luatex/branches/luatex-hb  one can see  30 May 2019  15 Jun 2019 ) 
Even if  7 years ago I have done a lua binding to hb by swig and already  I known the  work done by 
https://github.com/tatzetwerk/luatex-harfbuzz 
 harftex, put simply,  was more easy to manage in 2 days.
The idea was  to check if was possible to keep the binary small and use the  hb module on demand. 
I dont know if it will possible to meet the constrains, 
but with ffi  there is always an alternative (well there is if luaffi works on every platforms, which is currently one of my big todo.. )

Harftex is a different project from luatex: 
even if currently they  share several files, 
harftex is free to modify the core of luatex to adapt it to harftex, possibly reaching the size of xetex (~24M).
So, different projects, at the moment they share some code & some (not all) patches:
luatex with hb is not a replacement of harftex (at least because at this moment I dont know if hb will stay  in luatex).


--
luigi