[NTG-context] [ANN] Macros for displaying unicode vectors

Nikolai Weibull mailing-lists.context-users at rawuncut.elitemail.org
Thu Jun 9 19:48:42 CEST 2005


Here's a nice way to display the contents of a unicode vector, as
rendered by ConTeXt:

\def\unicodevectortablerow#1#2%
  {\NC
   \ss\ix\uchexnumber{\numexpr(#2-1)\relax}
   \VL
   \dorecurse{16}
     {\newcount\u \u=\numexpr(#1*256+(#2-1)+(\recurselevel-1)*16)\relax
      \utfunihash\u \VL}%
   \AR}
% TODO: *{17}{c|} in format doesn't work
\def\unicodevectortable#1%
  {\bgroup
   \Expand
   \placetable
     []
     []
     {Unicode Vector #1}
     \starttable[|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|]
     \NC\VL[3]
       \dorecurse{15}{\ss\ix\uchexnumbers{#1}\uchexnumber{\recurselevel}\NC}
       \ss\ix\uchexnumbers{#1}F\VL[3]\AR
     \HL[3]
     \dorecurse{15}
       {\glet\row\recurselevel
        \unicodevectortablerow{#1}{\row}
        \HL}
     \unicodevectortablerow{#1}{16}
     \HL[3]
     \stoptable
   \egroup}

And then

\starttext
\unicodevectortable{34}
\stoptext

The \glet\row\recurselevel is terrible, but I couldn't come up with a
better solution.  Also, even though thrd-tab.tex suggests that one may
write *{N}{FORMAT} in the template, that doesn't seem to work.
Suggestions?,
        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


More information about the ntg-context mailing list