On 4/28/2016 4:08 PM, jfbu wrote:
Hi,

how should I go at the Plain TeX level about implementing
the following glyph substitution which I formerly expressed
in a font feature file:

languagesystem DFLT dflt;
languagesystem latn dflt;

feature oneb {
  sub one by one.ss01;
} oneb;

The font is Vollkorn, a Plain LuaTeX file which worked in TL2015 would be

\input luaotfload.sty
\font\x="Vollkorn:script=latn;language=DFLT;+tlig;featurefile=vollkornlua.fff;+oneb;"
\x 123
\bye
% Local Variables:
% TeX-engine: luatex
% End:

The glyph for digit 1 is modified and picked in stylistic set 1. I don't want
to globally switch to that stylistic set, I am only interested into digit 1.

\starttext

\startluacode
    fonts.handlers.otf.addfeature {
        name = "oneb",
        type = "substitution",
        data = {
            ["one"] = "one.ss01",
        }
    }
\stopluacode

% context

\definefontfeature[default-oneb][default][oneb=yes]
\definefontfeature[default-ss01][default][ss01=yes]

\definedfont[name:vollkorn*default]      123\par
\definedfont[name:vollkorn*default-oneb] 123\par
\definedfont[name:vollkorn*default-ss01] 123\par

% non context

\font\foo=name:vollkorn:mode=node;kern=yes;liga=yes;          \foo 123\par
\font\foo=name:vollkorn:mode=node;kern=yes;liga=yes;oneb=yes; \foo 123\par

\stoptext

My use case is more with LuaLaTeX+fontspec, but if I am explained
a Plain LuaTeX approach I can at least forward to Will Robertson
who maintains fontspec and cross my fingers that it trickles down
back to me at some point via update of fontspec, or luatex, or luaotfload,
...

I don't know how they do it there but you need to define some lua (as above) and then enable that feature when defining the font.

Please CC to me as although I asked for (temporary) list inscription
I might not yet be registered.

I am aware of https://mailman.ntg.nl/pipermail/ntg-context/2016/083952.html
but can't work it out from there.

Jean-François


___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________



--

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to