## LaTeX forum ⇒ Fonts & Character Sets ⇒ Times New Roman \texts{} with XeLatex not working!

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Chris_1996
Posts: 5
Joined: Thu Apr 02, 2020 10:45 pm

### Times New Roman \texts{} with XeLatex not working!

Hello,

I have a problem. I use the package fontspec to write an essay with the font Times New Roman. \textsc{} in XeLatex is not working.
If I use:
\setmainfont{Times New Roman}[
SmallCapsFont=TeX Gyre Termes,
SmallCapsFeatures={Letters=SmallCaps},
]
it is only working in LuaLatex but not in XeLatex. I can not use LuaLatex because some Inkscape pictures look weird when I
compile it with LuaLatex.

The error message of compiling with XeLatex always gives me Tex Gyre Termes not found.

Thx

LaTeXguide.org • LaTeX-Cookbook.net

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

### Times New Roman \texts{} with XeLatex not working!

LuaLaTeX and XeLaTeX have different methods to find fonts by font name. Usually XeLaTeX doesn't have problems to find system fonts by name, but usually fonts in the TEXMF trees are not system fonts. However you can install them as system fonts. How this can be done depends on the system.

BTW: Here the following does work without problems with LuaLaTeX and XeLaTeX:
\documentclass{article}\usepackage{fontspec}\setmainfont{texgyretermes-regular.otf}[  BoldFont=texgyretermes-bold.otf,  ItalicFont=texgyretermes-italic.otf]\begin{document}Roman, \textbf{bold}, \textit{italic}, \textsc{Small Caps}\end{document}
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms.

Chris_1996
Posts: 5
Joined: Thu Apr 02, 2020 10:45 pm

### Times New Roman \texts{} with XeLatex not working!

Thanks for the answer. That would work.
Is there a possibility to only use Tex Gyre Termes for \textsc{}?
The rest should be in the real Times New Roman.

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

### Times New Roman \texts{} with XeLatex not working!

I do not have the original Adobe font, so I cannot test it. Have you tried to load texgyretermes-regular.otf as the SmallCapsFont like shown for the BoldFont or ItalicFont together with the activation of the SmallCapsFeature?
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms.

Chris_1996
Posts: 5
Joined: Thu Apr 02, 2020 10:45 pm

### Times New Roman \texts{} with XeLatex not working!

I tried:
\setmainfont{Times New Roman}[
SmallCapsFont=texgyretermes-regular.otf
]
But it didn't work.

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

### Times New Roman \texts{} with XeLatex not working!

Please use code tags to mark code in postings.

Have you tried:
\setmainfont{Times New Roman}[
SmallCapsFont=texgyretermes-regular.otf,
SmallCapsFeatures={Letters=SmallCaps},
]

Can you please show warnings and errors from the log file?
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms.

Chris_1996
Posts: 5
Joined: Thu Apr 02, 2020 10:45 pm

### Times New Roman \texts{} with XeLatex not working!

! Package fontspec Error: The font "texgyretermes-regular.otf" cannot be
(fontspec) found.

! Cannot use \XeTeXOTcountfeatures with nullfont; not an OpenType Layout font.

! Cannot use \XeTeXOTfeaturetag with nullfont; not an OpenType Layout font.

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

### Times New Roman \texts{} with XeLatex not working!

Strange. If my complete example works, xelatex should find the font. However you can try to copy the font files in the document directory. Then it should always be found.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms.

Chris_1996
Posts: 5
Joined: Thu Apr 02, 2020 10:45 pm

### Times New Roman \texts{} with XeLatex not working!

I copied texgyretermes-regular.otf in the document directory but it didn't work.
Actually I already put it there and sent you the errors.

Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

### Times New Roman \texts{} with XeLatex not working!

Sorry, but I can only tell you that with Linux and TeX Live 2019 or TeX Live 2020-pretest following is working out of the box with XeLaTeX:
\documentclass{article}

\usepackage{fontspec}
\setmainfont[
SmallCapsFont=texgyretermes-regular.otf,
SmallCapsFeatures={Letters=SmallCaps}
]{LinLibertine_R.otf}

\begin{document}
Roman, \textsc{Small Caps}
\end{document}

pdffonts shows the used fonts as:
name                                 type              encoding         emb sub uni object ID------------------------------------ ----------------- ---------------- --- --- --- ---------PJBCAJ+LinLibertineO-Identity-H      CID Type 0C       Identity-H       yes yes yes      5  0LGYHGZ+TeXGyreTermes-Regular-Identity-H CID Type 0C       Identity-H       yes yes yes      7  0

And the result is:

I've used Linux Libertine because of the not available original Times New Roman.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms.