I'm having trouble loading some right-to-left fonts in a document I'm working on. I chose one at random — Avestan.
MWE requires that you download https://noto-website-2.storage.googleapis.com/pkgs/NotoSansAvestan-hinted.zip and put the .ttf file in a "fonts/" subdirectory relative to the MWE:
\documentclass[a4paper]{article}
\usepackage{fontspec}
\usepackage[english]{babel}
\newfontfamily\avestanfont[Path=fonts/,UprightFont=*-Regular,Extension=.ttf]{Noto Sans Avestan}
\newcommand{\textavestan}[1]{\bgroup\textdir TRT\avestanfont #1\egroup}
\begin{document}
Test Avestan: \textavestan{𐬰𐬀𐬭𐬀𐬚𐬎𐬱𐬙𐬭𐬀}
\end{document}
Compilation errors with lualatex:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "NotoSansAvestan-Regular" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
Furthermore,
! Font \TU/NotoSansAvestan(0)/m/n/10=[fonts/NotoSansAvestan-Regular.ttf]:mode=node; at 10pt not loadable: metric data not found or bad.
Any recommendations on how to get this font to work are appreciated.
Edit Some friendly helpers in the comments were wondering if it's an environmental issue. I've tried this on a clean cygwin texlive install, and using texlive-portable from the install manager on Windows. Using the mwe.tex from above and putting NotoSansAvestan-Regular.ttf in the fonts/ subdirectory, I have the following clean environment set up:
- C:\temp\texlive-portable: new install of texlive w/ babel, babel-english, luatex, fontspec, and luaotfload
- C:\temp\mwe\mwe.tex: the mwe.tex example
- C:\temp\mwe\fonts\NotoSansAvestan-Regular.ttf: the font extracted from the .zip package
With what I think is a fairly clean setup now, from C:\temp\mwe, I run:
>C:\temp\texlive-portable\bin\win32\lualatex.exe mwe
This is LuaTeX, Version 1.0.4 (TeX Live 2017/W32TeX)
restricted system commands enabled.
(./mwe.tex
LaTeX2e <2017-04-15>
(using write cache: C:/TEMP/texlive-portable/texmf-var/luatex-cache/generic)(us
ing read cache: C:/TEMP/texlive-portable/texmf-var/luatex-cache/generic C:/TEMP
/texlive-portable/texmf-var/luatex-cache/generic)
luaotfload | main : initialization completed in 0.297 seconds
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/base/size10.clo(load luc: C:/TEM
P/texlive-portable/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.l
uc))) (c:/TEMP/texlive-portable/texmf-dist/tex/latex/fontspec/fontspec.sty
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/l3kernel/expl3.sty
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/l3kernel/l3pdfmode.def)))
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/base/fontenc.sty
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/base/tuenc.def))
(c:/TEMP/texlive-portable/texmf-dist/tex/latex/fontspec/fontspec.cfg)(load luc:
C:/TEMP/texlive-portable/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-bo
ld.luc)(load luc: C:/TEMP/texlive-portable/texmf-var/luatex-cache/generic/fonts
/otl/lmroman10-italic.luc)))
(c:/TEMP/texlive-portable/texmf-dist/tex/generic/babel/babel.sty
(c:/TEMP/texlive-portable/texmf-dist/tex/generic/babel/switch.def)
(c:/TEMP/texlive-portable/texmf-dist/tex/generic/babel/luababel.def)
(c:/TEMP/texlive-portable/texmf-dist/tex/generic/babel-english/english.ldf
(c:/TEMP/texlive-portable/texmf-dist/tex/generic/babel/babel.def
(c:/TEMP/texlive-portable/texmf-dist/tex/generic/babel/luababel.def))))
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "NotoSansAvestan-Regular" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
l.4 ...=*-Regular,Extension=.ttf]{Noto Sans Avestan}
?
EDIT 2 Ok, I finally got it to work! The font from http://fonts.gstatic.com/ea/notosansavestan/v1/download.zip works just fine, but the font from https://noto-website-2.storage.googleapis.com/pkgs/NotoSansAvestan-hinted.zip is giving me the aforementioned errors. I guess the question is now, "Why is the official Avestan font not loading in lualatex?"
Ttfdump is also failing:
$ ttfdump.exe NotoSansAvestan-Regular.ttf
Unrecognized GPOS lookupFormat
It appears that libttf is the culprit here.