After some more investigation, this seems to be a problem with two distinct sources. The first is a bug in fontspec
, which causes the Graphite renderer to be inaccessible. This bug has been reported and fixed, and should show up in the next version of fontspec
. As a temporary fix, you can add the following code to your document (a full sample document will follow):
\ExplSyntaxOn
\keys_define:nn {fontspec-preparse} {
Renderer .choice_code:n = {
\fontspec_update_fontid:n {+rend:\l_keys_choice_tl}
\int_compare:nTF {\l_keys_choice_int <= 3} {
\tl_set:Nv \l_fontspec_renderer_tl
{ g_fontspec_renderer_tag_ \l_keys_choice_tl }
}{
\fontspec_warning:nx {only-luatex-feature} {Renderer=Full/Basic}
}
}
,
Renderer .generate_choices:n = {AAT,ICU,Graphite,Full,Basic}
}
\ExplSyntaxOff
This is only half the problem, however. The most recent version of the Gentium Plus font has changed from numeric font features to alphabetic font features, so what used to be
RawFeature={1054=1}
should now be
RawFeature={lopr=1}
However, XeTeX does not seem to deal correctly with these new font feature designations, and assumes they are numeric values. This can be seen by the output of the aat-info.tex
file adapted for Graphite:
Running this on version 1.504 of Gentium Plus yields the old numbering system, (image on the left) whereas running it on the latest version 1.510 of Gentium Plus reveals different numbers, instead of the expected alpha codes (image on the right):
The development version of XeTeX supports the alphanumeric IDs, but in the meantime, it's possible either to pass the "new" numeric values as RawFeatures
, or as Khaled Hosny points out in the comments, use the full long names of the features as described in the Gentium Plus documentation. Here is a complete document, showing that the relevant features are now accessible with the different numbers or with the long form names. Be careful to match the names exactly: the ID names are case sensitive, as are the "True" and "False" (which must appear as shown.)
% !TEX TS-program = XeLaTeX
\documentclass[12pt,letterpaper]{article}
\usepackage{fontspec}
\ExplSyntaxOn
\keys_define:nn {fontspec-preparse} {
Renderer .choice_code:n = {
\fontspec_update_fontid:n {+rend:\l_keys_choice_tl}
\int_compare:nTF {\l_keys_choice_int <= 3} {
\tl_set:Nv \l_fontspec_renderer_tl
{ g_fontspec_renderer_tag_ \l_keys_choice_tl }
}{
\fontspec_warning:nx {only-luatex-feature} {Renderer=Full/Basic}
}
}
,
Renderer .generate_choices:n = {AAT,ICU,Graphite,Full,Basic}
}
\ExplSyntaxOff
\begin{document}
\newfontfamily\lowfull[Renderer=Graphite,RawFeature={Low-profile diacritics=True}]{Gentium Plus}
\newfontfamily\lownumeric[Renderer=Graphite,RawFeature={1819242610=1}]{Gentium Plus}
\newfontfamily\high[Renderer=Graphite,RawFeature={Low-profile diacritics=False}]{Gentium Plus}
{\lowfull mā má mǎ mà \qquad (Low profile)}
{\lownumeric mā má mǎ mà \qquad (Low profile)}
{\high mā má mǎ mà \qquad (Regular profile)}
\end{document}
fontspec-xetex.sty
, but even fixing the bug doesn't seem to cause the font features to be activated, although I'm not sure why.lopr
(old 1054) andchtn
(old 1057). But this still doesn't work for me. I can't seem to get any of the features to work.fontspec
has been fixed, and will appear in the next update of the package. This will eliminate the "only-luatex" warning, and make the Graphite features theoretically available. But that doesn't solve the problem of why the features aren't recognized by the font.