6

I want to use xelatex together with TexGyreTerms:

\ifxetex
  \newcommand{\lsCoverTitleFont}[1]{\fontspec[LetterSpace=-2.0]{TeXGyreTermes}   \fontshape{sc}\fontsize{52pt}{16.75mm}\selectfont #1}
 \else

However, although the packages are installed (Mac, texlive 2012), I get the following complaint:

kpathsea: Running mktextfm TeXGyreTermes
/usr/local/texlive/2012/texmf/web2c/mktexnam: Could not map source abbreviation T for TeXGyreTermes.
/usr/local/texlive/2012/texmf/web2c/mktexnam: Need to update /usr/local/texlive/2012/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input TeXGyreTermes
This is METAFONT, Version 2.718281 (TeX Live 2012)


kpathsea: Running mktexmf TeXGyreTermes
! I can't find file `TeXGyreTermes'.
<*> ...r; mag:=1; nonstopmode; input TeXGyreTermes

Please type another input file name
! Emergency stop.
<*> ...r; mag:=1; nonstopmode; input TeXGyreTermes

Transcript written on mfput.log.
grep: TeXGyreTermes.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input TeXGyreTermes' failed to make TeXGyreTermes.tfm.
kpathsea: Appending font creation commands to missfont.log.

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

l.21 

What can I do?

Thanks for the prompt reply. I tried this, but the result is:

kpathsea: Running mktextfm TeXGyreTermes-Regular
/usr/local/texlive/2012/texmf/web2c/mktexnam: Could not map source abbreviation T for TeXGyreTermes-Regular.
/usr/local/texlive/2012/texmf/web2c/mktexnam: Need to update /usr/local/texlive/2012/texmf-dist/fonts/map/fontname/special.map?
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input TeXGyreTermes-Regular
This is METAFONT, Version 2.718281 (TeX Live 2012)


kpathsea: Running mktexmf TeXGyreTermes-Regular
! I can't find file `TeXGyreTermes-Regular'.
<*> ...1; nonstopmode; input TeXGyreTermes-Regular

Please type another input file name
! Emergency stop.
<*> ...1; nonstopmode; input TeXGyreTermes-Regular

Transcript written on mfput.log.
grep: TeXGyreTermes-Regular.log: No such file or directory
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input TeXGyreTermes-Regular' failed to make TeXGyreTermes-Regular.tfm.
kpathsea: Appending font creation commands to missfont.log.

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

l.21 

? 

I do have this font:

$ otfinfo -f /usr/local/texlive/2012/texmf-dist/fonts/opentype/public/tex-gyre/texgyretermes-regular.otf
aalt    Access All Alternates
c2sc    Small Capitals From Capitals
cpsp    Capital Spacing
dlig    Discretionary Ligatures
frac    Fractions
kern    Kerning
liga    Standard Ligatures
lnum    Lining Figures
onum    Oldstyle Figures
pnum    Proportional Figures
salt    Stylistic Alternates
size    Optical Size
smcp    Small Capitals
ss01    Stylistic Set 1
ss02    Stylistic Set 2
ss03    Stylistic Set 3
ss04    Stylistic Set 4
tnum    Tabular Figures
zero    Slashed Zero
4
  • 2
    Please try fc-list | grep Termes and see, what it puts out. It might be something like TeX Gyre Termes:style=.... That means XeLaTeX can find the font by loading it via \fontspec{TeX Gyre Termes}. (Tested on OpenSUSE 12.1 with TeXLive 2011) Jun 13, 2013 at 7:12
  • This does not list the font ... Jun 13, 2013 at 7:19
  • 1
    I'm sorry. I didn't notice, that you're using Mac OS X, which doesn't manage the fonts using fontconfig, hence fc-list won't help here. You need to specify the correct filename of the font, such as \fontspec{texgyretermes-regular.otf}. (Tested on Mac OS X 10.8 with MacTeX 2012) Jun 13, 2013 at 7:39

2 Answers 2

4

Here (on windows 7) miktex + TL 2013 find the font with the name suggested by Herbert (TeXGyreTermes-Regular). But TL 2012 fails. TL 2012 seems to find fonts in the texmf tree only if the file name is used (system fonts works fine with font names):

\documentclass[]{article}
\usepackage{fontspec}
\begin{document}
\fontspec{texgyretermes-regular.otf}   blub
\fontspec{Times New Roman} blub
\end{document}

I don't know if this behaviour of TL 2012 is new.

3
  • OK. This works. Thanks! The big question is now: How do I set up a class file that works both on Mac and Ubuntu? Jun 13, 2013 at 7:30
  • The file names should work everywhere (as long as the fonts are not renamed in some new version ;-)). Jun 13, 2013 at 7:39
  • 1
    There is no generic way at the moment. See also this post: Handle different font names Jun 13, 2013 at 7:41
2

use

\usepackage{ifxetex,fontspec}
\providecommand\lsCoverTitleFont[1]{#1}
\ifxetex
  \renewcommand\lsCoverTitleFont[1]{{\fontspec[LetterSpace=-2.0]{TeXGyreTermes-Regular}%   
  \fontshape{sc}\fontsize{52pt}{16.75mm}\selectfont #1}}
\fi

or the font with full name

\fontspec[LetterSpace=-2.0]{texgyretermes-regular.otf}% 

You must log in to answer this question.

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