# [XeTeX] Nested \textit in an italic fontinstance

Jonathan Kew jonathan_kew at sil.org
Wed Sep 13 12:10:13 CEST 2006

On 13 Sep 2006, at 10:52 am, Will Robertson wrote:
>>
>> As a result, "Myriad Pro Italic/I" should be exactly the same as
>> "Myriad Pro Italic", I think. And \2 exactly the same as \1 in your
>> above example. And \textit to have no effect at all when used in
>> {\itshape ... \textit{...}}.
>
> Don't let Peter confuse you. The original poster's email demonstrated
> that "{\textit{Italic \textit{Italic Too}}}" behaves *correctly* for

Right. A single fontspec declaration sets up a whole family, and
behaves correctly (including the nested use of \textit, which differs
from nested use of \emph).

> But in his example (simplified)
>   "\fontspec{Myriad Pro Italic} Italic \textit{Surely this should
> be Italic too?}"
> it's the automatically found "italic" shape of "Myriad Pro Italic"
> (which doesn't make sense) that is returning the font to upright.

Yup. And I think this primarily demonstrates that the OP wasn't fully
understanding how fontspec works, and was trying to manually declare
stuff that FS already handles internally. Of course, FS does support
this, but not quite in the way he was trying.

> (In a perverse way, the italic shape of a slanted font could in
> argument
> be claimed to be an upright one.)
>
> But the behaviour of the /I suffix is nothing to do with me :)

Indeed; that's my code. :)

Currently, /I attempts to find the associated italic face for a non-
italic one, or the associated non-italic if given an italic face as
the starting point. I could, of course, change it to be ignored in
the latter case; how it works is pretty much an arbitrary decision on
my part. I don't see any strong reason to change the current "toggle"
behavior, though; it certainly doesn't prevent fontspec (or any other
package) doing the right thing.

Incidentally, you might expect /B to act similarly, toggling bold on
or off, but it doesn't. Instead, it always tries to find a bolder
version of the font that was given. This is because some families
have many more than two weights, so even though the "base" font is
"bold", there may still be a bolder one available. So the /B modifier
always tries to find a bolder face, and does nothing if you're
already at the boldest member of the family. But I haven't seen any
font families with multiple levels of italic-ness, so didn't see any
reason to try and make /I behave that way.

JK