[Tex/LaTex] Font features selection in Xe(La)TeX

fontsfontspecopentypexetex

I am using the XeTeX engine in order to compile a document based on a class of my own, and the package fontspec to select the face families and features. Though this is not relevant for my question, just with the aim to be more concrete, let me say that for the sans face I am using Formata (from Adobe). This family comes in different .otf files, with the root name Formata, in such a way that the *-Regular file (and *-Light as well, this being just about weight series) includes only the "non-expert" types, small caps and text figures being included in files *-RegularSC and even another, *-RegularExpert.

I have no problem about small caps thanks to the fontspec key SmallCapsFont, but I'd like to have text figures as my default selection for numerals. Of course I have Numbers=OldStyle set in my \defaultfontfeatures, but this won't do. Is there a way that I can get to the numerals in the "expert" files without having to switch through \textsc?

Moreover, the Formata family includes a condensed face in a file *-Condensed (together with all shapes and weight series). Is there a switch to have this loaded without having to resort to fontspec's \newfontfamily or \newfontface?

Well, my priority is on the numerals-related question, but just to not open another post, I thought the latter would be appropriate here, too.

Best Answer

Many tools can let you inspect the features for OTF fonts (and there's often a documentation, too).

For example, you can use otfinfo:

$ otfinfo -f /usr/local/share/fonts/EBGaramond12-Regular.otf 
c2sc    Small Capitals From Capitals
calt    Contextual Alternates
case    Case-Sensitive Forms
ccmp    Glyph Composition/Decomposition
cv01    <unknown feature>
cv02    <unknown feature>
cv03    <unknown feature>
cv06    <unknown feature>
cv11    <unknown feature>
cv21    <unknown feature>
cv80    <unknown feature>
cv81    <unknown feature>
cv90    <unknown feature>
cv91    <unknown feature>
dlig    Discretionary Ligatures
dnom    Denominators
frac    Fractions
hlig    Historical Ligatures
kern    Kerning
liga    Standard Ligatures
lnum    Lining Figures
mark    Mark Positioning
mkmk    Mark to Mark Positioning
numr    Numerators
onum    Oldstyle Figures
ordn    Ordinals
pnum    Proportional Figures
sinf    Scientific Inferiors
size    Optical Size
smcp    Small Capitals
ss01    Stylistic Set 1
ss02    Stylistic Set 2
ss05    Stylistic Set 5
ss06    Stylistic Set 6
ss20    Stylistic Set 20
subs    Subscript
sups    Superscript
tnum    Tabular Figures

This font has numeral-related features, namely dnom, frac, lnum, numr, onum, ordn, etc.

The fontspec manual will give you the keys to use them, or you can use them directly using the RawFeatures key.