I've used Alex Hirzel's code to enable code snippets in LaTex articles:

The problem is that I can't set the font to a fixed-width one. Whenever this line is commented out:
%\fontspec{Courier New}
I get the following error:
./code3.tex:33: Undefined control sequence.
\codefont -> \fontspec
{Courier New} \fontsize {9pt}{11pt}\selectfont
l.33 \begin{code}
Any idea how can I set the font type? I'm using TexShop on Mac, if it matters.
fontspecpackage (and naturally compile then withxelatexorlualatex. – Ulrike Fischer Aug 26 '12 at 10:56