# TeX Gyre Termes' ligatures work in LuaLaTeX, but fail in XeLaTeX

I recently installed TeX Gyre Termes, and I noticed that ligatures were present when I compiled with LuaLaTeX, but not with XeLaTeX:

% !TeX program = XeLaTeX
\documentclass{article}
\usepackage{fontspec}
\setromanfont{TeXGyreTermes} % no spaces in name

\begin{document}

fi ff fl ffi

\end{document}


XeLaTeX:

LuaLaTeX:

The same problem arises with small caps- in LuaLaTeX, all works well, but upon switching to XeLaTeX, small caps disappear, and XeLaTeX warns me that it must substitute with normal TeX Gyre Termes instead of small caps. I suspect that the issue is related to my installation of TeX Gyre Termes, as ligatures are present when other fonts are used. However, I have tried re-installing TeX Gyre Termes multiple times, but this issue persists.

Therefore, my question is: because I am unable to use a functional copy of TeX Gyre Termes, and because XeLaTeX compiles faster than LuaLaTeX, what can I do to ensure that ligatures appear when I compile with XeLaTeX?

(I do not want to switch out TeX Gyre Termes with another Times-like font, as I prefer its italic best. However, I do not care whether the OpenType version of the font is used or not.)

This question seems related: What are the incompatibilities of pdftex, xetex and luatex? However, it does not discuss the reason behind this difference, and what may be done about it.

• It is my understanding that XeLaTeX cannot load Open Type fonts by font name, from the TeX distribution folder. It can only load them by file name. Could it be that the fonts are being loaded from your operating system instead? LuaaTeX does not exhibit this behavior. – user139954 Jan 14 '18 at 23:51
• I doubt those images are made from that input ff making a fl ligature? :-) for me it works and gives ligatures in xelatex texlive 2017 with \setromanfont{TeX Gyre Termes} or \setromanfont{texgyretermes-regular.otf} The version with the font name but spaces removed fails to find the file at all. – David Carlisle Jan 15 '18 at 1:12
• @RobtAll texlive includes a configuration file for fontconfig so that font files in texlive can be found by font name. – David Carlisle Jan 15 '18 at 1:13
• @DavidCarlisle haha, I completely missed that. :) However, the OTF version that I have is without spaces, and with spaces, TeX cannot find the font. I don't know how I wound up with a version of TeX Gyre Termes that differs from that of everybody else- I got it from GUST's website- but my question concerns what to do given that I have a version of TeX Gyre Termes that differs from others and that I so far cannot correct. – Robert Zhang Jan 15 '18 at 1:23
• @RobtAll - If your TeX distribution is of relatively recent vintage, \setromanfont{TeX Gyre Termes} should work under both XeLaTeX and LuaLaTeX. – Mico Jan 15 '18 at 1:59

My guess is that one your system xelatex is finding a type1 font when you use the name without spaces. You could add \XeTeXtracingfonts=1 and check the log-file, to confirm this guess.
• After using \XeTeXtracingfonts=1, I find many messages that resemble LaTeX Font Info: Overwriting symbol font 'operators' in version 'normal' TU/TeXGyreTermes(0)/m/n --> TU/TeXGyreTermes(0)/m/n on input line 147.I also loaded Arial and Courier New, which also show up as TU, so I do not believe that it shows up as a T1 font. – Robert Zhang Jan 17 '18 at 23:50
• @RobertZhang T1 in latex refers to a font encoding (of 256 characters per font) as opposed to OT1 (127 characters) or TU (Unicode). That is unrelated to "Type 1" which is a PostScript font fomat which in xetex is best avoided if you have a opentype version of the font. – David Carlisle Jan 18 '18 at 7:35
• @UlrikeFischer in fact, they do end with pfb. The log file shows messages like Requested font "TeXGyreTermes/OT" at 12.0pt -> C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/tex-gyre/qtmr.pfb – Robert Zhang Jan 19 '18 at 3:24