Problem
I've just bought Baskerville Classico font and tried to load it using Xelatex, but small caps didn't work. I finally found this post : [https://tex.stackexchange.com/questions/165998/small-caps-in-fontspec-on-xelatex]... added this piece of code and loaded it with LuaLaTex and it works:
\setmainfont[
SmallCapsFont={TeX Gyre Termes},
SmallCapsFeatures={Letters=SmallCaps},
]{Baskerville Classico}
Is my preamble correct?
This is a MWE:
\documentclass[hidelinks,12pt,twoside,openright,a4paper]{book}
\usepackage[french]{babel}
\usepackage{fontspec}
\setmainfont[
SmallCapsFont={TeX Gyre Termes},
SmallCapsFeatures={Letters=SmallCaps},
]{Baskerville Classico}
\usepackage{lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{} % sets both header and footer to nothing
\fancyfoot{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[CE]{\textsc{A title}} % even pages: chapter title
\fancyhead[CO]{\textsc\leftmark} % odd pages: book title
\begin{document}
\chapter{A title}
\lipsum
\end{document}
Solution
Finally, I found the solution. This is the piece of code to add instead of Tex Gyre Termes:
\setmainfont[
SmallCapsFont={BaskervilleClassicoSC},
SmallCapsFeatures={Letters=SmallCaps},
]{Baskerville Classico}
otfinfo -f
say it supports the Small Caps feature? Or does the family have small caps as a separate face?otfinfo
needs the file and path, which you should be able to find withluaotfload-tool --find "Baskerville Classico"
.