假设您有一个 Pro 类字体,其Adobe Arno
具有如下所述的几种设计尺寸:
Design Size Size Ranges
Caption: 8 point 5–8.5 point
SmText: 10 point 8.6–11
Regular: 12 point 11.1–14 point
Subhead: 18 point 14.1–21.5 point
Display: 36 point 21.5+ point
Arno Pro 提供以下一组字体文件:
ArnoPro-Bold.otf
ArnoPro-BoldCaption.otf
ArnoPro-BoldDisplay.otf
ArnoPro-BoldItalic.otf
ArnoPro-BoldItalicCaption.otf
ArnoPro-BoldItalicDisplay.otf
ArnoPro-BoldItalicSmText.otf
ArnoPro-BoldItalicSubhead.otf
ArnoPro-BoldSmText.otf
ArnoPro-BoldSubhead.otf
ArnoPro-Caption.otf
ArnoPro-Display.otf
ArnoPro-Italic.otf
ArnoPro-ItalicCaption.otf
ArnoPro-ItalicDisplay.otf
ArnoPro-ItalicSmText.otf
ArnoPro-ItalicSubhead.otf
ArnoPro-LightDisplay.otf
ArnoPro-LightItalicDisplay.otf
ArnoPro-Regular.otf
ArnoPro-Smbd.otf
ArnoPro-SmbdCaption.otf
ArnoPro-SmbdDisplay.otf
ArnoPro-SmbdItalic.otf
ArnoPro-SmbdItalicCaption.otf
ArnoPro-SmbdItalicDisplay.otf
ArnoPro-SmbdItalicSmText.otf
ArnoPro-SmbdItalicSubhead.otf
ArnoPro-SmbdSmText.otf
ArnoPro-SmbdSubhead.otf
ArnoPro-SmText.otf
ArnoPro-Subhead.otf
应如何安装
fontspec
包才能充分利用这些字体的最佳功能?
起始代码在这里:
\usepackage{fontspec}
\setmainfont[Renderer=Basic,Ligatures={TeX}]{ArnoPro}
这足够了吗?我不确定Caption
这些字体的版本是否会被\small
或\footnotesize
开关调用。这里应该添加什么?
第二次编辑时添加
我的意思是,在标准 LaTeX 类中,字体大小声明根据下表与光学尺寸相关:
declaration \ class option 10pt 11pt 12pt
\tiny 5pt 6pt 6pt
\scriptsize 7pt 8pt 8pt
\footnotesize 8pt 9pt 10pt
\small 9pt 10pt 11pt
\normalsize 10pt 11pt 12pt
\large 12pt 12pt 14pt
\Large 14pt 14pt 17pt
\LARGE 17pt 17pt 20pt
\huge 20pt 20pt 25pt
\Huge 25pt 25pt 25pt
因此,对于10pt
类选项,\tiny
,\scriptsize
应该\footnotesize
切换到 Arno Pro Caption,\small
,\normalsize
切换到 Arno Pro SmText,\large
切换\Large
到 Arno Pro,\LARGE
切换\huge
到 Arno Pro Subhead, 切换\Huge
到 Arno Pro Display。当缩放到相同大小时,所有这些字体实际上都是不同的,因此 Caption 版本看起来\footnosize
比常规版本更好。
答案1
我的问题的答案其实很简单。不需要发明复杂的字体加载程序。fontspec
包足够智能,可以为每种尺寸选择正确的字体形状。要检查这一点,需要运行以下简单测试:
\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{Ligatures={TeX}}
\setmainfont{Arno Pro}
\begin{document}%
\newcommand{\MyText}{No offence meant, I even upvoted your answer.}
\verb|\tiny|=\tiny\MyText\par
\verb|\scriptsize|=\scriptsize\MyText\par
\verb|\footnotesize|=\footnotesize\MyText\par
\verb|\normalsize|=\normalsize\MyText\par
\verb|\large|=\large\MyText\par
\verb|\Large|=\Large\MyText\par
\verb|\LARGE|=\LARGE\MyText\par
\verb|\huge|=\huge\MyText\par
\verb|\Huge|=\Huge\MyText\par
\end{document}
然后我将编译后的 PDF 导出到 MS World 并看到\tiny
\scriptsize
和\footnotesize
由 Arno Pro Caption 输入,正如预期的那样,并且\normalsize
由 Arno Pro SmText 输入,正如预期的那样,等等
伟大的!
不幸的是,我电脑上的 LuaLaTeX [版本 beta-0.70.1-2011052811 (rev 4277) (format=lualatex 2011.6.23)] 无法编译这个简短的示例,但 XeLaTeX 很快就完成了。
答案2
它也适用于lualatex
但需要很多时间为luatex
字体文件创建缓存:
...
(load: /home/voss/.texlive2011/texmf-var/luatex-cache/generic/fonts/otf/temp-ar
nopro-display.lua)(save: /home/voss/.texlive2011/texmf-var/luatex-cache/generic
/fonts/otf/temp-arnopro-display.lua)
Overfull \hbox (15.88963pt too wide) in paragraph at lines 17--17
[][][]\EU2/lmtt/m/n/20.74 \Huge\EU2/ArnoPro(0)/m/n/20.74 =\EU2/ArnoPro(0)/m/n/2
4.88 No of-fence meant, I even up-voted
[1{/usr/local/texlive/2011/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./latex6.aux) )
275 words of node memory still in use:
2 hlist, 1 vlist, 1 rule, 2 glue, 3 attribute, 40 glue_spec, 3 attribute_lis
t, 1 write nodes
avail lists: 2:1551,3:13,4:158,5:179,6:470,7:2,9:34,10:27
</home/voss/.fonts/ArnoPro/ArnoPro-Display.otf></home/voss/.fonts/ArnoPro/ArnoP
ro-Subhead.otf></usr/local/texlive/2011/texmf-dist/fonts/opentype/public/lm/lmm
ono12-regular.otf></home/voss/.fonts/ArnoPro/ArnoPro-Regular.otf></usr/local/te
xlive/2011/texmf-dist/fonts/opentype/public/lm/lmmono8-regular.otf></home/voss/
.fonts/ArnoPro/ArnoPro-Caption.otf></home/voss/.fonts/ArnoPro/ArnoPro-SmText.ot
f></usr/local/texlive/2011/texmf-dist/fonts/opentype/public/lm/lmmono10-regular
.otf>
Output written on latex6.pdf (1 page, 33812 bytes).
Transcript written on latex6.log.
我使用了当前的 TeXLive2011 预测试:
voss@shania:~/Documents> lualatex -v
This is LuaTeX, Version beta-0.70.1-2011061410 (rev 4277)
答案3
\setmainfont{Arno Pro}[Numbers={Lowercase,Proportional}]
多年来,我一直使用简单插入的方法来加载 Arno Pro,而且几乎总是能完美运行。但我最近一直在使用 Overleaf,它需要从本地项目加载字体,另外我想在特定文档中对特别大的文本使用“轻量”,所以我想出了这个来指定光学尺寸的确切范围和名称。这里,光学尺寸取自Arno Pro 的 Adobe 样本册,但我的判断是使用 36pt 以上字体的 Light Display 粗细:
\setmainfont{ArnoPro}[
% Path = {./fonts/}, % use to load from a `fonts` folder in your project
Extension = {.otf},
UprightFont = {*-Regular},
ItalicFont = {*-Italic},
BoldFont = {*-Smbd},
BoldItalicFont = {*-SmbdItalic},
Numbers={Lowercase,Proportional},
UprightFeatures={
SizeFeatures={
{Size={-8.5}, Font=*-Caption},
{Size={8.6-10.99}, Font=*-SmText},
{Size={11-14}, Font=*-Regular},
{Size={14.1-21.59},Font=*-Subhead},
{Size={21.6-35.99},Font=*-Display},
{Size={36-}, Font=*-LightDisplay}
},
},
ItalicFeatures={
SizeFeatures={
{Size={-8.5}, Font=*-ItalicCaption},
{Size={8.6-10.99}, Font=*-ItalicSmText},
{Size={11-14}, Font=*-Italic},
{Size={14.1-21.59},Font=*-ItalicSubhead},
{Size={21.6-35.99},Font=*-ItalicDisplay},
{Size={36-}, Font=*-LightItalicDisplay}
},
},
BoldFeatures={
SizeFeatures={
{Size={-8.5}, Font=*-SmbdCaption},
{Size={8.6-10.99}, Font=*-SmbdSmText},
{Size={11-14}, Font=*-Smbd},
{Size={14.1-21.59},Font=*-SmbdSubhead},
{Size={21.6-}, Font=*-SmbdDisplay}
},
},
BoldItalicFeatures={
SizeFeatures={
{Size={-8.5}, Font=*-SmbdItalicCaption},
{Size={8.6-10.99}, Font=*-SmbdItalicSmText},
{Size={11-14}, Font=*-SmbdItalic},
{Size={14.1-21.59},Font=*-SmbdItalicSubhead},
{Size={21.6-}, Font=*-SmbdItalicDisplay}
},
}
]