Single quotes do not seem to be scaled with xelatex and Source Code Pro
The problem is that the new TU-encoding now used by fontspec is missing suitable definitions for \textquotesingle
and \textasciigrave
(which were previously present in xunicode
) and so the default definitions from textcomp
kicks in. If I add definitions everything is fine.
Edit
The missing definitions have been added to the LaTeX-code. So after the next update of LaTeX is should work correctly out-of-the-box.
Edit 2
The code in my example works fine as only typewriter fonts are used. With a roman font it is more complicated as the "TeX-ligatures" interferes. Some discussion is going on.
\documentclass[12pt]{article}
\usepackage{fontspec}
\setmonofont[Scale=0.7]{Source Code Pro}
\DeclareTextSymbol{\textquotesingle} \UnicodeEncodingName{"0027}
\DeclareTextSymbol{\textasciigrave} \UnicodeEncodingName{"0060}
\usepackage{upquote}
\usepackage{textcomp}
\begin{document}
\texttt{'hello world'}
\texttt{\textquotesingle{}hello world\textquotesingle{}}
\begin{verbatim}
x = 'hello world'
\end{verbatim}
\end{document}
From the description of upquote
on CTAN:
The package switches the typewriter font to Computer Modern Typewriter in OT1 encoding, and modifies the behaviour of verbatim, verbatim*, \verb, and \verb* to print in the “` and ' way”.
Your problem is that for any non-cm-font textcomp
(an obsolete package) is loaded which also does not match your font. So you cannot use textcomp
and because it depends on it, you cannot use upquote
either.