I an running Tex Live 2012 and would like to use the font Fira Sans in my documents. Unfortunately it is a relatively new font so not included in any of the packages for this version of Texlive.
However I have downloaded the .otf
files and placed them in /home/gthomson/texmf/fonts/opentype/Fira
and am trying to call them in xeLatex like this, following the fontspec docs:
\documentclass[12pt,twoside]{article}
\usepackage{fontspec}
\begin{document}
\setmainfont{FiraSans-Regular.otf}[
Path = /home/gthomson/texmf/fonts/opentype/Fira,
BoldFont = FiraSans-Bold.otf,
ItalicFont = FiraSans-Italic.otf,
BoldItalicFont = FiraSans-BoldItalic.otf]
\section{EXAMPLE}
EXAMPLE EXAMPLE EXAMPLE EXAMPLE EXAMPLE\\
\textbf{EXAMPLE} \textbf{EXAMPLE} \textbf{EXAMPLE} \textbf{EXAMPLE} \textbf{EXAMPLE}\\
\textit{EXAMPLE} \textit{EXAMPLE} \textit{EXAMPLE} \textit{EXAMPLE} \textit{EXAMPLE}\\
\end{document}
This only works partially as while the font is loaded, only the regular version is, not the bold or italicised versions. This is despite the files being located in the same location. Furthermore the call for these fonts is printed out So what I get looks like this:
[ Path = /home/gthomson/texmf/fonts/opentype/Fira, BoldFont = FiraSans-
Bold.otf, ItalicFont = FiraSans-Italic.otf, BoldItalicFont = FiraSans-BoldItalic.otf]
1 EXAMPLE
EXAMPLE EXAMPLE EXAMPLE EXAMPLE EXAMPLE
EXAMPLE EXAMPLE EXAMPLE EXAMPLE EXAMPLE
EXAMPLE EXAMPLE EXAMPLE EXAMPLE EXAMPLE
How can I get all versions of the font to load?
Best Answer
Since you have TeX Live 2012, you probably have an old version of
fontspec
which does not support the new syntax for\setmainfont
.So, either
or
Use the old syntax, that is
instead of
Note, however, that the path should contain a trailing
/
.Just FYI, the new syntax has been introduced with
fontspec
v2.4 (2014/06/01), so, if you have an older version, you have to use the old syntax.