代码清单中的上下文 MkIV 直单引号

代码清单中的上下文 MkIV 直单引号

我正在尝试 Context(MkIV、luatex),在下面的代码片段中,双引号是直的,而单引号则变成了“前向”引号。

仅当我选择新的等宽字体(例如 Consolas)时才会发生这种情况。(我得到的引号不是 Consolas 直引号。)

我怎样才能关闭它?

\setuppapersize[A4][A4]

% Without the switch to consolas, the quotes are fine.
\definefontfamily[f][serif][Garamond]
\definefontfamily[f][sans][Gill Sans MT][rscale=0.9]
\definefontfamily[f][mono][Consolas][rscale=0.8] 
% tried: tlig-no,trep=no but didn't help
\setupbodyfont[f]
\setupbodyfont[12pt]

\starttext

\starttyping
-- in lua you can use both single and double quotes
a = 'single quoted'
b = "double quoted"
\stoptyping

\stoptext

答案1

您必须设置features=none。(我使用 Latin Modern Mono,因为我没有 Consolas)

\definefontfamily[f][mono][Latin Modern Mono][rscale=0.8,features=none]
\setupbodyfont[f]
\starttext

\starttyping
-- in lua you can use both single and double quotes
a = 'single quoted'
b = "double quoted"
\stoptyping

\stoptext

在此处输入图片描述

相关内容