[XeTeX] Checking for existence of font feature

Will Robertson wspr81 at gmail.com
Wed Aug 18 07:10:51 CEST 2010


On 2010-08-12 16:16:54 +0930, Khaled Hosny 
<khaledhosny at eglug.org> said:

>> Ah, thank you. Are these features (relatively) new? Rather
>> embarrassing not to have spotted them, but anyway…
> 
> All were introduced in version 2, I think.

Yep, very new.

>> I've got a problem using these commands. Using XeTeX v0.9995.1
>> texlive svn 15079 on MiKTeX 2.8, fontspec 2010/08/01, none of these
>> “lower-level” fontspec features I've tried work.
>> 
>> I've copied the appropriate example from the manual:
>> 
>> \fontspec_if_feature:nTF {smcp} {True} {False}.

> Since those command use expl3 syntax, you will need \ExplSyntaxOn before
> using them.

Right; something like this:

\ExplSyntaxOn
% note that spaces are completely ignored in here!
\newcommand \testcaps [2] {
  \fontspec_if_feature:nTF {smcp} {#1}{#2}
}
\ExplSyntaxOff
...
\fontspec{Times New Roman}
\testcaps{Caps}{No Caps}

Hope this helps,
Will




More information about the XeTeX mailing list