3

I am trying to use the Simplefonts feature in ConTeXt, and I am having trouble getting it to work with Latin Roman. The following works with TexGyre fonts, but with Latin Modern I'm not getting smallcaps:

\definefontfeature[default][default][onum=yes]

\definefontfamily [mainface] [rm] [Latin Modern Roman]
\definefontfamily [mainface] [ss] [Latin Modern Sans]
\definefontfamily [mainface] [tt] [Latin Modern Mono]

\setupbodyfont[mainface]

\starttext

\rm\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\ss\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\tt\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps


\stoptext
  • 1
    ConTeXt ships a typescript for Latin Modern which also offers optical sizes and many more features. No need for simplefonts here, just use \setupbodyfont[modern] (or don’t load any font, modern is the default). – Henri Menke Nov 22 '16 at 22:40
  • 2
    Latin Modern uses a separate font for smallcaps which has a different internal name, to set the file for \sc you can use sc=file:lmromancaps10regular for the optional fourth argument of \definefontfamily. The better solution is to use \definetypeface (\definetypeface[mainface][rm][serif][modern][default]) to load the predefined typescript from ConTeXt which sets the font for small capitals. – Wolfgang Schuster Nov 22 '16 at 23:51
3

The simplest solution is to use the modern typescript directly. This will set all fonts to Latin Modern.

\setupbodyfont[modern]

\starttext

\rm\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\ss\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\tt\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\stoptext

Alternatively, you can use \definefontfamily (the successor of simplefonts in MKIV). However, this is not fun, because you have to specify all kinds of things yourself, e.g. the bold and bold-italic of Latin Modern Mono.

\definefontfamily [mainface] [rm] [Latin Modern Roman]
                  [sc=file:lmromancaps10regular]
\definefontfamily [mainface] [ss] [Latin Modern Sans] 
\definefontfamily [mainface] [tt] [Latin Modern Mono]
                  [bf=file:lmmonolt10bold,
                   bi=file:lmmonolt10boldoblique,
                   sc=file:lmmonocaps10regular]

\setupbodyfont[mainface]

\starttext

\rm\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\ss\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\tt\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\stoptext

If you want to mix different fonts that are available as typescripts, you can simply define your own typescript (which is the recommended approach in this case).

\starttypescript [mainface]
  \definetypeface [\typescriptone] [rm] [serif] [modern] [default]
  \definetypeface [\typescriptone] [ss] [sans]  [modern] [default]
  \definetypeface [\typescriptone] [tt] [mono]  [modern] [default] [features=none]
  \definetypeface [\typescriptone] [mm] [math]  [modern] [default]
\stoptypescript

\setupbodyfont[mainface]

\starttext

\rm\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\ss\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\tt\tf Roman \it Italic \bf Bold \bi BoldItalic \sc SmallCaps

\stoptext

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.