![](https://secure.gravatar.com/avatar/57c17c28c61c03706efc4a9112fad09b.jpg?s=120&d=mm&r=g)
On Tue, 9 Oct 2018 23:36:32 +0200
Hans Hagen
Hi!
I have two questions regarding addressing glyphs in Lua:
1) How to address glyphs in slots as e.g. U+F0029? 2) How to address glyphs by name?
Use:
\startluacode fonts.handlers.otf.addfeature { name = "foo", type = "substitution", data = { [0xF0029] = 0xF0030 }, -- ← doesn't work } \stopluacode
On 10/9/2018 10:40 PM, Marco Patzer wrote: this is a mnwe .. make a mwe with at least a font
Sorry, here it is: \startluacode fonts.handlers.otf.addfeature { name = "phone", type = "substitution", data = { [0x260E] = 0xF003A }, -- doens't work } \stopluacode \definefontfeature [phone] [phone=yes] \definefallbackfamily [mainface] [serif] [MarVoSym] [range=0x260E, features=phone] \definefontfamily [mainface] [serif] [TeX Gyre Pagella] \setupbodyfont [mainface] \starttext substitution: \utfchar{"260E} %% black telephone \blank direct: \resolvedglyphdirect {name:marvosym}{n:Mobilefone} %% works \stoptext %% glyph name and slot taken from %% %% \usemodule [fnt-10] %% \starttext %% \ShowCompleteFont{name:marvosym}{10pt}{1} %% \stoptext
... anyway, glyph names should normally work (given that they are sane ones, because in context we strip some)
The question is how to input the name in the Lua code (here: “Mobilefone”). And it seems like substitutions don't work beyond 0xFFFF. Marco