# [NTG-context] Specifying font style variant with \definefontfamily

Pavneet Arora pavneet_arora at waroc.com
Thu Jun 9 22:37:43 CEST 2016

I'm still a bit at a loss on how one goes about correctly specifying the
variants in \definefontfamily using the default form given in the wiki.
Usually adding "* Light", etc. is sufficient (see commented line using
Junction font).

(As an aside, is it also possible to combine \sc\bf?  I haven't been
able to figure that out).

My application is using the (free) Andada font family, and I need to
point the smallcaps style to the correct font

In the following MWE I tried the following without success:

1.  [sc=* SC Regular]
3.  [sc=* SC-Regular]

All give the following (or similar) error to stdout:

...ext/tex/texmf-context/tex/context/base/mkiv/font-sel.lua:121: attempt to index local 'file' (a nil value)
stack traceback:
...ext/tex/texmf-context/tex/context/base/mkiv/font-sel.lua:121: in function 'selectfont_savefile'
...ext/tex/texmf-context/tex/context/base/mkiv/font-sel.lua:151: in function <...ext/tex/texmf-context/tex/context/base/mkiv/font-sel.lua:142>
...ext/tex/texmf-context/tex/context/base/mkiv/font-sel.lua:526: in function 'registerfiles'
...ext/tex/texmf-context/tex/context/base/mkiv/font-sel.lua:567: in function 'action1'
[string "local function scan1()..."]:55: in function <[string "local function scan1()..."]:42>

1     \definefontfamily[mainface][rm][Latin Modern]

I end up finally settling on the form using the explicit file:

But I really would like to understand how the first form as given in the
wiki should be used properly?  What patterns should I be looking for?

An output of 'strings' on the font .otf file yields:

>>>> MWE

\definefontfamily[mainface][rm][Latin Modern]
%\definefontfamily[mainface][ss][Junction][tf=* Light,bf=* Regular]
\definefontfamily[mainface][ss][Fira Sans]
\definefontfamily[mainface][tt][Inconsolata]
\definefontfamily[mainface][mm][Latin Modern Math]

\setupbodyfont[mainface,9pt]

\starttext
\sc Test of Small Caps.
\stoptext

<<<< MWE

--
Pavneet Arora           m: +1 (647) 406-6843
Waroc Informatik        t: +1 (416) 937-9276