ShowFont

<..show font..>
 \:CheckOption{ShowFont}     \if:Option
    <.HObey for ShowFont.>
    \def\ShowFont#1{{\ifx \sevenrm\Undef \let\sevenrm=\rm\fi
       \Picture*{ \a:@Picture{ShowFont}}\begingroup   \HObey
          % Variants of Knuth’s macros
          \postdisplaypenalty=-10000 \global\tmp:cnt=0 #1
          \tabskip0.06\hsize  <.definitions for ShowFont.>%
          \halign to\hsize\bgroup  <.halign for ShowFont.>%
          \egroup
       \EndHObey  \endgroup  \EndPicture}}
    <.showfont + unicode.>
 \fi
 -_-_-

<..showfont + unicode..>
 \csname newread\endcsname\in:strm
 \def\Uii:{\expandafter\Uii:o\in:buf xxxxxxxxx;}
 \def\Uii:o#1x#2#3#4xxxx;{#2#3}
 \catcode‘\@=6
 \catcode‘\#=12
 \def\Uiv:{\expandafter\Uiv:o\in:buf ’&#xxxxxxxxx;}
 \def\Uiv:o@1’&#x@2@3@4@5@6xxxx;{@2@3@4@5}
 \catcode‘\@=11
 \catcode‘\#=6
 
 \def\:gobbleM#1->{}
 \def\Uni:symbols{\ifnum \char:n<256
   \HCode{\Hnewline<tr><td>}\char:n{}\HCode{</td>}
   \bgroup \catcode‘\#=12 \catcode‘\\=12
       \catcode‘\%=12 \catcode‘\{=12 \catcode‘\}=12
       \catcode‘\_=12 \catcode‘\^=12 \catcode‘\~=12
 %     \ifeof\in:strm \else
         \read\in:strm to\in:buf
         \ifeof\in:strm  \gHAssign\char:n=256 \else
            \def\:temp{\par}
            \ifx\in:buf\:temp\else
               \edef\:tempa{\Uiv:}\def\:temp{xxxx}
               \ifx \:temp\:tempa \let\:tempa=\:gobble
               \else              \let\:tempa=\empty\fi
              \HCode{<td>}
               \:tempa{\Picture{http://charts.unicode.org/Unicode.charts%
                                     /Small.Glyphs/\Uii:/U\Uiv:.gif}}
                     \HCode{</td><td>}
               \:tempa{\Picture{http://www.w3.org/TR/PR-math/chap6/glyphs/%
                                     \Uii:/U\Uiv:.gif}}
               \HCode{</td><td>}{\font:nm\char\char:n}
               \HCode{</td><td>}{\font:nm \Picture+{}\char
                                  \char:n\EndPicture}
               \HCode{</td><td class="htf">}\:tempa\Uiv:
                  \:tempa\:gobble{\tt\expandafter\:gobbleM\meaning\in:buf}
               \HCode{</td>}
      \fi\fi%\fi
    \egroup
    \HCode{</tr>}
    \HAdvance\char:n by 1 \expandafter\Uni:symbols\fi}
 \def\ShowFontU#1#2{%
    \font\font:nm=#2
    \openin\in:strm=#1\relax
    \ifeof\in:strm  \immediate\write16{.........can’t  open #1}\else
      \read\in:strm to\in:buf\relax
      \HAssign\char:n=0 \HCode{<table class="unicodes" border="1"><tr>
         <td>char<br\xml:empty>number</td>
         <td>unicode<br\xml:empty>org</td>
         <td>ams<br\xml:empty>org</td>
         <td>htf +<br\xml:empty>browser</td>
         <td>actual<br\xml:empty>(la)tex<br\xml:empty>symbol</td>
         <td>htf<br\xml:empty>entry</td>
         </tr>}
         \Uni:symbols
      \HCode{</table>}
      \Css{.unicodes{border:solid 1px;}}
      \Css{.unicodes td{text-align:center;}}
      \Css{.unicodes td.htf{text-align:left;}}
    \fi
    \closein\in:strm}
 -_-_-

<..definitions for ShowFont..>
 \def\:{\setbox0=\hbox{\char\tmp:cnt}%
   \ifdim\ht0>7.5pt\reposition
   \else\ifdim\dp0>2.5pt\reposition\fi\fi
   \box0\global\advance\tmp:cnt by1 }%
 -_-_-

<..definitions for ShowFont..>+
 \def\cr:line{\cr  \noalign{\nointerlineskip}
   \multispan{17}\hrulefill&
   \cr \noalign{\nointerlineskip}}%
 \def\reposition{\setbox0=\hbox{$\vcenter{\kern2pt\box0\kern2pt}$}}%
 \def\chartLine##1{\hbox to 13.8pt{\hfil\sevenrm ##1 }}%
 -_-_-

<..definitions for ShowFont..>+
 \HAssign\:tempc=0
 \def\:tempd{\chartLine\:tempc
    \vrule   &\:&&\:&&\:&&\:&&\:&&\:&&\:&&\:&\cr:line
    \noalign{\nointerlineskip}%
    \gHAdvance\:tempc by 8 \ifnum \:tempc<256  \expandafter\:tempd \fi}%
 -_-_-

<..halign for ShowFont..>
 <.chartstrut.>##\tabskip\z@ plus10pt& &\hfil##\hfil&\vrule##\cr
 \lower6.5pt\null
 \chartLine{}\vrule   &\sevenrm 0&&\sevenrm 1&&\sevenrm
    2&&\sevenrm 3&&\sevenrm 4&&\sevenrm 5&&\sevenrm 6&&\sevenrm 7&\cr:line
 \:tempd \cr
 -_-_-

<..chartstrut..>
 \lower4.5pt\vbox to14pt{}%
 -_-_-

<..HObey for ShowFont..>
 \def\HObey{\SaveEverypar \par \ht:everypar{}%
    {\parindent=\z@ \leftskip=\z@ \leavevmode
     \HCode{ <table \Hnewline \:zbsp{HObey}
           width="100\%"><tr class="HObey"><td\Hnewline
       class="HObey"><pre class="HObey">}\par}}
 \def\EndHObey{\HCode{</pre>}\IgnoreIndent
     \end:TTT \RecallEverypar}
 -_-_-