LuaLaTeX 的 Noto CJK 字型問題

LuaLaTeX 的 Noto CJK 字型問題

當我嘗試建立文件時,我在第一遍最後看到以下錯誤:

</usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc(NotoSansCJKtc-Regular:3)

!LuaTeX error (file /usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc): sfnt: table not found...

這是 Ubuntu Xenial。我能做些什麼來解決它嗎?

我注意到一些與 Noto 字體和 XeLaTeX 相關的問題。但是,我正在使用 LuaLaTeX,所以我提出了這個新問題。

更新

版本是這樣的:

This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/Debian) (rev 5238)

答案1

雖然NotoSansCJK-Regular.ttc有一個.ttc擴展名,但正如 Google 所說,這實際上是一種 Open Type Collection 格式字體這裡。 LuaTeX beta-0.81.0 中增加了對 OTC 格式的支援(請參考修訂版 5330)。因此,如果您使用舊版的 LuaTeX(例如 TeX Live 2015 中的 beta-0.80.0 版本),則無法在 LuaTeX 中使用 OTC 字體。

讓我們考慮以下文件:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{NotoSansCJK-Regular}
\begin{document}
Hello world.
\end{document}

如果我使用 LuaTeX 版本 beta-0.80.0 編譯此文件,LuaLaTeX 會出錯。

$ lualatex test.tex
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015) (rev 5238)
 restricted \write18 enabled.
# many logs here
!LuaTeX error (file ./NotoSansCJK-Regular.ttc): sfnt: table not found...
 ==> Fatal error occurred, no output PDF file produced!

如果我使用 LuaTeX 版本 0.95.0 進行編譯,則效果很好。

$ lualatex test.tex
This is LuaTeX, Version 0.95.0 (TeX Live 2016)
 restricted system commands enabled.
# many logs here
Output written on test.pdf (1 page, 3558 bytes).
Transcript written on test.log

這是輸出(對於 Japanese Acrobat Reader 很抱歉)。

使用 LuaTeX 的 OTC 嵌入 PDF

相關內容