On 8/1/2023 4:18 PM, Hamid,Idris wrote:
Dear gang,

It appears that \defineactivecharacter does not work in lmtx:

\starttext
\defineactivecharacter Ḥ  {\d{H}}
\defineactivecharacter ḥ  {\d{h}}
\defineactivecharacter Ṣ  {\d{S}}
\defineactivecharacter ṣ  {\d{s}}
\stoptext

This should not produce any typeset output but in lmtx it does.

Background: The following characters are essential for Arabic transliteration 
(assuming your email client has the chars):

Ṯṯ Ḥḥ Ḫḫ Ḏḏ Šš Ṣṣ Ḍḍ Ṭṭ Ẓẓ Ġġ Āā Īī Ūū ʿ ʾ
I'd use a different font but as you want to go cheap ... attached gets you going and will give you a few hours playing around with fonts.

Using a scaled c for some c like shape is kind of bad anyway, kind of using a comma for an ogonek.

Hans


-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
\startluacode

local function botthing(characters,target,base,accent)
--    if not characters[target] then
        local data1 = characters[base]
        local data2 = characters[accent]
        if data1 and data2 then
            characters[target] = { -- "Ḥ"
                height   = data1.height,
                depth    = (data1.depth or 0) + 0.5*(data2.height or 0),
                width    = data1.width,
                unicode  = target,
                commands = {
                    { "slot", 0, 0x048 },
                    { "left", 0.5*(data2.width  or 0) + 0.5*(data1.width  or 
0)},
                    { "down", 0.2*(data2.height or 0) +     (data1.height or 0) 
},
                    { "slot", 0, 0x2D9, },
                },
            }
        end
--    end
end

local function topthing(characters,target,base,accent)
--    if not characters[target] then
        local data1 = characters[base]
        local data2 = characters[accent]
        if data1 and data2 then
            characters[target] = { -- "Ḥ"
                height   = (data1.height or 0) + 0.5*(data2.height or 0),
                depth    = data1.depth,
                width    = data1.width,
                unicode  = target,
                commands = {
                    { "slot", 0, 0x048 },
                    { "left", 0.5*(data2.width  or 0) + 0.5*(data1.width  or 0) 
},
                    { "up",   0.5*(data2.height or 0) },
                    { "slot", 0, 0x2D9, },
                },
            }
        end
--    end
end

local function initialize(tfmdata,value)
    if value then
        botthing(tfmdata.characters,0x1E24,0x048,0x2D9)
--        topthing(tfmdata.characters,0x1E24,0x048,0x2D9)
    end
end
local specification = {
    name        = "idrify",
    description = "idrify",
    manipulators = {
        base = initialize,
        node = initialize,
    }
}

fonts.handlers.otf.features.register(specification)
\stopluacode

\definefontfeature[default][default][idrify=yes]

\definedfont[Serif*default @ 11pt]

\showglyphs

Ḥ

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

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

Reply via email to