How do I get a list of all font features supported by current font
You can use fontspec
function \fontspec_if_feature:nTF
. It will work in both xelatex and lualatex
\documentclass{article}
\usepackage{fontspec,etoolbox,expl3}
\setmainfont{Cambria}
\def\fontfeatures{abvf, abvm, abvs, aalt, akhn, nalt, halt, afrc, valt, vhal, blwf, blwm, blws, cpsp, c2pc, c2sc, case, cpct, cv01, cv02, cv03, cv04, cv05, cv06, cv07, cv08, cv09, cv10, cv11, cv12, cv13, cv14, cv15, cv16, cv17, cv18, cv19, cv20, cv21, cv22, cv23, cv24, cv25, cv26, cv27, cv28, cv29, cv30, cv31, cv32, cv33, cv34, cv35, cv36, cv37, cv38, cv39, cv40, cv41, cv42, cv43, cv44, cv45, cv46, cv47, cv48, cv49, cv50, cv51, cv52, cv53, cv54, cv55, cv56, cv57, cv58, cv59, cv60, cv61, cv62, cv63, cv64, cv65, cv66, cv67, cv68, cv69, cv70, cv71, cv72, cv73, cv74, cv75, cv76, cv77, cv78, cv79, cv80, cv81, cv82, cv83, cv84, cv85, cv86, cv87, cv88, cv89, cv90, cv91, cv92, cv93, cv94, cv95, cv96, cv97, cv98, cv99, cjct, cfar, calt, clig, cswh, curs, dnom, dlig, dist, expt, falt, frac, fwid, ccmp, haln, half, hwid, hngl, hist, hlig, hkna, hojo, init, isol, ital, jp04, jp78, jp83, jp90, jalt, kern, lnum, ljmo, lfbd, ltra, ltrm, locl, mark, mset, mkmk, mgrk, medi, med2, nlck, nukt, numr, onum, opbd, size, ordn, ornm, pcap, pref, pres, psts, pstf, palt, vpal, pnum, pkna, pwid, qwid, rand, rkrf, rphf, rlig, rtbd, rtla, rtlm, ruby, sinf, smpl, zero, smcp, liga, salt, ss01, ss02, ss03, ss04, ss05, ss06, ss07, ss08, ss09, ss10, ss11, ss12, ss13, ss14, ss15, ss16, ss17, ss18, ss19, ss20, subs, sups, swsh, tnum, fina, fin2, fin3, twid, titl, trad, tnam, tjmo, unic, vatu, vert, vrt2, vkna, vkrn, vjmo}
% see http://en.wikipedia.org/wiki/OpenType_feature_tag_list#OpenType_Typographic_Features for their list
\ExplSyntaxOn
\newcommand\listfontfeatures{%
\renewcommand*{\do}[1]{
\fontspec_if_feature:nTF {##1}{##1,\ }{}
}
\expandafter\docsvlist\expandafter{\fontfeatures}
}
\ExplSyntaxOff
\begin{document}
\listfontfeatures
\end{document}
This should list all features in the current font, it can even be extended to list supported scripts and languages for every feature:
\documentclass{article}
\usepackage{fontspec}
\begin{document}
\newcommand\listfontfeatures{%
\directlua{
local id = font.current()
local font = fonts.identifiers[id]
local data = font.shared.otfdata
if data then
local features = data.luatex.features
for i,_ in next, features do
for f,_ in next, features[i] do
%print(f, table.serialize(features[i][f]))
tex.sprint(-1, f.." ")
end
end
end
}}
\fontspec{TeX Gyre Pagella} \listfontfeatures
\end{document}
On Linux it is simple and I suppose that Windows has a similiar command
voss@shania:~/.fonts/Junicode> otfinfo -f Junicode.ttf
c2sc Small Capitals From Capitals
calt Contextual Alternates
case Case-Sensitive Forms
ccmp Glyph Composition/Decomposition
dlig Discretionary Ligatures
fina Terminal Forms
frac Fractions
hist Historical Forms
hlig Historical Ligatures
kern Kerning
liga Standard Ligatures
mark Mark Positioning
mgrk Mathematical Greek
mkmk Mark to Mark Positioning
onum Oldstyle Figures
rtlm <unknown feature>
salt Stylistic Alternates
smcp Small Capitals
ss01 Stylistic Set 1
ss02 Stylistic Set 2
ss04 Stylistic Set 4
ss05 Stylistic Set 5
ss06 Stylistic Set 6
ss07 Stylistic Set 7
ss08 Stylistic Set 8
ss09 Stylistic Set 9
ss14 Stylistic Set 14
ss15 Stylistic Set 15
ss18 Stylistic Set 18
ss19 Stylistic Set 19
ss20 Stylistic Set 20
subs Subscript
sups Superscript
swsh Swash