# Package fontspec Error: The font cannot be found on win10

I have installed the Adobe Garamond Pro.otf fonts on my computer running win10, as shown in the following picture.

However, when I run xelatex, the otf fonts cannot be found.

Here is an example:

\documentclass[a4paper,11pt]{article}

\usepackage[CJKchecksingle,CJKnumber]{xeCJK}

\begin{document}

test test test

\end{document}

• BTW, the "fc-list" command cannot found the oft fonts. – On1gub Jan 28 '19 at 17:05
• First try running fc-cache. – Davislor Jan 28 '19 at 17:06

First, try running fc-cache.

If that doesn’t work, \setmainfont{[Adobe Garamond Pro]} or the family name reported by otfinfo might.

Loading a font by display name is no longer the preferred way, though, and you can instead try loading by filename. That is, load the actual filenames you get when you dir C:\Windows\Fonts\Adobe*.otf, with options such as UprightFont = *-Regular, ItalicFont = *-Italic and so on.

Although that isn’t the problem in this case, that is the only way to load a font in XeTeX that is installed as part of the TeX distribution, rather than as a system font.

• Why do you say that ‘Loading a font by display name is now deprecated’? I don’t see anything about that in the documentation. – Thérèse Jan 28 '19 at 17:36
• @Thérèse youtube.com/watch?v=L0MfY6EkiKc – Davislor Jan 28 '19 at 17:39
• Yikes! texdoc youtube? Thanks for the link. – Thérèse Jan 28 '19 at 17:41
• @Thérèse I rephrased that sentence. Thanks for pointing it out. – Davislor Jan 28 '19 at 17:45
• @Thérèse The manual does say that loading by file name is the only way for XeTeX to see a font installed in a TeX, rather than a system, directory. – Davislor Jan 28 '19 at 19:03

Same problem and solved, win10

DONOT double click to install, it will install this font for current user.

right click the font file, choose install for all users

There are two path,C:\Windows\Fonts and C:\Users\user_name\AppData\Local\Microsoft\Windows\Fonts,

install for all users will install the font file in first path, and show it in first path, double click will install the font file in second path, but show it in first path. This will mislead you.