Scale math font with newtxsf

My suggestion is to try with no scaling; in this case we get the height of a sans serif A is 8.87999pt and the height of a math A is 8.148pt.

Therefore the scaling factor is 8.148/8.87999=0.91757 (rounded to the fifth decimal digit). Now with

\documentclass[fontsize=12pt, paper=a4]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage[scale=.91757]{tgheros}
\usepackage[scaled=1]{newtxsf}

\renewcommand*{\familydefault}{\sfdefault}
\renewcommand*{\rmdefault}{\sfdefault}

% this to get the operators in the sans serif font
\DeclareSymbolFont{operators}{\encodingdefault}{\sfdefault}{m}{n}

\begin{document}

    \textbf{Displaying height of fonts}

    \sbox0{\sffamily A}heros: \the\ht0

    \sbox0{$A$}newtxsf: \the\ht0

    \textbf{Math mode}  $ Q = P\tan(\varphi)$

\end{document}

enter image description here


Note that, in unicode-math, the solution is Scale=MatchLowercase, or sometimes, Scale=MatchUppercase. You can even set it as \defaultfontfeatures.

It also sets the main font as both the operator font and the \mathrm font, but you can override this, with \setoperatorfont, \setmathrm, etc.