[NTG-context] Non-standard font alternatives

Hans Hagen j.hagen at freedom.nl
Tue Dec 13 09:53:19 CET 2022


On 12/13/2022 9:15 AM, Matthew McCabe via ntg-context wrote:
> Hi list,
> 
> I'm looking to import a font with medium and light weights (in this case 
> Roboto) and define font alternatives so one can quickly switch to light 
> text just as one would switch to bold text. There is a stackexchange 
> answer from Wolfgang 
> (https://tex.stackexchange.com/questions/303648/context-font-weights 
> <https://tex.stackexchange.com/questions/303648/context-font-weights>) 
> which details a solution to this problem for ConTeXt MkIV but despite my 
> best efforts I haven't been able to get things to work for me. There is 
> the Roboto typescript example on ConTeXt garden but it isn't exactly 
> what I'm looking for as for the document I'm making I would prefer to be 
> able to treat the font weights as alternatives rather than separate 
> families since I will be switching often.
take a look at type-imp-plex.mkiv (just remove the \s! in your case)

basically you define two typefaces: normal and light and then just 
switch between these, as in:

at the top of your document you say

\usebodyfont[plex]       % preloads
\usebodyfont[plex-light] % preloads

\setupbodyfont[plex]     % enables main font

and after that

{\switchtobodyfont[plex-light] .... }

will do a consistent switch

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------



More information about the ntg-context mailing list