# [XeTeX] Nested \textit in an italic fontinstance

Bruno Voisin bvoisin at mac.com
Wed Sep 13 12:25:39 CEST 2006

Le 13 sept. 06 à 12:10, Jonathan Kew a écrit :

> 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.

With respect to the LaTeX way of dealing with fonts, I think then
that we have a problem for fontspec: \emph corresponds to the
behaviour of /I, but not \textit. When a face is already italic,
fontspec should define \textit to do nothing, and \emph to do what /I
does. But, of course, how could fontspec know that a face is already
italic?

> 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.

I think, though, that this would be more in line with the behaviour
of \textit: do nothing, if you're already italicized.

But that's strictly governed by the LaTeX view of font families.
Maybe ConTeXt or even plain TeX have other views, and in this case
basing the behaviour of XeTeX on that of LaTeX alone would probably
be wrong.

Bruno