Discussion:
Peter Flynn
2018-01-04 22:06:32 UTC
I'm using Libre Baskerville with XeLaTeX. It appears that I have badly
misunderstood the effect of \setmainfont.

I was under the impression that it would correctly locate the roman,
italic, bold, and bold-italic fonts for the typeface specified (assuming
they exist and are indexed in the font cache.

I am in fact getting a slanted font instead of italics for \textit.

However, if I load the italic font explicitly, it does provide the
correct italics.

What have I misunderstood?

///Peter

\documentclass{article}
\usepackage{fontspec}
\begin{document}
\Huge
This is normal text \textit{\& this is italics}

This is normal text {\italicfont\& this is italics}
\end{document}
Herb Schulz
2018-01-04 23:40:25 UTC
Post by Peter Flynn
I'm using Libre Baskerville with XeLaTeX. It appears that I have badly
misunderstood the effect of \setmainfont.
I was under the impression that it would correctly locate the roman,
italic, bold, and bold-italic fonts for the typeface specified (assuming
they exist and are indexed in the font cache.
I am in fact getting a slanted font instead of italics for \textit.
However, if I load the italic font explicitly, it does provide the
correct italics.
What have I misunderstood?
///Peter
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\Huge
This is normal text \textit{\& this is italics}
This is normal text {\italicfont\& this is italics}
\end{document}
Howdy,

Fontspec doesn't always get the font choices right. You can use

Good Luck,
Herb Schulz
Peter Flynn
2018-01-05 20:16:56 UTC
On 04/01/18 23:40, Herb Schulz wrote:
[...]
Post by Herb Schulz
Fontspec doesn't always get the font choices right. You can use
On 05/01/18 03:30, Bob Tennent wrote:
[...]
Post by Herb Schulz
It might be easier to use

///Peter
jon
2018-01-06 02:59:24 UTC
Post by Herb Schulz
Fontspec doesn't always get the font choices right. You can use
note that this is the older form of the command. it still works, but is
(i believe) deprecated.

cheers,
jon.

Bob Tennent
2018-01-05 03:30:47 UTC
Post by Peter Flynn
I'm using Libre Baskerville with XeLaTeX. It appears that I have badly
misunderstood the effect of \setmainfont.
I was under the impression that it would correctly locate the roman,
italic, bold, and bold-italic fonts for the typeface specified (assuming
they exist and are indexed in the font cache.
What have I misunderstood?
It might be easier to use