使用LuajitTeX, Version 1.10.0 (TeX Live 2019)
和ConTeXt ver: 2019.02.26 20:04 MKIV beta fmt: 2019.3.1
我可以运行以下 MWE:
\setupbodyfont[postscript,sans,12pt]
\starttext
Test
\stoptext
% engine=luajittex
在顶部添加会破坏所有内容:
$ context font.tex
mtx-context | redirect texlua -> luajittex: luajittex --luaonly "/home/stenner/.local/bin/mtxrun" --script context font.tex --redirected
mtx-context | run 1: luajittex --fmt="$TEXDIR/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luajittex/cont-en" --jobname="font" --lua="$TEXDIR/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luajittex/cont-en.lui" --c:currentrun=1 --c:engine="luajittex" --c:fulljobname="./font.tex" --c:input="./font.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:redirected --c:texmfbinpath="$TEXDIR/bin/x86_64-linux" "cont-yes.mkiv"
This is LuajitTeX, Version 1.10.0 (TeX Live 2019)
system commands enabled.
open source > level 1, order 1, name '$TEXDIR/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv'
system >
system > ConTeXt ver: 2019.02.26 20:04 MKIV beta fmt: 2019.3.1 int: english/english
system >
system > 'cont-new.mkiv' loaded
open source > level 2, order 2, name '$TEXDIR/texmf-dist/tex/context/base/mkiv/cont-new.mkiv'
system > beware: some patches loaded from cont-new.mkiv
close source > level 2, order 2, name '$TEXDIR/texmf-dist/tex/context/base/mkiv/cont-new.mkiv'
system > files > jobname 'font', input './font', result 'font'
fonts > latin modern fonts are not preloaded
languages > language 'en' is active
open source > level 2, order 3, name '/tmp/font.tex'
open source > level 3, order 4, name '$TEXDIR/texmf-dist/tex/context/fonts/mkiv/type-imp-postscript.mkiv'
open source > level 4, order 5, name '$TEXDIR/texmf-dist/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source > level 4, order 5, name '$TEXDIR/texmf-dist/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
close source > level 3, order 5, name '$TEXDIR/texmf-dist/tex/context/fonts/mkiv/type-imp-postscript.mkiv'
fonts > defining > font with asked name 'texgyreheros-regular' is not found using lookup 'file'
fonts > defining > unknown font 'texgyreheros-regular', loading aborted
[snip]
fonts > !! No bodyfont has been defined and no defaults have been
fonts > !! loaded (maybe due to a missing \starttext).
理论上,ConTeXt 能够找到该字体:
$ mtxrun --script fonts --list texgyreheros
identifier familyname fontname filename subfont instances
texgyreherosregular texgyreheros texgyreherosregular texgyreheros-regular.otf
答案1
一般来说,当 ConTeXt 找不到您确定存在的文件,或者抱怨您确定已定义的控制序列未定义,或者因格式不匹配而阻塞时,请尝试重建 ConTeXt 格式和缓存:
# Remake the formats
context --make
contextjit --make
# Regenerate the file database
mtxrun --generate
mtxrunjit --generate
TeX Gyre Heros
如果您通过字体名称而不是文件名(例如而不是)加载字体,texgyreheros-regular.otf
您还应该重新加载字体数据库:
mtxrun --script fonts --reload
mtxrunjit --script fonts --reload