LuaLaTeX 不输出 Times New Roman 的小写字母

LuaLaTeX 不输出 Times New Roman 的小写字母

考虑以下 MWE:

\documentclass{article}
\usepackage{fontspec}

\setmainfont{Times New Roman}
\begin{document}

\textsc{smallcaps}

\end{document}

当我使用 XeLaTeX 编译它时,它会生成一个文档,其中的文本“smallcaps”确实设置为小型大写字母。

但是,当我使用 LuaLaTeX 编译它时,我收到错误

LaTeX Font Warning: Font shape `TU/TimesNewRoman(0)/m/sc' undefined
(Font)              using `TU/TimesNewRoman(0)/m/n' instead on input line 7.

并且文本输出不包含小型大写字母。

如果我使用上面 MWE 中的opentype-info.tex字体名称,它会输出Times New Roman

script = 'latn'
  ...
    features = ... 'smcp'

这似乎证实了该字体文件(times.ttf一种 OpenType TrueType 格式字体;随 Word for Mac 的最新更新一起发布的 Times New Roman 版本)确实支持小型大写字母。

正如其他地方所建议的那样,将[Letters=SmallCaps][RawFeature=+smcp]附加到没有任何效果。\setmainfont{Times New Roman}

如何在 LuaLaTeX 中使用 Times New Roman 中的小型大写字母?

答案1

按照传统的惯例,在发布问题后约 0.002 秒内即可找到问题的答案,事实证明,使用\setmainfont{times.ttf}而不是\setmainfont{Times New Roman}会产生小写字母。为了同时加载粗体、斜体和粗斜体字体,应使用类似以下内容:

\setmainfont{times}[
  Extension      = .ttf ,
  BoldFont       = *bd ,
  ItalicFont     = *i ,
  BoldItalicFont = *bi
]

我对最初问题原因的怀疑是,尽管\setmainfont{Times New Roman}XeLaTeX 找到了 Word 附带的 Times New Roman 的活动副本,但 LuaLaTeX 找到了 macOS 附带的 Times New Roman 的非活动副本,需要使用特定的文件名指向正确的方向。编辑:正如下面 Ulrike Fischer 所建议的,通过查看日志可以确认这一点。

相关内容