I'm trying to access a glyph, but it's only mentioned in the "Basic Latin and Latin 1" set for a font. The glyph has no name or unicode ID, but it does have a glyph ID or GID. fontspec
doesn't mention possibilities for using this glyph. Neither does Adobe in the adobe feature file syntax: http://www.adobe.com/devnet/opentype/afdko/topic_feature_file_syntax.html#2.f
I'd still like to be able to access a glyph through its ID, since it's the only way I can access it (I think).
My specific case requires to access the glyph ID 554 from Stevens Titling Pro Sable Brush. I will only post this font if it's strictly necessary, since I don't like to distribute these fonts to the wide world.
I posted an MWE containing another (free) font. This is not the font I intend to use, but perhaps a starting point to try and access glyphs manually.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{EB Garamond}
\parindent=0pt
\begin{document}
Some text int EB Garamond. How can I access glyph 123 now?
\end{document}
Best Answer
The method for accessing a specific glyph using
fontspec
depends on the engine used.With
XeTeX
, an implementation is\XeTeXglyph554\relax
(Thanks egreg).An example document, using the inaccessible glyph with ID 554 from Stevens Titling Pro, Sable Brush, is shown below:
In
LuaTeX
, there appears to be no pre-defined high level command to access a glyph by its (OpenType) glyph number. However, one can create a Lua-based function to provide this access method.Some example implementation for accessing the same glyph: