I'm certain this must be a duplicate as there are lots of very similar questions, but none of the answers I can find work for me.

I have a set of .otf font files (one each for the regular, italic, bold and bold italic versions) which I want to use as the default font in a XeLaTeX document. I've tried lots of ways of loading them, but here's a concrete example:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{HelveticaNeueLTPro}[
Path = /home/richard/,
UprightFont = *-Roman,
BoldFont = *-Bd,
ItalicFont = *-It,
BoldItalicFont = *-BdIt,
Extension = .otf]

\begin{document}
Test
\end{document}


At the moment, this test.tex file plus the four .otf files are in my home directory (/home/richard/):

richard@fannich:~\$ ls -l *.otf *.tex
-rw-r--r-- 1 richard richard 21608 Mar 14 21:44 HelveticaNeueLTPro-BdIt.otf
-rw-r--r-- 1 richard richard 22776 Mar 14 21:44 HelveticaNeueLTPro-Bd.otf
-rw-r--r-- 1 richard richard 17404 Mar 14 21:44 HelveticaNeueLTPro-It.otf
-rw-r--r-- 1 richard richard 26936 Mar 14 21:44 HelveticaNeueLTPro-Roman.otf
-rw-r--r-- 1 richard richard   290 Mar 14 21:57 test.tex


When I run xelatex test, I get the following error:

(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def)))))kpathsea:make_tex: Invalid fontname [/home/richard/HelveticaNeueLTPro-Roman.otf]/OT', contains '['

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "HelveticaNeueLTPro-Roman" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................

l.9   Extension = .otf]


So far as I can see, I've done exactly what is described in this answer. I've also tried putting the path in braces per this answer, though I think that's only necessary if you spaces or other special characters in the path. I've also tried using the old \setmainfont syntax per this answer, though my fontspec package seems to be from 2017 (the TexLive packages are the Debian ones labelled 2016.20170123-5). I've also tried using xltxtra instead of fontspec per this answer. I've tried removing the Extension = .otf and appending .otf to each font name. I've tried removing the Path parameter as it's in the local directors. I've tried just putting a bare \setmainfont{HelveticaNeueLTPro-Roman.otf}. None of these change the error I see.

Any suggestions? One thing I can't do is install the fonts as root.

• A suggestion is to try it on overleaf to see if it compiles there (overleaf.com/learn/latex/XeLaTeX) ... (Also the font should be installed on your system as any font or on your projects directory... Not sure if your project is just on your home or on a folder in your home) – koleygr Mar 14 at 22:59
• Your font selections also don’t match the actual filenames. For example, HelveticaNeueLTPro-Bd.otf should have BoldFont = *-Bd. However, I’m not sure why it’s not parsing the Extension = .otf right. – Davislor Mar 14 at 23:46
• If you want to install a font only for yourself on Linux, put it in ~/.fonts/. This works without root access. Since you’re using XeTeX, you might re-run fc-cache. – Davislor Mar 14 at 23:51
• @Davislor - Thanks. You're right, I got the bold, italics, and bold italics font names wrong. I've corrected them above, but it makes no difference. I guess that's unsurprising as it's the regular font it's trying and failing to load. – richard Mar 14 at 23:57
• @Davislor - I've just tried putting them in ~/.fonts/ and running fc-cache. It still fails in the same way. I've tried with and without a Path` parameter. – richard Mar 15 at 0:00