3

I’m using Erewhon font with the package fourier-otf. I would like to define a font with \font (to get it with the Lua fonction font.id) that is the small caps subpart of the regular font. Any ideas?

To be more precise, here some code

\documentclass{article}
\usepackage{fourier-otf}

\font\myfontSC={?????}

\begin{document}

\myfontSC Test

\end{document}

I want to use the \font command to be able to get the font id in the Lua side :

mynodeG.font=font.id("myfontSC")
1
  • Thank you, I’ve updated the question. Commented Jul 12 at 8:20

2 Answers 2

2

Select the font inside a box and define \myfontSC to be the same font selector of the current font (which can be accessed as \the\font).

\documentclass{article}
\usepackage{fourier-otf}

\sbox0{\scshape \global\expandafter\let\expandafter\myfontSC\the\font}

\begin{document}

\texttt{\meaning\myfontSC}

\myfontSC Test

\end{document}

enter image description here

0
1

Can't you use the the command \newfontface?

\documentclass{article}

\usepackage{fourier-otf}
\newfontface\myfontSC{erewhon}[RawFeature={+smcp}]
\begin{document}
    
{\myfontSC Small Caps}

\scshape Test
    
\end{document}
1
  • Yes, but how can I get the font.id in the Lua side? Commented Jul 12 at 9:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .