LuaLaTeX による KP 等幅フォント

LuaLaTeX による KP 等幅フォント

fontspec を使用して KP 等幅フォントを tt フォントとして使用するように設定するにはどうすればよいですか?

私はこれを試しました:

\documentclass{article}
\usepackage{fontspec}
\setmonofont{KP-monospaced}
\begin{document}
\texttt{120 test}
\end{document}

しかし、それは機能しない

答え1

これが正しい方法かどうかはわかりませんが、最小限のテストで次の方法が機能するようです。買い手責任負担...

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\makeatletter
\DeclareRobustCommand\ttfamily{%
  \not@math@alphabet\ttfamily\mathtt
  \fontencoding{T1}\fontfamily\ttdefault\selectfont}
\makeatother
\renewcommand{\ttdefault}{jkptt}
\begin{document}
  \texttt{120 test}
\end{document}

関連情報