A journal has asked me to change the font of my algorithm to Courier New. I'm able to change all except the keywords (if, then, else, etc.). My best solution looks like this:
\documentclass{article}
\usepackage{algorithm2e}
\begin{document}
\begin{algorithm}[H]
{{\fontfamily{pcr}
\If {{\fontfamily{pcr}\selectfont condition}}
}}
\end{algorithm}
\end{document}