I think that the maths subscripts are placed too low in the Latin Modern and the New Computer Modern fonts. Here's an example with the NewCM fonts, compiled with LuaLaTeX.
\documentclass[12pt, a4paper]{article}
\usepackage[newcmbb]{fontsetup}
\DeclareMathOperator{\spec}{spec}
\begin{document}
\[
\spec_{\symrm{p}}
\]
\end{document}
I think the p is too low. I however think that we get a better output with ConTeXt.
\setuppapersize[A4]
\setupbodyfont[newcomputermodern-book]
\definemathfunction[spec]
\starttext
\startformula
\spec_{\mathrm p}
\stopformula
\stoptext
I believe this happens due to the way ConTeXt handles maths, and also due to the modifications done in the newcomputermodern-math.lfg goodie file. I believe the following modifications (lines 79 and 80) in the goodie file give the correct result.
SubscriptBaselineDropMin = 50, -- 200 in font (multiplied by 0.59999/2.39868)
SubscriptShiftDown = 150, -- 247 in font (multiplied to be consistent with cm)
I tried to modify the SubscriptBaselineDropMin and SubscriptShiftDown parameters using LuaLaTeX, and expected to get the same result as in ConTeXt, but that does not seem to be the case. I believe 1 pt corresponds to 100 units in the goodie file.
\documentclass[12pt, a4paper]{article}
\usepackage[newcmbb]{fontsetup}
\DeclareMathOperator{\spec}{spec}
% code copied from here https://tex.stackexchange.com/a/82221/128462
% check pages 115 and 116 of https://mirrors.ibiblio.org/CTAN/systems/doc/luatex/luatex.pdf
\everymath=\expandafter{%
\the\everymath%
\Umathsubshiftdown\textstyle=1.5pt\Umathsubshiftdrop\textstyle=0.5pt}
\everydisplay=\expandafter{%
\the\everydisplay%
\Umathsubshiftdown\displaystyle=1.5pt\Umathsubshiftdrop\displaystyle=0.5pt}
\begin{document}
\[
\spec_{\symrm{p}}
\]
\end{document}
The subscript p is certainly shifted upwards compared to the unmodified LuaLaTeX code, but not as much as the ConTeXt result.
Why is that? Are there other parameters which are relevant here which need to be changed in order to get the ConTeXt result? I tried changing the \Umathsubshiftdown and \Umathsubshiftdrop to zero, and still did not get the desired result.
Edit:
It seems that the DeclareMathOperator is causing some things, as I see the following behaviour in pdflatex with CM, LuaLaTeX and ConTeXt. The subscripts of \mathrm{c} are lifted as compared to \spec.





