4

It seems to have a 12pt limitation to \setupbodyfont according to contextgarden.

We can bypass this limitation in content and it will work well:

\starttext
  \startbuffer[line]
  The quick brown fox jumps over the lazy dog
  \stopbuffer

  \switchtobodyfont[chorus, 12pt] chorus 12pt: \getbuffer[line] \\
  \switchtobodyfont[chorus, 13pt] chorus 13pt: \getbuffer[line] \\
  \switchtobodyfont[chorus, 14pt] chorus 14pt: \getbuffer[line] \\
  \switchtobodyfont[chorus, 15pt] chorus 15pt: \getbuffer[line] \\
  \switchtobodyfont[chorus, 20pt] chorus 20pt: \getbuffer[line] \\
  \switchtobodyfont[chorus, 32pt] chorus 32pt: \getbuffer[line]
\stoptext

enter image description here

Unfortunately, It does not seems to work this well neither with textcommand nor textstyle in \setuphead:

\setuphead[chapter][textcommand={\switchtobodyfont[chorus,12pt]}]

\starttext
  \chapter{The quick brown fox jumps over the lazy dog}
\stoptext

12pt

\setuphead[chapter][textcommand={\switchtobodyfont[chorus,13pt]}]

\starttext
  \chapter{The quick brown fox jumps over the lazy dog}
\stoptext

13pt

How can I make it works?

3
  • Try using textcommand={\groupedcommand{\switchtobodyfont[chorus,13pt]}{}}
    – user193767
    Jun 16, 2020 at 13:42
  • What do you mean by 12pt limitation? There is no such thing mentioned in the wiki link
    – Aditya
    Jun 16, 2020 at 13:54
  • 1
    Well, at least the wiki enumerates only 5pt to 12pt: "[...] 5pt ... 12pt". But, yes, "limitation" is probably a too much word.
    – user213111
    Jun 16, 2020 at 13:58

1 Answer 1

5

Use textstyle. AFAIK, it is better to define also the proper bodyfontenvironment

\definebodyfontenvironment [20pt]
\setuphead [chapter] [textstyle={\switchtobodyfont[chorus,20pt]}]

\starttext
\startchapter[title={The quick brown fox jumps over the lazy dog}]
\stopchapter
\stoptext
1
  • 1
    When you use one of the default sizes (e.g. 13pt) you can preload the typescripts with \usebodyfont[chorus] \definebodyfontenvironment is recommended when one uses a non standard fontsize in for the style of a command or environment. Jun 16, 2020 at 14:36

You must log in to answer this question.