There's a problem with oldstyle glyphs, because they have different codes inside a font.

I used fontforge to find the "four.oldstyle" glyph, whose code is 0xf734.
But then I discovered that the 'four.oldstyle' key works the same in the lua table.

This is the updated MWE, suitable for oldstyle glyphs too.

--------------------------------------------------
\mainlanguage[it]

% modified from http://www.pragma-ade.com/context/latest/cont-tst.zip
% file: doc/context/tests/mkiv/fonts/extensions-001.tex

\startluacode
    fonts.handlers.otf.addfeature {
        name = "ktest",
        type = "kern",
        data = {
            [ '’' ] = {
              [ '4' ] = -100,
              [ 0xf734 ] = -150, -- four.oldstyle code
-- [ 'four.oldstyle' ] = -150, -- this is the same as the previous line
            },
        }
    }
\stopluacode
\definefontfeature[ktest][ktest=yes]
\definefontfeature[onum][onum=yes]

\starttext
Default: «Questo è successo nel ’48».

Desired: «Questo è successo nel ’\kern-.1em 48».

Solved: \feature[+][ktest]«Questo è successo nel ’48».

Onum: \feature[+][onum]«Questo è successo nel ’48».

\stoptext
--------------------------------------------------

Massi
___________________________________________________________________________________
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