Am 15.08.2025 um 21:02 schrieb Rik Kabel:

On 2025-08-15 14:49, Michael Guravage wrote:
Hi,

I have a document that uses the doves type font in its two variants, one for titles, and one for text. I would like to replace several character combinations with ligatures. The same letter combinations have their own Unicode ligatures in each font variant.

With \replaceword I could replace characters with characters, but I could not replace characters with a \utfchar.  In this MWE I tried to enable-disableinputtranslation in \setuphead but to no effect.

What I would like to do is to define two sets of replacements, i.e. translations, one for each font variant, and apply them to titles and running text respectively. Any suggestions?

--
Michael

PS: I attached a PDF showing the ligatures I'm using.


\usemodule[translate]
\switchtobodyfont[pagella]

\translateinput[AE][\AE] % For titles
\translateinput[ae][\ae] % For text

\setuphead[title][before=\enableinputtranslation, after=\disableinputtranslation]

\starttext

  \title{Aeneid}
    \enableinputtranslation
    aeneid
    \disableinputtranslation

\stoptext

Does the font support an hlig feature? That typically brings in such ligatures as ct and st.

More can be added.

\startluacode

fonts.handlers.otf.addfeature {
    name    = "michael",
    type    = "ligature",
--~ nocheck = true,
    data    = {
        [0x00C6] = { 0x0041, 0x0065 }, -- A + e -> Æ
        [0x00E6] = { 0x0061, 0x0065 }, -- a + e -> æ
    }
}

\stopluacode

\definefontfeature [michael] [michael=yes]

\switchtobodyfont[pagella]

\starttext

Aeneid aeneid

\feature[+][michael]
Aeneid aeneid

\stoptext

Wolfgang

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to