Matthew McCabe via ntg-context schrieb am 13.12.2022 um 09:15:
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) 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.
One can download the exact set of fonts I am using from https://fonts.google.com/specimen/Roboto
Here is my code:
[...]
\starttypescript [sans] [roboto] \definebodyfont [default] [rm]
Replace [rm] with [ss]: \definebodyfont [default] [ss]
[lf=SansLight sa 1, li=SansLightItalic sa 1, tf=Sans sa 1, it=SansItalic sa 1, md=SansMedium sa 1, mi=SansMediumItalic sa 1, bf=SansBold sa 1, bi=SansBoldItalic sa 1, sc=SansCaps sa 1] \stoptypescript
\definetypeface[roboto][rm][sans][roboto][default]
Replace [rm] with [ss]: \definetypeface [roboto] [ss] [sans] [roboto] [default] Wolfgang