[Tex/LaTex] How to change fontsize in lstlisting without losing bold syntax highlighting

boldfontsizelistings

If I load the listing package to set nice code and change the font size (like suggested there: Shrinking monospace style for listings package), I lose the syntax highlighting, because the font does not get bold anymore.

\usepackage{listings}
\lstset{
  language={[Sharp]C},
  basicstyle=\ttfamily\tiny
}

\begin{lstlisting}
  int a = 5;
  //int should be bold, it's not.
  //commenting out basicstyle makes it bold, but to big
\end{lstlisting}

Is there some way to change the font size of listings without losing code highlighting?

Best Answer

I just found the answer myself by trial-and-error:

basicstyle=\tiny

So you don't have to overwrite the font family, contrary to what the answer in the linked question suggested.