You can specify any font you like for any of the variants: they don't need to be from the same family. So for example, you could produce the following awful combination:
% !TEX TS-program = XeLaTeX
\documentclass{article}
\usepackage{fontspec}
\setsansfont[Scale=MatchLowercase, Mapping=tex-text,
BoldFont={DejaVu Sans Condensed Bold},
BoldItalicFont={Florencesans SC Cond Bold Italic},
ItalicFont={Gill Sans Light Italic}]{Helvetica}
\begin{document}
\sffamily This is in Helvetica.
\textbf{This is in DejaVu Sans}
\emph{\textbf{This is in Florence Sans}}
\emph{This is in Gill Sans Light Italic}
\end{document}
To access more alternatives with a single typeface you have to create first additional alternatives with the \definefontalternative
command. For my example I add new definitions for a light and a medium style, for the name of the alternative itself you’re limited to two letter for each and you should ensure no important commands are overwritten, e.g. below I overwrite the language switch for lithuanian
which can be ignored because you can still use \language[lt]
in a document.
\definefontalternative[lt] % light
\definefontalternative[li] % lightitalic
\definefontalternative[md] % medium
\definefontalternative[mi] % mediumitalic
Now you can add entries for the light and medium styles in your typescript and map synonyms to the font files, for the names of the synonyms you should stick close the the default names, e.g. I used SerifLight
for the light style if the font.
\starttypescript [serif] [antykwa-torunska-extended]
\definefontsynonym [SerifLight] [file:antykwatorunskalightregular] [features=default]
\definefontsynonym [SerifLightItalic] [file:antykwatorunskalightitalic] [features=default]
\definefontsynonym [Serif] [file:antykwatorunskaRegular] [features=default]
\definefontsynonym [SerifItalic] [file:antykwatorunskaitalic] [features=default]
\definefontsynonym [SerifMedium] [file:antykwatorunskamedregular] [features=default]
\definefontsynonym [SerifMediumItalic] [file:antykwatorunskameditalic] [features=default]
\definefontsynonym [SerifBold] [file:antykwatorunskabold] [features=default]
\definefontsynonym [SerifBoldItalic] [file:antykwatorunskabolditalic] [features=default]
\definefontsynonym [SerifCaps] [file:antykwatorunskaregular] [features=smallcaps]
\stoptypescript
Now comes the important part where I assign the files for the light and medium styles to the additional alternatives which is done with the \definebodyfont
command.
\starttypescript [serif] [antykwa-torunska-extended]
\definebodyfont [default] [rm]
[lt=SerifLight sa 1,
li=SerifLightItalic sa 1,
tf=Serif sa 1,
it=SerifItalic sa 1,
md=SerifMedium sa 1,
mi=SerifMediumItalic sa 1,
bf=SerifBold sa 1,
bi=SerifBoldItalic sa 1,
sc=SerifCaps sa 1]
\stoptypescript
After this is done you I can now create a new typeface which supports alternatives than the one provided by default (\tf
, \it
etc.).
\definetypeface[antykwa-torunska-extended][rm][serif][antykwa-torunska-extended][default]
\setupbodyfont[antykwa-torunska-extended]
\starttext
\starttabulate[|l|l|]
\NC \tex{lt} \NC \lt Light \NC\NR
\NC \tex{li} \NC \li LightItalic \NC\NR
\NC \tex{tf} \NC \tf Regular \NC\NR
\NC \tex{it} \NC \it Italic \NC\NR
\NC \tex{md} \NC \md Medium \NC\NR
\NC \tex{mi} \NC \mi MediumItalic \NC\NR
\NC \tex{bf} \NC \bf Bold \NC\NR
\NC \tex{bi} \NC \bi BoldItalic \NC\NR
\NC \tex{sc} \NC \sc SmallCaps \NC\NR
\stoptabulate
\stoptext
Best Answer
Default TypeScripts can be found in the
type-imp-*
files in the directorytex/texmf-context/tex/context/base/
(relative to the ConTeXt installation directory).If you installed TeX on a Mac with TexLive 2013, you can list them as such:
and used in
\setupbodyfont[my-typescript]
without thetype-imp-
prefix.Furthermore there are TypeScripts which ship as third party modules. These can be found in
tex/context/third/typescripts/
.