Wolfgang Schuster wrote:
Hi,
is it possible to check if a font has a certain feature like smallcaps?
\startluacode function commands.doifelsecurrentfonthasfeature(name) local f = fonts.ids[font.current()] f = f and f.shared f = f and f.otfdata f = f and f.luatex f = f and f.features commands.doifelse(f and (f.gpos[name] or f.gsub[name])) end \stopluacode \def\doifelsecurrentfonthasfeature#1% {\ctxlua{commands.doifelsecurrentfonthasfeature("#1")}} \doifelsecurrentfonthasfeature{smcp}{YES}{NO} \doifelsecurrentfonthasfeature{crap}{YES}{NO} \doifelsecurrentfonthasfeature{kern}{YES}{NO} for arbitrary fonts by names is doable but tricky in the sense that we then need to load the font which is costly ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------