On Tue, 9 Oct 2018 23:36:32 +0200
Hans Hagen <j.ha...@xs4all.nl> wrote:

> On 10/9/2018 10:40 PM, Marco Patzer wrote:
> > 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  
> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to