Note: This question is only for the macOS operating system
The Times New Roman font in my mac doesn't have small caps shapes. So I want to set TeX Gyre Termes as the small caps fallback font.
Using TeX Gyre Termes as the main font
\documentclass{article} \usepackage{fontspec} \setmainfont{texgyretermes}% [ Extension = .otf, UprightFont = *-regular, BoldFont = *-bold, ItalicFont = *-italic, BoldItalicFont = *-bolditalic ] \begin{document} hello \textsc{hello} \textbf{\textsc{hello}} \textit{\textsc{hello}} \end{document} The result is satisfactory as can be seen below:
Using Times New Roman as the main font
\documentclass{article} \usepackage{fontspec} \setmainfont{Times New Roman} \begin{document} hello \textsc{hello} \textbf{\textsc{hello}} \textit{\textsc{hello}} \end{document} As the log shows, the font shapes m/sc, b/sc and m/scit are all missing.
Using TeX Gyre Termes as fallback
attempt 1: using font name
According to the fontspec manual, we can set small caps fallback as follows:
\documentclass{article} \usepackage{fontspec} \setmainfont{Times New Roman}% [ SmallCapsFont = TeX Gyre Termes, SmallCapsFeatures = {Letters=SmallCaps} ] \begin{document} hello \textsc{hello} \textbf{\textsc{hello}} \textit{\textsc{hello}} \end{document} The above example can be compiled only by lualatex (since macOS users can not use fonts in texmf tree by font name when using xelatex). However, lualatex can't either give the satisfactory result:
After installing the TeX Gyre Termes font into my system, xelatex can be used too but the result is the same the above screenshot.
attempt 2: using file name
\documentclass{article} \usepackage{fontspec} \setmainfont{Times New Roman}% [ UprightFeatures = { SmallCapsFont = {texgyretermes-regular.otf}, SmallCapsFeatures = {Letters=SmallCaps} }, BoldFeatures = { SmallCapsFont = {texgyretermes-bold.otf}, SmallCapsFeatures = {Letters=SmallCaps} }, ItalicFeatures = { SmallCapsFont = {texgyretermes-italic.otf}, SmallCapsFeatures = {Letters=SmallCaps} }, BoldItalicFeatures = { SmallCapsFont = {texgyretermes-bolditalic.otf}, SmallCapsFeatures = {Letters=SmallCaps} } ] \begin{document} hello \textsc{hello} \textbf{\textsc{hello}} \textit{\textsc{hello}} \end{document} This fails for both xelatex and lualatex.
Question
Without having to install TeX Gyre Termes into system, how to set the small caps fallback font correctly under both xelatex and lualatex for macOS users?




texmf-disttree.mkdir ~/Library/Fonts/texlive-opentype; find `kpsewhich -var-value TEXMFDIST`/fonts/opentype -name '*.otf' -type f -exec ln \{\} ~/Library/Fonts/texlive-opentype \;See this article in Chinese./Library/Fonts. Actually, I think A said they'd been installed there since forever, but I was sure they were/could be installed into~/Library/Fonts. Since I no longer have a Mac, this wasn't something I could readily establish. Thank you for inadvertently suggesting I'm not going completely mad. (I'd suggested/Library/Fontswas not equivalent to~/.fontson Linux because I thought it should be~/Library/Fonts,/Library/Fontsbeing more like/usr/local/share/fonts.)