[XeTeX] Checking for existence of font feature

Michael Lynch michael.s.lynch at gmail.com
Wed Aug 11 21:54:00 CEST 2010

Hello all,

I'm trying to test for the existence of an OpenType font feature before 
it's used in a document.

I want a command that will transparently emulate an acceptable 
alternative in the event that the feature doesn't exist, whilst logging 
the problem in the log file. Since the command is part of a package I'm 
creating, I think this is preferable to it failing outright.

One of the features I'd like to test for is small caps. I'm not 
optimistic, as in a plain XeTeX document,

\font\a="Times New Roman:+smcp" at 12pt

doesn't register as causing any problems, even though this call doesn't 
produce anything different to

\font\a="Times New Roman" at 12pt

Have I missed something? opentype-info.tex iterates through all the 
features, so there might be some way to check each one as it goes past, 
but this does seem pretty laborious. I don't really have the experience 
of TeX to know how to do something with that either though.



More information about the XeTeX mailing list