我已经安装了 texlive 2022 预测试并对其进行了尝试。
我找到了一种名为 Recursive 的字体,请参见此处:https://fonts.google.com/specimen/Recursive#about以及这里的网站:https://www.recursive.design/. 根据此处的手册https://www.recursive.design/assets/arrowtype-recursive-sansmono-specimen.pdf有多个轴。
我发现这个解释如何使用字体特征轴,请参阅https://tex.stackexchange.com/a/591485/4736。
但我无法让斜体轴工作。
上面提到的字体带有一个可变字体文件,名为 Recursive-VariableFont_CASL,CRSV,MONO,slnt,wght.ttf,我将其重命名为 Recursive-VariableFont.ttf。
我找不到有关 的任何文档+axis=
。这方面的文档在哪里?我使用的是 fontspec v2.8a。
到目前为止我已经尝试过:
\documentclass[a4paper,12pt]{article}
\usepackage{fontspec}
\defaultfontfeatures{%
RawFeature={+axis={CRSV}}%, slnt, CASL, wght}},
% RawFeature={+axis={wght=100}},
% RawFeature={+axis={mono=0}},
% RawFeature={+axis={slnt=0}},
% RawFeature={+axis={CASL=0}},
}
\setmainfont[
ItalicFont=Recursive-VariableFont.ttf,
BoldFont=Recursive-VariableFont.ttf,
BoldItalicFont=Recursive-VariableFont.ttf,
BoldFeatures={RawFeature={+axis={wght=500}}},
BoldItalicFeatures={RawFeature={+axis={wght=900}}},
ItalicFeatures = {RawFeature={+axis={CRSV=1}}}
]{Recursive-VariableFont.ttf}
\setmonofont{Recursive-VariableFont.ttf}[%
RawFeature={+axis={mono=1}}]
\begin{document}
\par the quick brown fox jumps over the lazy dog.
\par\textit{the quick brown fox jumps over the lazy dog.}
\par\textbf{the quick brown fox jumps over the lazy dog.}
\par\textbf{\textit{the quick brown fox jumps over the lazy dog.}}
\texttt{Es irrt der Mensch..}
\end{document}
% Local Variables:
% TeX-engine: luatex
% End:
输出:
Running `LaTeX' on `variable-recursive' with ``lualatex --jobname=variable-recursive -file-line-error --synctex=1 -interaction=nonstopmode variable-recursive.tex''
This is LuaHBTeX, Version 1.15.0 (TeX Live 2022)
restricted system commands enabled.
(./variable-recursive.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-24>
(/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/local/texlive/2022/texmf-dist/tex/latex/base/size12.clo))
(/local/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec.sty
(/local/texlive/2022/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/local/texlive/2022/texmf-dist/tex/latex/l3kernel/expl3.sty
(/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-luatex.def)))
(/local/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/local/texlive/2022/texmf-dist/tex/latex/base/fontenc.sty)
(/local/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(./variable-recursive.aux)
(/local/texlive/2022/texmf-dist/tex/latex/base/ts1cmr.fd) [1{/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./variable-recursive.aux))
406 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 48 glue_spec, 4 attribute_list, 1 write nodes
avail lists: 2:49,3:12,4:1,5:96,6:10,7:460,9:34
</home/AW/.fonts/r/Recursive-VariableFont.ttf></home/AW/.fonts/r/Recursive-VariableFont.ttf></home/AW/.fonts/r/Recursive-VariableFont.ttf></home/AW/.fonts/r/R
ecursive-VariableFont.ttf></home/AW/.fonts/r/Recursive-VariableFont.ttf>
Output written on variable-recursive.pdf (1 page, 41296 bytes).
SyncTeX written on variable-recursive.synctex.gz.
Transcript written on variable-recursive.log.
TeX Output finished at Tue Mar 1 18:03:24
但 pdf 中没有斜体字母:
有任何想法吗?
答案1
该axis
功能已记录在luaotfload
手册中。该功能在 TeX Live 2021 中已经存在,但当时它只适用于整形node
器,而不适用于基于 HarfBuzz 的harf
整形器。在 TeX Live 2022 中,我们对其进行了扩展,使其也适用于 HarfBuzz。正如您所注意到的,该node
实现不喜欢大写的轴名,但您可以在 TL 2022 中通过切换到 HarfBuzz 来解决这个问题:
\documentclass[a4paper,12pt]{article}
\usepackage{fontspec}
\setmainfont[
Renderer=HarfBuzz,
ItalicFont=Recursive-VariableFont.ttf,
BoldFont=Recursive-VariableFont.ttf,
BoldItalicFont=Recursive-VariableFont.ttf,
BoldFeatures={RawFeature={+axis={wght=500}}},
BoldItalicFeatures={RawFeature={+axis={wght=900}}},
ItalicFeatures = {RawFeature={+axis={CRSV=1}}}
]{Recursive-VariableFont.ttf}
\setmonofont{Recursive-VariableFont.ttf}[%
Renderer=HarfBuzz,
RawFeature={+axis={MONO=1}}]
\begin{document}
\par the quick brown fox jumps over the lazy dog.
\par\textit{the quick brown fox jumps over the lazy dog.}
\par\textbf{the quick brown fox jumps over the lazy dog.}
\par\textbf{\textit{the quick brown fox jumps over the lazy dog.}}
\texttt{Es irrt der Mensch..}
\end{document}