<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/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", "&lt;/i&gt;", "&lt;i&gt;" ],
	[ "Medium", "Bold", "&lt;/b&gt;", "&lt;b&gt;" ],
	[ "Variable", "Fixed", "&lt;/tt&gt;", "&lt;tt&gt;" ],
);

sub printall
{
	local $i, $j;

	printf("&lt;table border=\"0\" &gt;\n");
	for($j=32; $j&lt;256; $j+=$step) {
		printf("&lt;tr&gt;\n");
		for $i ($j..$j+$step-1) {
			$c=chr($i);
			if($c eq "&lt;") {
				$c="&amp;lt;";
			} elsif($c eq "&gt;") {
				$c="&amp;gt;";
			}
			printf("&lt;td&gt;&lt;font color=\"gray\"&gt;%03d&lt;/font&gt;&lt;/td&gt;&lt;td&gt;\n", $i);
			printf("&lt;font color=\"white\"&gt;%s%s%s&lt;/font&gt;\n", $enmode, $c, $dismode);
			printf("&lt;/td&gt;\n");
		}
		printf("&lt;/tr&gt;\n");
	}
	printf("&lt;/table&gt;&lt;p&gt;\n");
}

printf("&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY bgcolor=\"black\"&gt;\n&lt;font color=\"white\"&gt;&lt;p&gt;\n");

for $mask (0.. (1&lt;&lt;@matrix)-1) {
	#printf("&lt;table&gt;&lt;tr&gt;");
	$mode = $enmode = $dismode = "";
	for $bit (0.. $#matrix) {
		$val = ($mask &gt;&gt; $bit) &amp; 1;
		$mode = $matrix[$bit]-&gt;[$val] . "&lt;br&gt;" . $mode;
		if( $val ) {
			$enmode = $matrix[$bit]-&gt;[3] . $enmode;
			$dismode = $dismode . $matrix[$bit]-&gt;[2];
		}
		#printf("=== %d %s %s %s\n", $val, $mode, $enmode, $dismode);
	}
	#printf("%x %s %s %s\n", $mask, $mode, $enmode, $dismode);
	printf("&lt;table border=\"0\"&gt;&lt;tr&gt;&lt;td&gt;\n");
	&amp;printall();
	printf("&lt;/td&gt;&lt;td valign=top&gt;&lt;font size=\"+1\" color=\"yellow\"&gt;&lt;b&gt;\n");
	printf("%s\n", $mode);
	printf("&lt;/b&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;\n");
}

printf("&lt;/font&gt;&lt;/BODY&gt;&lt;/HTML&gt;\n");
</pre></body></html>