Blame view
sources/3rdparty/phpdocx/pdf/lib/ttf2ufm/src/other/lst.pl
1.55 KB
|
31b7f2792
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
#!/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", "</i>", "<i>" ],
[ "Medium", "Bold", "</b>", "<b>" ],
[ "Variable", "Fixed", "</tt>", "<tt>" ],
);
sub printall
{
local $i, $j;
printf("<table border=\"0\" >
");
for($j=32; $j<256; $j+=$step) {
printf("<tr>
");
for $i ($j..$j+$step-1) {
$c=chr($i);
if($c eq "<") {
$c="<";
} elsif($c eq ">") {
$c=">";
}
printf("<td><font color=\"gray\">%03d</font></td><td>
", $i);
printf("<font color=\"white\">%s%s%s</font>
", $enmode, $c, $dismode);
printf("</td>
");
}
printf("</tr>
");
}
printf("</table><p>
");
}
printf("<HTML><HEAD></HEAD><BODY bgcolor=\"black\">
<font color=\"white\"><p>
");
for $mask (0.. (1<<@matrix)-1) {
#printf("<table><tr>");
$mode = $enmode = $dismode = "";
for $bit (0.. $#matrix) {
$val = ($mask >> $bit) & 1;
$mode = $matrix[$bit]->[$val] . "<br>" . $mode;
if( $val ) {
$enmode = $matrix[$bit]->[3] . $enmode;
$dismode = $dismode . $matrix[$bit]->[2];
}
#printf("=== %d %s %s %s
", $val, $mode, $enmode, $dismode);
}
#printf("%x %s %s %s
", $mask, $mode, $enmode, $dismode);
printf("<table border=\"0\"><tr><td>
");
&printall();
printf("</td><td valign=top><font size=\"+1\" color=\"yellow\"><b>
");
printf("%s
", $mode);
printf("</b></font></td></tr></table>
");
}
printf("</font></BODY></HTML>
");
|