7

I installed some .otf fonts in /usr/local/texlive/texmf-local/fonts, changed /usr/local/texlive/2015/texmf-var/fonts/conf/texlive-fontconfig.conf adding the string

<dir>/usr/local/texlive/texmf-local/fonts</dir>

I copied this changed file in /etc/fonts/conf.d/09-texlive.conf. Finally, i gave:

fc-cache -fsv

It seems the new font are found into the system:

/usr/local/texlive/texmf-local/fonts/opentype/ArnoPro: caching, new cache contents: 32 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/BriosoPro: caching, new cache contents: 42 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/CaslonPro: caching, new cache contents: 6 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/ChaparralPro: caching, new cache contents: 32 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/Crimson: caching, new cache contents: 6 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/Fontin: caching, new cache contents: 4 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/GaramondPremierePro: caching, new cache contents: 34 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/JensonPro: caching, new cache contents: 32 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/MinionPro: caching, new cache contents: 64 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/MyriadPro: caching, new cache contents: 40 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/opentype/WarnockPro: caching, new cache contents: 32 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/source: caching, new cache contents: 0 fonts, 1 dirs
/usr/local/texlive/texmf-local/fonts/source/local: caching, new cache contents: 0 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/tfm: caching, new cache contents: 0 fonts, 1 dirs
/usr/local/texlive/texmf-local/fonts/tfm/local: caching, new cache contents: 0 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/type1: caching, new cache contents: 0 fonts, 1 dirs
/usr/local/texlive/texmf-local/fonts/type1/local: caching, new cache contents: 0 fonts, 0 dirs
/usr/local/texlive/texmf-local/fonts/vf: caching, new cache contents: 0 fonts, 1 dirs
/usr/local/texlive/texmf-local/fonts/vf/local: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts: caching, new cache contents: 0 fonts, 5 dirs
/usr/X11R6/lib/X11/fonts: skipping, no such directory
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/.local/share/fonts: skipping, no such directory
/usr/local/texlive/2015/texmf-dist/fonts/opentype: caching, new cache contents: 0 fonts, 7 dirs
/usr/local/texlive/2015/texmf-dist/fonts/truetype: caching, new cache contents: 0 fonts, 10 dirs
/usr/local/texlive/2015/texmf-dist/fonts/type1: caching, new cache contents: 0 fonts, 26 dirs
/usr/local/texlive/texmf-local/fonts: caching, new cache contents: 0 fonts, 5 dirs
/var/cache/fontconfig: cleaning cache directory
/.cache/fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

Moreover, for instance:

samiel@debian:~$ fc-list : family file | grep -i fontin
/usr/local/texlive/texmf-local/fonts/opentype/Fontin/Fontin-SmallCaps.otf: Fontin SmallCaps,Fontin
/usr/local/texlive/texmf-local/fonts/opentype/Fontin/Fontin-Bold.otf: Fontin
/usr/local/texlive/texmf-local/fonts/opentype/Fontin/Fontin-Italic.otf: Fontin
/usr/local/texlive/texmf-local/fonts/opentype/Fontin/Fontin-Regular.otf: Fontin

But if I try to compile with xelatex using one of the fonts just added, I obtain:

(/usr/local/texlive/2015/texmf-dist/tex/latex/unicode-math/unicode-math-table.t
ex)))kpathsea:make_tex: Invalid fontname `Garamond Premier Pro', contains ' '


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

l.6 ...TeX,Numbers=OldStyle]{Garamond Premier Pro}

? 

What am I missing? Thanx

PS

Please consider:

    root@debian:/usr/local/texlive/texmf-local/fonts/opentype/CaslonPro# otfinfo -a ACaslonPro-Regular.otf 
Adobe Caslon Pro

A MWE

    \documentclass[a4paper]{article}
\usepackage{fontspec}

\defaultfontfeatures{Contextuals=NoAlternate}
\setmainfont[Ligatures=TeX,Numbers=OldStyle]{Adobe Caslon Pro}
\usepackage{polyglossia}
\setmainlanguage[babelshorthands=true]{italian}

\begin{document}
Quel ramo del lago di Como
\end{document}

The output

    (/usr/local/texlive/2015/texmf-dist/tex/latex/fontspec/fontspec.cfg)))kpathsea:make_tex: Invalid fontname `Adobe Caslon Pro', contains ' '


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

l.5 ...res=TeX,Numbers=OldStyle]{Adobe Caslon Pro}

? 

I'm very confused

FURTHER PS

In a partition where I have a Debian installed all works fine. The .otf are property of root-staff and permission are -rw------. The same in the other, not working partition...

7
  • Does the name GaramondPremrPro work?
    – Thérèse
    Sep 6, 2015 at 16:09
  • The official name is Garamond Premr Pro (with spaces).
    – Bernard
    Sep 6, 2015 at 16:20
  • 1
    There’s a weird inconsistency in the naming of this family: for the roman face in the regular weight, Fontforge reports the “name for humans” as “Garamond Premiere Pro”, while the italic is “Premier” without an e. To add to the confusion, xetex, unlike luatex, seems to choke on the spaces.
    – Thérèse
    Sep 6, 2015 at 16:29
  • In a older computer all works fine with these settings. So I don't think it's a trouble with code...
    – user41063
    Sep 6, 2015 at 17:58
  • 1
    @Bernard Perhaps we have different versions of the font. Adobe, unlike most foundries, doesn’t notify its customers when it revises a font, much less does it offer free or discounted updates. :-(
    – Thérèse
    Sep 6, 2015 at 21:38

2 Answers 2

7

The algorithms to find fonts in XeLaTeX and LuaLaTeX are different. I don’t fully understand them, to be honest, but I’ve found that what works on both is the human-readable name reported by fc-list. So, let’s take as an example the Linux Libertine family. (In practical real-world use, there’s the libertine package for this, but I picked this example because the right name to use is distinctive.)

$ fc-list | grep "Linux Libertine" | grep ".otf" | grep 2015
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_MO.otf: Linux Libertine Mono O:style=Mono Oblique
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_RZI.otf: Linux Libertine O:style=Semibold Italic
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_RB.otf: Linux Libertine O:style=Bold
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_M.otf: Linux Libertine Mono O:style=Mono
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_DR.otf: Linux Libertine Display O:style=Regular
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_RZ.otf: Linux Libertine O:style=Semibold
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_RBI.otf: Linux Libertine O:style=Bold Italic
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_RI.otf: Linux Libertine O:style=Italic
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_MBO.otf: Linux Libertine Mono O :style=Mono Bold Oblique
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_MB.otf: Linux Libertine Mono O :style=Mono Bold
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_R.otf: Linux Libertine O:style=Regular
/usr/local/texlive/2015/texmf-dist/fonts/opentype/public/libertine/LinLibertine_I.otf: Linux Libertine Initials O:style=Initials

The names we want to use are the ones in the middle field, with the style appended if necessary. So the file

\documentclass[10pt]{standalone}
\usepackage{fontspec}

\setmainfont{Linux Libertine O}
\setmonofont[ItalicFont={Linux Libertine Mono O Oblique}]{Linux Libertine Mono O}
\newfontface{\lli}{Linux Libertine Display O}

\begin{document}
Linux Libertine Regular \textbf{Bold} \textit{Italic} \textsc{\textit{Italic Small Caps}}

\texttt{Mono} \texttt{\textsl{Mono Oblique}} {\lli Display}
\end{document}

produces:

enter image description here

In this case, we needed to give a hint which font to use for mono italic, but fontspec is smart enough to make everything else work out of the box. Another problem reported in the comments to my previous answer was with \scshape\itshape. If your font family has a separate italic small caps font, the instructions to load that are in §5.1.2 of the fontspec manual.

8
  • 3
    Rather than adding a new answer, you should have edited the old one.
    – egreg
    Sep 6, 2015 at 20:04
  • Okay. Should I delete this one and do that? I was worried that the comments on the old one would make no sense.
    – Davislor
    Sep 6, 2015 at 20:06
  • You can remove the old one if it doesn't really answer the question.
    – egreg
    Sep 6, 2015 at 20:08
  • Okay. I’ll edit to sound less petulant and do that. If my first answer confused everyone, it was a bad answer.
    – Davislor
    Sep 6, 2015 at 20:10
  • 2
    Much better! LuaLaTeX (actually luaotfload) caches the font names; it doesn't use the fc library.
    – egreg
    Sep 6, 2015 at 20:57
1

This problem can also be caused by caching issues; on my machine, the following was enough to fix it:

rm -rf ~/.texlive2016/texmf-var/luatex-cache/ ~/.texmf-var/luatex-cache/

The name of the cache folders is printed by LuaLaTeX during compilation:

(using write cache: /home/<username>/.texlive2016/texmf-var/luatex-cache/generic)
1
  • Very helpful! This was exactly my issue! Sep 23, 2022 at 3:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .