[Tex/LaTex] Using Graphite fonts on XeLaTeX

fontsfontspecxetex

I want to use a Graphite font as the main font in a XeLaTeX document, but fontspec doesn't support Graphite fonts yet. Currently I'm using XeTeX's native way to change fonts, but that's cumbersome, as I have to define one font for each size-family-series combination I want to use.
Is there some hack to make fontspec work with Graphite fonts or perhaps some other way to change the whole default family so that stuff like \Large and \emph just works™?

Best Answer

You are correct that fontspec doesn't have proper support for Graphite fonts yet. However, I did once add the option to select the Graphite font renderer. Here's an example:

\documentclass{article}
\usepackage{fontspec}
\begin{document}
\fontspec[
    Renderer=Graphite,
    RawFeature={
      Special=Hide tone contour staves
    }
  ]{Charis SIL}
foo
\end{document}

I've hardly worked at all with any Graphite fonts, however, and I don't know if this is sufficient (it's certainly not optimal in terms of user interface).

Update: here's an actual example that shows something useful:

\fontspec[Renderer=Graphite,RawFeature={1024=0}]{Charis SIL} Ŋ
\fontspec[Renderer=Graphite,RawFeature={1024=1}]{Charis SIL} Ŋ
\fontspec[Renderer=Graphite,RawFeature={Uppercase Eng alternates=Large eng on baseline}]{Charis SIL} Ŋ
\fontspec[Renderer=Graphite,RawFeature={1024=2}]{Charis SIL} Ŋ
\fontspec[Renderer=Graphite,RawFeature={1024=3}]{Charis SIL} Ŋ

Lines 2 and 3 are equivalent. To get a listing of what font features are available, you can use the ‘aat-info.tex’ file and use the following for the first two code lines:

\def\myfontname{Charis SIL/GR}
\font\testfont="\myfontname" at 10pt
Related Question