I am looking for information how to implement Math OTF font in XeTeX or LuaTeX at TeX primitive level (using XeTeX or LuaTeX primitives). There exist a LaTeX package unicode-math. Unfortunatelly, this package is LaTeX oriented, documentation is at LaTeX user level and implementation in LaTeX3 language which is far from TeX primitives. So, the inspiration from this package is impossible for me.
Where can I find such information?
I try to be more specific what I am looking for. The principles of math typesetting in TeX can be summarized by:
You must set (at least) math family 2 and 3 using \font, \textfont, \scriptfont and \scripscriptfont primitives. The metric of such fonts must include more \fontdimens than basic 7 (dim 8--22 for family 2 and dim 8--13 in family 3, they are used as described in appendix G in the TeXbook).
Each elementary math object can be a "character" decladed by \matcode or a "control sequence" declared by \mathchardef. The data points to type of the object (used for horizontal spacing) and to the family plus slot of the font.
The \delimiter code must point to family plus slot. There are pointers to create a queue of consecutive characters (big to bigger brackes). These pointers are in font metric of used font and the queue can ends by special pointers for components of a bracket of arbitrary size. Similar principle is used for radicals queue.
The \mathop type of objects can point to the family plus slot where two variant sizes of big operators are. They are connected by pointers inside font metric.
So, this is (roughly speaking) the basic information about background of math typesetting at TeX primitive level. But these informations are useless for me when I am working with (say) texgyrepagella-math.otf. Where are the pointers of brackets or radical queues? Where are extended font dimens?
Of course, I know how to load this font using extended syntax of \font primitive, I can set a font feature using \font primitive and I know that there exists primitives \Umathchar and \Umathchardef. But this is very few information. This is insufficient to declare basic unicode math typesetting.
Is there any info like I mentioned above, but for unicode math?