% % \defineactivecharacter ʿ {\high{c}}
% % \defineactivecharacter ʾ {\kern.07 em \high{\rotate[rotation=180,location=high]{c}}}

% % or better

% % \definecharacter ʿ {\high{c}}
% % \definecharacter ʾ {\kern.07 em \high{\rotate[rotation=180,location=high]{c}}}

\startluacode

-- ʿ ringhalfleft
local function ringhalfleft (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, 0 },
                    { "left", -0.5*(data2.width  or 0) + 0.5*(data2.width  or 0)},
                    -- { "down", 0.2*(data2.height or 0) +   (data2.height or 0) },
                    { "up", 0.0*(data2.height or 0) +        (data2.height or 0) },
                    { "slot", 0, 0x063, },
                    { "squeeze", 0.75*(data2.height or 0) },
                    { "extend",  0.75*(data2.width or 0) },
                },
            }
        end
--    end
end

-- ʾ ringhalfright
local function ringhalfright (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, 0 },
                    { "left", -0.35*(data2.width  or 0) + 0.5*(data2.width  or 0)},
                    { "down", 0.0*(data2.height or 0) +       (data2.height or 0) },
                    -- { "up", 0.0*(data2.height or 0) +   (data2.height or 0) },
                    { "slot", 0, 0x063, },
                    { "squeeze", 0.75*(data2.height or 0) },
                    { "extend",  0.75*(data2.width or 0) },
                },
            }
        end
--    end
end

local function initialize(tfmdata,value)
    if value then        
        -- Hdotbelow(tfmdata.characters,0x02BF,0x063,0) -- 
        ringhalfleft (tfmdata.characters,0x02BF,0x063,0x063) 
        ringhalfright(tfmdata.characters,0x02BE,0x063,0x063) 
           -- (i.e., tfmdata.characters,target,base,accent)
        -- hdotbelow(tfmdata.characters,0x1E25,0x068,0x2D9)
    end
end

local function scale (ringhalfleft,ringhalfright)       
    for v in next, ringhalfleft do
        v.height = 0.75 * (v.height or 0)
        v.width  = 0.75 * (v.width or 0)
        v.depth  = 0.75 * (v.depth  or 0)
    end      
    for v in next, ringhalfright do
        v.height = 0.75 * (v.height or 0)
        v.width  = 0.75 * (v.width or 0)
        v.depth  = 0.75 * (v.depth  or 0)
    end
end

local specification = {
    name        = "glottalstops",
    description = "glottalstops",
    manipulators = {
        base = initialize,
        node = initialize,
    }
}

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

\definefontfeature[glottals][default][glottalstops=yes]

% \definedfont[Serif*default @ 11pt]

\showglyphs

\noheaderandfooterlines

\definecolor [transparentgreen]  [g=1,t=.7,a=1]
\definecolor [transparentred]    [r=1,t=.7,a=1]
\definecolor [transparentyellow] [y=1,t=.7,a=1]

\switchtobodyfont[schola,12pt] 
\setupwhitespace[big]

\setuplayout[lines=40]

\starttext

\startTEXpage[offset=10em,width=10in]
\definedfont[MinionPro-Regular.otf*glottals @ 112pt]

1.
cʿc \ AʿA

\blank[7*big]

2.
cʾc \ AʾA

\blank[7*big]

3.
c{\definedfont[MinionPro-Regular.otf*glottals @ 84pt]ʾ}c \ 
A{\definedfont[MinionPro-Regular.otf*glottals @ 84pt]ʾ}A

\blank[7*big]

4.
c{\definedfont[MinionPro-Regular.otf*glottals @ 84pt]\rotate[rotation=180,location=high]{ʾ}}c \
A{\definedfont[MinionPro-Regular.otf*glottals @ 84pt]\rotate[rotation=180,location=high]{ʾ}}A
\stopTEXpage

\stoptext 