Here
\documentclass{article}
\usepackage{fontspec}
\usepackage{unicode-math} % luatex
\setmainfont{EB Garamond}
\setmathfont{Garamond Math}
\begin{document}
Test \(\mathrm{Df'_2}\).
\end{document}
the prime is too close to the f. I suppose this is an error in Garamond Math. What's the right way to fix it? (I'd prefer one that doesn't require typing something different every time.)
(Df'_2 is the name of a definition. Df should therefore be typeset as
ordinary text, not with the extra spacing produced by \symup.)

\(\mathrm{Df\,'_2}\). – Aug 06 '19 at 16:46unicode-math,\mathZZcommands are for “words”, not for single letters, where\symZZshould be used. – egreg Aug 06 '19 at 19:49