我在系统范围内安装了 Alegreya Sans Small Caps:
luaotfload-tool --find="AlegreyaSansSC" --fuzzy luaotfload | resolve : 找到字体“AlegreyaSansSC”!luaotfload | resolve : 解析文件名“~/.local/share/fonts/AlegreyaSansSC-Regular.otf”
我也有 ttf Alegreya:
luaotfload-tool --find="Alegreya" --fuzzyluaotfload | resolve : 找到字体“Alegreya”!luaotfload | resolve : 解析文件名“/usr/local/texlive/2017/texmf-dist/fonts/truetype/huerta/alegreya/Alegreya-%Regular.ttf”
但使用它们是一个问题,因为出于某种原因,LuaLaTeX 认为它们不存在。
lualatex
以下文件:
\documentclass [letterpaper,12pt]{scrartcl}
\usepackage {fontspec}
\setmainfont{TeX Gyre Schola}
\newfontfamily\myfont1{home/bob/.local/share/fonts/AlegreyaSansSC-Regular.otf}
\newfontfamily\myfont2{Alegreya}
\begin{document}
Hail the bows of war the clash of titans, the rude dogs of destiny.
{\myfont1 Make the halls of bows of holly, titan lala la tr la la la}
{\myfont2 Hallelujah the time is now!}
\end{document}
产生这个:
任何有关故障排除的帮助都将不胜感激。
答案1
显示的错误信息是
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "1" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.7 \newfontfamily\myfont1{
~/.local/share/fonts/AlegreyaSansSC-Regular.otf}
?
请注意换行符,表明 TeX 尚未读取,~/.local/share/fonts/AlegreyaSansSC-Regular.otf}
因此它不是在寻找名为 AlegreyaSansSC 的字体,而是在寻找名为1
and 的字体:
The font "1" cannot be found.
注意
\newfontfamily\myfont1
是相同的
\newfontfamily\myfont{1}
就像\fbox1
用\fbox{1}
方框 1 而不是命令调用fbox1