# Can't switch to lining numerals with Junicode and fontspec

I'm using the Junicode typeface with the fontspec package, and I've set OldStyle numerals as the default. The OS numerals work fine, but if I try to switch to lining numbers in the middle of the text, they won't print, and instead LaTeX defaults to oldstyle. I get the following warning message:

Package fontspec Warning: OpenType feature 'Numbers=Uppercase' (lnum) not available for font 'Junicode' with script 'CustomDefault' and language 'Default'.

However, according to Junicode's documentation, it does have both lining numbers and oldstyle. So I'm not sure why LaTeX can't find it.

Here's a MWE:

\documentclass[12pt]{article}

\usepackage{fontspec}
\setmainfont{Junicode}[Numbers=OldStyle]

\begin{document}

123456789

\liningnums{123456789}

\end{document}


Which in prints the following:

How can I switch to lining numbers with Junicode and fontespec? I'm using LuaLaTeX, by the way.

Junicode has no font feature for lining numbers (lnum), they are the default. There is only a feature for old style numbers (onum), which you have to remove in order to get lining numbers (if old style numbers is the default). If you want to use \liningnums you have to patch that too:

\documentclass[12pt]{article}

\usepackage{fontspec}
\setmainfont{Junicode}[Numbers=OldStyle]

\RenewDocumentCommand \liningnums {m}
{
}

\begin{document}

123456789

\liningnums{123456789}

\end{document}


• Wow, thanks. A bit silly that \liningnums does not consider this but it makes sense. – johnymm Feb 6 '19 at 16:18
• What's the difference between \renewcommand and \RenewDocumentCommand ? It's the first time I'm seeing it.... – johnymm Feb 6 '19 at 20:44
• @johnymm, It’s part of the LaTeX3 code base, see e.g. the xparse package. – Kess Vargavind Feb 6 '19 at 21:00

You can remove the oldstyle feature with ..Off or ..Reset

\documentclass[12pt]{article}

\usepackage{fontspec}
\setmainfont{Junicode}[Numbers=OldStyle]

\begin{document}

123456789


• Even better! No fiddling around with RawFeature – DG' Feb 6 '19 at 8:43
• @WillRobertson yes, I was just considering to add an issue about this ;-). Why does the warning speak about a CustomDefault script? – Ulrike Fischer Feb 6 '19 at 9:13