I'm trying to set up tcolorbox blocks using minted engine. I want to use a font of my choice in those, not the default monospaced one (or tt or helvetica, per minted manual). Let's say I want 'Code New Roman'.
In the following MWE the commented out style-setting line works, but requires of me knowing that (internal?) format.
The line without \exfont works but sets the document's default font for tcolorbox blocks.
If the line with \exfont is set last and so is actually used in listings, listings do not compile.
At the same time, this tex fragment works in the main body of document.
Is it possible to make the line with \exfont work?
Or do that auto-adjustment to a specific font in some other way?
\documentclass{article}
\usepackage{fontspec}
\usepackage[all]{tcolorbox}
\newfontfamily\exfont{Code New Roman}
\newtcblisting{exprog}{
listing only,
listing engine=minted,.
% minted options={ fontfamily={CodeNewRoman(0)} }, % minted expects that sort of string
minted options={ fontfamily={\exfont\csname f@family\endcsname} }, % doesn't work
minted options={ fontfamily={\csname f@family\endcsname} }, % works but sets the default font for tcolorbox blocks
}
\begin{document}
{\exfont\csname f@family\endcsname} % works
\begin{exprog}
ts( n : integer ) : function: double;
\end{exprog}
\end{document}
