9

I have installed some fonts such as "HelveticaNeueLT Pro 53 Ex.otf" on my Windows, however my XeLaTeX cannot find the font. Here is my code:

\font\headers="HelveticaNeueLT Pro 53 Ex:letterspace=5" at 20pt
\font\SectionHeaders="HelveticaNeueLT Pro 53 Ex:letterspace=5" at 14pt

The error I get is:

Couldn't find `HelveticaNeueLT Pro 53 Ex:letterspace.cfg'

miktex-maketfm: No creation rule for font "HelveticaNeueLT Pro 53 Ex:letterspace=5".

! Font \headers="HelveticaNeueLT Pro 53 Ex:letterspace=5" at 20.0pt not loadabl e: Metric (TFM) file or installed font not found. l.36 ...icaNeueLT Pro 53 Ex:letterspace=5" at 20pt
doncherry
  • 54,637

4 Answers4

8

Use fc-list command to list full names of all available fonts in your computer. The result may be scroll many pages, so you'd better put them in a single file.

fc-list > fontnames.txt

enter image description here

Then you open the file generated and see the font name you can use. For example, you may get these in file fontnames.txt:

Minion Pro:style=Bold Italic
Minion Pro:style=Regular
Minion Pro:style=Italic
Minion Pro:style=Bold

Thus you can use Minion Pro as a font name. Say,

% plain TeX
\font\minion="Minion Pro"
{\minion This is Minion font.}
\bye

Using LaTeX, fontspec is preferred. For example:

\usepackage{fontspec}
\setmainfont{Minion Pro}

See manual of fontspec for more usage.

Leo Liu
  • 77,365
3

To load the font by file name, you have to enclose it in square brackets:

\font\headers="[HelveticaNeueLT Pro 53 Ex.otf]:letterspace=5" at 20pt
\font\SectionHeaders="[HelveticaNeueLT Pro 53 Ex.otf]:letterspace=5" at 14pt

Which works even for fonts not installed in the system directories (e.g. fonts in the current directory, or TeX directory structure). You have to find the internal font name (which is different than file name), to load fonts by font name.

0

Emphasizing some of the fonts in the original question, the way the fonts are installed in the system may also affect whether or not the fontspec package can find them.

If the fonts are installed for all users (admin rights may be needed) they are typically stored in the folder C:\Windows\Fonts. If you happen to install a font by just double clicking on the respective file, it will be stored in a user specific folder, e.g., C:\Users\Username\AppData\Local\Microsoft\Windows\Fonts in Windows 10. The latter is usually not automatically searched by LaTeX.

Depending on your LaTeX distribution you may change which folders are searched by XeTeX for installed fonts as described in another question.

However, this does not work for LuaTeX as discussed here.

Johnson
  • 227
0

As I pointed out I am a newbie. One must use "fontspec" package in order to use the fonts installed on the system.

I used the following code to solve my problem:

\usepackage[T1]{fontenc}

\usepackage{fontspec}
  • 4
    Don't use fontenc in combination with fontspec. See http://tex.stackexchange.com/questions/2984. – Philipp Jan 25 '11 at 00:15
  • Thanks Philip, I read the information in the post. However I still don't understand why I should not include fonttec in combination with fontspec. Do they CONFLICT? (I have found that the document compiles just fine) – cyber.scientist Jan 25 '11 at 03:12
  • 1
    No, they do not confilict. fontspec will internally include fontenc and set EU1 as the default font encoding using XeLaTeX. You must use fontenc carefully together with fontspec. – Leo Liu Jan 25 '11 at 07:28