11

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

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

Here is an example:

\documentclass[a4paper,11pt]{article}

\usepackage[CJKchecksingle,CJKnumber]{xeCJK}
\setmainfont[Mapping=tex-text]{Adobe Garamond Pro}

\begin{document}

test test test

\end{document}
2
  • BTW, the "fc-list" command cannot found the oft fonts.
    – On1gub
    Jan 28, 2019 at 17:05
  • 1
    First try running fc-cache.
    – Davislor
    Jan 28, 2019 at 17:06

3 Answers 3

2

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.

Update

In TeX Live, LuaTeX (but not PDFTeX) now support setting the OSFONTDIR environment variable to

set OSFONTDIR="C:/Windows/fonts//;C:/Users/Username/AppData/Local/Microsoft/Windows/Fonts//"

Unfortunately, the system WINDIR and LOCALAPPDATA environment variables use backslashes, and TeX Live expects forward slashes.

You would want to set this on your user account in your advanced system preferences.

8
  • 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, 2019 at 17:36
  • @Thérèse youtube.com/watch?v=L0MfY6EkiKc
    – Davislor
    Jan 28, 2019 at 17:39
  • 3
    Yikes! texdoc youtube? Thanks for the link.
    – Thérèse
    Jan 28, 2019 at 17:41
  • @Thérèse I rephrased that sentence. Thanks for pointing it out.
    – Davislor
    Jan 28, 2019 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, 2019 at 19:03
29

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

enter image description here

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.

3
  • 1
    This is indeed the solution! man I stuck on this for the whole day and you just saved me with this solution. Feb 24, 2021 at 20:35
  • The right answer, Thanks !! Oct 25, 2021 at 23:31
  • Thank you! This worked for me too
    – ಠ_ಠ
    Jul 28, 2022 at 5:33
2

When you install the collection of fonts for windows, select all of them, right click and choose the “Install for all users” option, then build your document in latex . If the latex encountered to errors again, delet the latex document and creat it again.

1
  • It really started to compile after deletion o_0 Thx! Jun 8, 2022 at 18:04

You must log in to answer this question.

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