Use locally Computer Modern Dunhill

computer-modernfontsroman

In the documentation of Computer Modern Dunhill, it’s only presented the way of using Dunhill in the whole document.

When my goal it’s just to use it in a peace of document. But when I do {\setromanfont{cmdh} Lispsum} I get :

! Package fontspec Error: The font "cmdh" cannot be found.

For immediate help type H <return>.
 ...

l.133     {\setromanfont{cmdh}lipsum
                               }

So, how to use Computer Modern Dunhill in just a part of document and not in the whole document?

Best Answer

You provided no example and did not mention it but the error indicates you are using a Unicode engine so you should not be using the cmdh name which is only set up for 8 bit. However Latin Modern is set up, so

enter image description here

\documentclass{article}

\usepackage{fontspec}

\begin{document}

Aabcd {\fontfamily{lmdh}\selectfont Abcd}

\end{document}