# Accessing user-selectable features in GentiumPlus in XeLaTeX/LuaLaTeX

Specifically, the combination of f plus î in the italic ends up with the upper curl of the f smashed into the peak of the circumflex (other fonts have the same problem, but the result is even uglier). I would like to improve the situation by using the GentiumPlus user-selectable feature "Low-profile diacritics" (feature ID code lopr in the latest release (version 1.510), 1054 in previous releases --per the newest version of gentiumPlus-features.pdf, apparently only available online in the font package download-- with values 1=true and 0=false, as corrected in the SIL tech notes for this font).

This would produce a squatter circumflex that should miss the collision with f.

Other notes on the SIL page regarding features new with GentiumPlus seems to indicate that this feature is available both as Graphite and OpenType features, and since I would like to be able to do this in both LuaLaTeX and XeLaTeX, I would like to use OpenType, since Graphite is not supported in LaTeX (except possibly via the Fontspec back door of including Graphite instructions in a Font Feature File, as mentioned in a post here, but not in the Fontspec manual, where it is supposed that it will only be used for OpenType features).

Now if I am reading the Fontspec documentation correctly, and if I am correct that this exists as an OpenType feature, I can add this feature with \addICUfeature (in XeLaTeX) or \addopentypefeature (in LuaLaTeX). The Fonspec manual (page 43) gives the syntax (using the XeLaTeX version of the command name) as

\newICUfeature{<feature>}{<option>}{<feature tag>}

with an example (using the LuaLaTeX version)

\newopentypefeature{Style}{NoLocalForms}{-locl}

Comparing with the syntax and use of \addAATfeature on the same page, it seems clear that <feature> and <option> are the names that would go on the righthand and lefthand sides of the = in an argument to e.g. \addfontfeatures, while <feature tag> would, in this case, be +lopr, assuming a prefixed plus/minus sign works as an on or off switch.

BUT I seem not to have done this correctly. I had guessed that <feature> and <option> were simply user-created discriptive names, as with \newcommand. What I used was

\newICUfeature{GentiumPlusFeatures}{LowProfile}{+lopr}

in the preamble, and for an activation command (which I grouped with just the combining circumflex character, immediately following the dotless i) I used

fı{\addfontfeature{GentiumPlusFeatures=LowProfile}\char"0302}

My document compiled successfully without stopping, but the result was visually identical to the combined characters without the command, and with the original i-circumflex character. The log shows a fontspec warning "icu-feature-not-exist-in-font" with an explanation

OpenType feature 'GentiumPlusFeatures=LowProfile' (+lopr) not available for
font 'GentiumPlus-R.ttf' with script 'Latin' and language 'Default'.


Finally, I tried adding Renderer=ICU to the \addfontfeatures argument, as suggested in a possibly-relevant post here but the result was unchanged. (I am guessing Renderer=ICU would still be necessary once corrections to the rest are made, but also don't know that Renderer=ICU would work in LuaLaTeX).

UPDATE: I have tried substituting the name Low-profile diacritics in the <feature> field and True for <option>, so that by using these, along with +lopr (plus trial variants -lopr and lopr), I am now using only the exact language of the font documentation, but still no success.

I have gone as far as I can with this on my own, and am hoping someone with real expertise will be able to look it over and fix it in a few seconds. It is a small thing, I know... much like a grape seed in one's appendix.

-
As it appears this is a "can't get there from here" scenario for LuaLaTeX, I have changed tactics and modified the font, which was easily done with SIL's online version of their TypeTuner tool. Just a few clicks and I had a new version of the font with the low-profile diacritics set as default, usable as such in any application. –  Stonefeather Grubbs Oct 30 '13 at 22:51

First, there is a misconception here, LaTeX as a macro package neither supports OpenType nor Graphite nor it is its duty, those are to be supported by the underlying engine. The LaTeX package for using modern fonts and features, fontspec, do support Graphite but it is a rather rudimentary support. Font feature files is a LuaTeX-specific feature and are OpenType-only, they has nothing to do with LaTeX or Graphite.

The features you want are Graphite features, so they won’t work with LuaTeX.

You cannot use \newICUfeature either, as it will force check for OpenType features, and since fontspec does not provide a \newgraphitefeature command, you can use the generic \newfontfeature that accepts arbitrary input:

\documentclass{article}
\usepackage{fontspec}

\newfontfeature{LowDiacritics}{Low-profile diacritics=True}
\newfontfeature{HighDiacritics}{Low-profile diacritics=False}
\begin{document}
\fontspec[Renderer=Graphite,LowDiacritics]{Gentium Plus}
èáä fî
\fontspec[Renderer=Graphite,HighDiacritics]{Gentium Plus}
èáä fî
\end{document}


Here I used the descriptive feature names, since all versions of XeTeX support them. Recent versions can use the numeric ID or the 4-letter tags.

-