[NTG-context] modify kern between two glyphs

mf massifr at fastwebnet.it
Tue Apr 5 15:29:07 CEST 2022


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


More information about the ntg-context mailing list