My problem when using math in a beamer presentation: The space between a $f$ and the following questionmark is way too small (the glyphs intersect). When switching the code (MWE) to an article, the problem is gone, yet now the spacing between a math "f" and the following letters is too big.
The problem is absent with LuaTeX (using libertineotf) but occurs with XeTeX (same).
MWE:
\documentclass{beamer} % try article in comparison and note the gap between "ef..." and "...gh"
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\begin{document}
$f$? $efgh$
\end{document}