Compiling this file returns files ntg46-mpgraph.log ntg46-mpgraph.tex ntg46-mpgraph.mpy ntg46-mpgraph.pdf ntg46-mpgraph.tuc
% macros=mkvi
\setuppagenumbering[location=footer]
\startusableMPgraphic{NumberHead}
picture r ;
r := image ( graphictext
"\bf\namedheadnumber{chapter}"
scaled 5pt
withfillcolor \MPcolor{lightgray}
withpen pencircle scaled 1pt ; ) ;
draw r ;
\stopusableMPgraphic
\def\processMPheadnumber#1%
{\useMPgraphic{NumberHead}}
\setuphead
[chapter]
[command=\HeadTitle,
headstyle=\ss,
numbercommand=\processMPheadnumber]
\unexpanded\def\HeadTitle#1#2%
{\framed
[frame=off,
bottomframe=on,
width=broad,
align={broad,nothyphenated,left}]
{#1\blank[nowhite]#2}}
\starttext
\startchapter
[title={Fist chapter}]
\input knuth
\stopchapter
\stoptext