On 12/11/2018 07:06, Hans Hagen wrote:
On 12/11/2018 11:34 AM, mf wrote:

But i should consider all the text parts with a modified kerning and disable kerning around character sequences like "ff", "ffi", "fl" and so on. Luckily, the XHTML markup "knows" where the kerning is modified:

<p class="wide">A paragraph with a modified kerning</p>

should become

<p class="wide">A paragraph with a modi<dk>fi</dk>ed kerning</p>

Where <dk>...</dk> (dk=Disable Kerning) are tags to be inserted automatically before feeding the XHTML into ConTeXt.
I'm not very happy or proud about it, but it can be done.
Do you think it can be better done inside ConTeXt?

I nearly managed to do it in ConTeXt, but I can't create the "<dk>" elements right (the "new_dk_element" function is wrong):

did you play with

\definefontfeature[whatever][keepligatures=auto]

\definecharacterkerning [extrakerning] [factor=0.125,features=whatever]

\starttext
    \setcharacterkerning[extrakerning]
    effe fietsen
\stoptext

Nice! It recognizes the difference between ccmp and liga, so now we have (almost perfect) support for Sperrdruck! There is a ZWNJ in the following example (between t and z inZeitzone) that gets expanded, leaving an enlarged gap.

\mainlanguage  [deo]
\definefontfeature[frak][ccmp=yes,liga=yes]
\definefont [FrakXIX] [UnifrakturMaguntia19.ttf*frak]
\definefontfeature[whatever][keepligatures=auto]
\definecharacterkerning [extrakerning] [factor=0.25,features=whatever]
\define\Test{{\FrakXIX ſitzen/beſchütze/Zeit‌zone}}
\starttext
    \tex{setcharacterkerning}\par
    \Test\par
    {\setcharacterkerning[extrakerning]\Test}\par
    \Test\par

    \blank

    \tex{kerncharacters}\par
    \Test\par
    {\kerncharacters[.25]{\Test}\par
    \Test\par

\stoptext

--
Rik