[XeTeX] Res: overriding \addfontfeatures

Flavio Costa flaviocosta at yahoo.com.br
Wed Jun 4 16:37:26 CEST 2008

Hi Will,

Unfortunately the only OpenType fonts with oldstyle figures I have are Minion Pro and Myriad Pro, both from Adobe, so I cannot tell if the problem is in XeTeX or in the fonts.

So I tried:
\newfontfamily\linecounterfont[Numbers={OldStyle}]{Minion Pro}
\newcommand{\linecounter}[1]{{\linecounterfont (#1)}}

It works nicely, clean and easy workaround. Thank you very much and good luck!


----- Mensagem original ----
De: Will Robertson <wspr81 at gmail.com>
Para: Unicode-based TeX for Mac OS X and other platforms <xetex at tug.org>
Enviadas: Quarta-feira, 4 de Junho de 2008 1:57:11
Assunto: Re: [XeTeX] overriding \addfontfeatures

On 26/05/2008, at 2:09 PM, Will Robertson wrote:

> On 24/05/2008, at 7:43 AM, Flavio Costa wrote:
>> I think \defaultfontfeatures is not the solution, since it is not  
>> restricted to a scope like \addfontfeatures is. Is there any  
>> elegant way of getting the desired effect?
> This does seem like a bug in fontspec; I wonder why it's happening.  
> I guess I never tested multiple \addfontfeatures in this way before.  
> I'll take a closer look as soon as I can and try and fix this up.

Okay, this is NOT a bug in fontspec.
It might be a bug in the font, or it might be a bug in XeTeX.

Take a look at the following example: (use Minion Pro if you don't  
have Warnock Pro)

\font\1="Warnock Pro:+onum" at 14pt \1 [123]
\font\1="Warnock Pro:+lnum,+onum" at 14pt \1 [123?]
\font\1="Warnock Pro:+lnum" at 14pt \1 [123]
\font\1="Warnock Pro:+onum,+lnum" at 14pt \1 [123]

In the second case, I'd expect the +onum to override the +lnum, but it  
doesn't; for some reason the +lnum has precedence. This seems to  
happen for a number of Adobe fonts, at the very least.

To fix this problem robustly, I need to add an OpenType interpreter to  
fontspec that automatically turns off features that it knows should be  
overridden, but this would be a fair bit of work for me right now.


On 04/06/2008, at 7:40 AM, Flavio Costa wrote:

 I hope to have a solution to this problem anytime soon? If not  
> an actual fix in the package, at least a workaround - since this is  
> the last detail I have to fix to consider my dissertation finished.

Congratulations :)

As a workaround, I'd suggest using explicit fonts for your tabular  
data; something like

\newfontfamily\tabularfont[Numbers={Lining,Monospaced}]{Minion Pro}
\newfontfamily\linecounterfont[Numbers={OldStyle}]{Minion Pro}

And then use those definitions instead of \addfontfeature. It's not as  
flexible, but if it's the last detail you have left I think it will  
suffice for now ;)

Best wishes,

      Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!

More information about the XeTeX mailing list