There isn't generally a single answer for this. It all depends on the fonts and font tables that the font foundry provides and how they're mapped and installed in your TeX system. Let me try to explain.
[To make things less confusing, the answer that follows assumes your question is directed at LaTeX
scenarios, rather than XeTeX
, LuaTeX
etc. which provide different and somewhat simpler ways to approach this.]
Assuming that your fonts are properly installed in your texmf
directory stucture, and perhaps assuming outline (non-bitmap) fonts, you'll have several sets of fonts (let's say, "shapes" and/or "series") for each typeface. Depending on the particular typeface, i.e., depending on what the particular font foundry has provided, you will have shapes/series for regular, bold, italic, bold-italic as a minimum (although in some cases there might be less), and then possibly, old style nums, true caps, condensed, alternative weights etc (usually from 'Pro' or 'expert' collections).
Now, TeX can access the oldstyle nums provided in your fonts in several ways, depending on how the font has been created or (more accurately) how its mappings are laid out on your system. In cases where you have dedicated oldstyle font files, all TeX needs to do to switch from oldstyle figures to lining figures is to switch its tables pointing at them in its mappings. And all you need to do is specify what you want by selecting them. Here are some examples:
Font Family lining figures old style figures
----------------------------------------------------
Kepler Project jkpx jkpxosn
ADF Venturis yvt yvtj
Palatino pplx pplj
Adobe Sabon psb psbj
Adobe Minion Pro MinionPro MinionPro-OsF
To select, say, Palatino with lining figures as the default Roman font, write \renewcommand*\rmdefault{pplx}
in your document preamble, or \renewcommand*\rmdefault{pplj}
if you want Palatino with oldstyle nums. That's all that's happening underneath when you write \usepackage[osf]{mathpazo}
to load up Palatino with Pazo math fonts.
Alternatively, if you want to use Palatino with oldstyle nums at a particular place in your document, you might write \fontfamily{pplj}\selectfont
. If you do that while you're in a group (e.g., inside an inner {
and }
), you'll revert to the font that was in effect when you leave the group. As above, this is all that mathpazo
is doing for you when you write \oldstylenums{12345}
. I.e., mathpazo
includes the command (notice the group):
\renewcommand{\oldstylenums}[1]{{\fontfamily{pplj}\selectfont #1}}
Not too many font foundries give you this ease of access to old style figures (mostly because these extra sets make up their 'Pro' collections for which they charge more, or because it's extra work, or because oldstyle nums don't look so fantastic in that particular typeface).
However, as with GUST e-foundry, some font makers provide oldstyle figure glyphs outside the usual slots for these. In other words, you get the usual set of lining figures as well as oldstyle figures through symbol glyphs mappings (TS1 vs T1 encodings). If your mappings have been set up properly (e.g., by fontinst
or if someone has done this work for you), you can access lining figures in the usual way ('1', '2',...) and oldstyle figures through commands like \textzerooldstyle
, \textoneoldstyle
, etc. The trouble is, you can't easily switch in and out of lining and oldstyle figures just by selecting them as we saw in the Palatino example above. This is reason the fontaxes
approach (per Lev's and lockstep's suggestion) won't work - for Gyre Schola, it's looking for font definition qcsj
or qcs-OsF
and can't find either (qcs
is the base fontfamily name for Gyre Schola). However, without the fontaxes
package loaded, \oldstylenums
(defined in the textcomp
package) can access them. You can see how it does this by fooling around a little like this:
\documentclass{article}
\usepackage{tgschola} % or whatever
\usepackage{textcomp} % no real need to explicitly load textcomp in this case
\usepackage{fontenc} % to control your font encoding
\begin{document}
T1 font encoding:\par
\fontencoding{T1}\selectfont
01234567890\par % lining figures under T1 encoding, osf under TS1
\oldstylenums{01234567890}\par % forces TS1 encoding, so typeset osf regardless
abcdefghijABCDEFGHIJ\par % normal chars under T1 encoding, gobbledygook under TS1
\oldstylenums{abcdefghijABCDEFGHIJ} % forces TS1 encoding, so typeset symbols regardless
\vspace{\baselineskip}
TS1 font encoding:\par
\fontencoding{TS1}\selectfont
01234567890\par % lining figures under T1 encoding, osf under TS1
\oldstylenums{01234567890}\par % forces TS1 encoding, so typeset osf regardless
abcdefghijABCDEFGHIJ\par % normal chars under T1 encoding, gobbledygook under TS1
\oldstylenums{abcdefghijABCDEFGHIJ} % forces TS1 encoding, so typeset symbols regardless
\end{document}
If you do this, you'll quickly see that all that \oldstylenums
is doing is switching in and out of TS1 encoding. However, you can see by the nonsense that is printed when you try to typeset normal characters in TS1 font encoding that you mustn't select that encoding when wanting to typeset normal text! Thus, you have to somehow tell LaTeX
before entering and after leaving every block of oldstyle nums that this is what you want to do. I.e., you're back to using \oldstylenums
, although perhaps by some other name.
There is a third way, which is to set up a set of virtual fonts that assemble the oldstyle figures the font provides into the slots where the normal figures usually reside. This takes some expertise and probably shouldn't be entered lightly but is completely do-able if you have the patience and time to spare.
Best Answer
\begin{EDIT}{2018-05-17}
You might want to look at this answer going into detail about how best to use Neo Euler. One major thing to consider, is that Neo Euler hasn't been worked since 2011 and the github repo states
so I don't know if using Euler, AMS Euler or Neo Euler is still a good idea. You might want to leave the dead rest in peace and work with living fonts. Have a look at the latest version
unicode-math
documentation to make a more educated decision as to how to best move on.\end{EDIT}
The option
Scale=MatchLowercase
works underXeLaTeX
. I have found by chance, that the "correct" way to do it is to follow Example 1 of the documentation:that is, not to set the
Scale=MatchLowercase
as an argument inbut rather as an optional argument of the "secondary" fonts, which will then orient themselves to the main font, which has been set by
\setmainfont{...}
Second (yeahr, I ain't mentioned 'first', get over it), from the
fontspec
documentation, we get:Third, there seems to be a problem with
Palatino Linotype
as main font, since the following code...yields
but if I just change the font to, say
Libertinus Serif
(I didn't test other ones), ...we get nicely lowercase-matched types. It also works with
MatchUppercase
.PS: Could anyone enlighten me as to where
\setromanfont
comes from? This term is nowhere to be found in thefontspec
documentation.