%D \module
%D   [      file=s-fonts-missing,
%D        version=2011.10.30,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Some Missing Character Info,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\startluacode

    moduledata.fonts                 = moduledata.fonts                 or { }
    moduledata.fonts.tracers         = moduledata.fonts.tracers         or { }
    moduledata.fonts.tracers.missing = moduledata.fonts.tracers.missing or { }

    function moduledata.fonts.tracers.missing.legend()
        local c = fonts.hashes.identifiers[font.current()]
        local p = c.properties.privates
        if p then
            context.starttabulate { "|Tl|c|c|" }
            context.NC()
            context.bold("name")
            context.NC()
            context.bold("character")
            context.NC()
            context.bold("node")
            context.NC()
            context.NR()
            for k, v in table.sortedhash(p) do
                context.NC()
                context(k)
                context.NC()
                context.dontleavehmode()
                context.char(v)
                context.NC()
                context.dontleavehmode()
                commands.getprivatechar(k)
                context.NC()
                context.NR()
            end
            context.stoptabulate()
        end
    end

\stopluacode

\def\ModuleFontsTracersMissingLegend
  {\ctxlua{moduledata.fonts.tracers.missing.legend()}}

\continueifinputfile{s-fonts-missing.mkiv}

\enabletrackers[fonts.missing=replace] % the sooner, the more efficient

% \usemodule[art-01]

% \definefontfeature[default][default][missing=yes] % automatically when enabled

\starttext

    \ModuleFontsTracersMissingLegend

    ½ ⅓ ¼ ⅕ ⅙ ⅛

    \startluacode
        for i=1,1000 do
            local c = characters.data[i]
            if c then
                context.char(c.unicodeslot)
                context.space()
            end
        end
    \stopluacode

\stoptext

