I have encountered something I fail to understand. I have read that I should use fontspec and not fontenc when I use XeLaTeX, but this causes some problems for me when I use the cochineal font package.
When I use the following code:
\documentclass[a4paper, english]{article}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{fontspec}
\usepackage[p,osf]{cochineal}
\title{Some title}
\begin{document}
\maketitle
some text
\end{document}
I get the message in the log that Font shape TU/Cochineal-OsF/m/n undefined(Font) using TU/lmr/m/n instead
and the font for the title defaults ot Latin Modern. But when I instead use:
\documentclass[a4paper, english]{article}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[p,osf]{cochineal}
\title{Some title}
\begin{document}
\maketitle
some text
\end{document}
I don't get that message and the title is in the Cochineal font. Am I setting something wrong when I use fontspec? Is there some drawback with using fontenc together with XeLaTex? I would really like to get Cochineal also in the title.
I'm using MikTex on a Windows 10 machine.
All the best, Richard
Grüße
in your example with fontenc and you will see the problem. T1/fontenc is not for xelatex. It will break with quite a number of chars. Use pdflatex if you want to use your font.