#!/usr/bin/perl # # script to create HTML file with character table # in plain, italic, bold, bold-italic # # see COPYRIGHT # # width of tables $step=16; # commands to enable and disable the font modes # (the fastest changing is first) @matrix = ( [ "Roman", "Italic", "", "" ], [ "Medium", "Bold", "", "" ], [ "Variable", "Fixed", "", "" ], ); sub printall { local $i, $j; printf("\n"); for($j=32; $j<256; $j+=$step) { printf("\n"); for $i ($j..$j+$step-1) { $c=chr($i); if($c eq "<") { $c="<"; } elsif($c eq ">") { $c=">"; } printf("\n"); } printf("\n"); } printf("
%03d\n", $i); printf("%s%s%s\n", $enmode, $c, $dismode); printf("

\n"); } printf("\n

\n"); for $mask (0.. (1<<@matrix)-1) { #printf(""); $mode = $enmode = $dismode = ""; for $bit (0.. $#matrix) { $val = ($mask >> $bit) & 1; $mode = $matrix[$bit]->[$val] . "
" . $mode; if( $val ) { $enmode = $matrix[$bit]->[3] . $enmode; $dismode = $dismode . $matrix[$bit]->[2]; } #printf("=== %d %s %s %s\n", $val, $mode, $enmode, $dismode); } #printf("%x %s %s %s\n", $mask, $mode, $enmode, $dismode); printf("
\n"); &printall(); printf("\n"); printf("%s\n", $mode); printf("
\n"); } printf("
\n");