Please look at the following MWE:
\documentclass[20pt]{extarticle}
\usepackage{unicode-math}
\usepackage{luacode}
%% Works: change width of
\begin{luacode}
local function newwidth(tfmdata)
tfmdata.shared.rawdata.descriptions[119891].width=3000
end
fonts.constructors.features.otf.register{
name = 'width',
description = 'Overwrite width values',
initializers = {
base = newwidth,
},
}
\end{luacode}
%% Does not work: math accent horizontal position of
\begin{luacode}
local function newacc(tfmdata)
tfmdata.shared.rawdata.descriptions[119891].math.accent=900
end
fonts.constructors.features.otf.register{
name = 'acc',
description = 'Overwrite accent values',
initializers = {
base = newacc,
},
}
\end{luacode}
%% Does not work: change bounding box of
\begin{luacode}
local function newbbox(tfmdata)
tfmdata.shared.rawdata.descriptions[119891].boundingbox={ -400, 0, 600, 0 }
end
fonts.constructors.features.otf.register{
name = 'bbox',
description = 'Overwrite boundingbox values',
initializers = {
base = newbbox,
},
}
\end{luacode}
\setmathfont{Latin Modern Math}[math-style=literal, RawFeature={+width;+bbox;+acc}]
\begin{document}
$$ \hat $$% Sorry for $$, I usually use Plain TeX.
\end{document}
I changed succesfully width of (unicode 119891, mathematical italic small f), but I cannot change its sidebearings (bounding box) and its horizontal math accent position.
How to do that properly?
Edit: Somewhere I saw tfmdata.shared.rawdata.descriptions and somewhere tfmdata.characters. Could someome explain the difference please? When to use the former, when the latter?

luaotfloaddocumentation. – Weißer Kater Aug 27 '22 at 23:18luaotfload? – Weißer Kater Aug 27 '22 at 23:22luaotfloadcode. And yes, the right sidebearing is controlled by thewidth. So there is only one question left: Is it possible to change (increase, decrease) the left sidebearing? Do you know a solution? – Weißer Kater Aug 28 '22 at 08:52