ConTeXt:如何绕过 setuphead 中的 12pt setupbodyfont 限制

ConTeXt:如何绕过 setuphead 中的 12pt setupbodyfont 限制

根据12pt\setupbodyfont语境花园

我们可以绕过这个内容上的限制,这样效果会很好:

\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

在此处输入图片描述

不幸的是,它似乎不能很好地工作,无论textcommandtextstyle\setuphead

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

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

12 点

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

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

13 点

我怎样才能让它工作?

答案1

使用textstyle。据我所知,最好也定义适当的bodyfontenvironment

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

\starttext
\startchapter[title={The quick brown fox jumps over the lazy dog}]
\stopchapter
\stoptext

相关内容