There is no direct equivalent of the XeTeXglyph
macro in LuaTeX that I am aware of. But you can use the \symbol
macro provided you know how the glyphs are numbered in the font. I used the ConTeXt code from this answer to generate the code points for the glyphs.
For normal use it would probably make sense to make individual macros for the symbols you want. The \glyphnum
macro used in this example uses the numbers shown in the documentation you linked to and then generates the appropriate codepoint in the font. Since the numbers are large integers I've used the bigintcalc
package to do the addition. I've shown how you can make a macro to use the glyph numbers in the documentation in your document, or you could further wrap that macro into your own individual macros for the glyphs you need.
\documentclass{article}
\usepackage{fontspec}
\usepackage[margin=1in]{geometry}
\usepackage{bigintcalc}
\usepackage{multicol}
\usepackage{pgffor}
\newfontfamily\QPC{KFGQPC Arabic Symbols 01}
\newcommand\glyphnum[1]{\bigintcalcAdd{#1}{983040}}
\newcommand\KFGQPCglyph[1]{\QPC\symbol{\glyphnum{#1}}}
\begin{document}
\begin{multicols}{3}
\foreach\x in {2,...,97}{
\parbox{2em}{\hfill\x~=} \glyphnum{\x}~= {\QPC \symbol{\glyphnum{\x}}}\par
}
\end{multicols}
Example of use:
\KFGQPCglyph{12}
\KFGQPCglyph{42}
\KFGQPCglyph{70}
\end{document}
An alternative way to find the code points
A simpler way to find the code points (as pointed out in the comments) is to look at the .lua
code associated with the font. This can be found inside the local cache folder for LuaTeX. In the log file for a document that loads the font, you will find a line similar to the following (the exact path will be dependent on your OS):
luaotfload | cache : Lookup cache loaded from /Users/alan/Library/texlive
/2017/texmf-var/luatex-cache/generic/names/luaotfload-lookup-cache.luc.(load
luc: /Users/alan/Library/texlive/2017/texmf-var/luatex-cache/generic
/font/otl/symbols1-ver02.luc)
The last part of this tells you the name of the .luc
file for the font, in this case symbols1-ver02.luc
. Inside the same folder will be a corresponding .lua
file symbols1-ver02.lua
.
If you look inside this file you'll see a bunch of lines like the following:
["descriptions"]={
[983040]={
["boundingbox"]=1,
["index"]=0,
["name"]="notdef",
["unicode"]=983040,
["width"]=1024,
},
[983041]={
["boundingbox"]=1,
["index"]=1,
["unicode"]=61472,
["width"]=600,
},
...
[983137]={
["boundingbox"]={ 98, -289, 2388, 1364 },
["index"]=97,
["unicode"]=61572,
["width"]=2498,
},
}
Notice that the first number in the [descriptions]
code block corresponds to the starting number in my \glyphnum
macro, and the final number is that number plus 97 (the number of glyphs in the documentation.)
