latin: highlight vowel columns
[sheet.git] / latin.plp
index ed6f65b6f1490dacf3fb51e8a6ce23ac0ec14708..897fe0a086e67ae51be5270ba4f0a02784917083 100644 (file)
--- a/latin.plp
+++ b/latin.plp
@@ -11,7 +11,7 @@ Html({
                secret cursive fraktur blind braille morse deaf asl hand
                barcode bar color semaphore flag
        '],
-       stylesheet => [qw'light dark red'],
+       stylesheet => [qw( light dark red mono )],
        data => ['writing-latn.inc.pl'],
 });
 
@@ -35,6 +35,9 @@ Html({
        #ita2 td {
                font-size: 50%;
        }
+       #cards td {
+               font-family: Symbola, "DejaVu Sans", serif, sans;
+       }
        #pigpen {
                stroke-linecap: square;
        }
@@ -49,6 +52,8 @@ Html({
 
        .sample {
                vertical-align: middle;
+               text-align: left;
+               padding: 1px 0.3em;
        }
        #old-roman-cursive .sample span {
                margin-right: -10px;
@@ -68,6 +73,8 @@ Html({
                margin-right: 1ex;
                white-space: nowrap;
        }
+       #sutton-asl .sample span,
+       #maritime-flags .sample span,
        #morse .sample span {
                margin-right: 0.5ex;
        }
@@ -113,23 +120,37 @@ if ($! or $@) {
        Alert("Table data not found", $@ || $!);
 }
 else {
+       my %VOWELCOLS = (map { ($_ => 1) } 0, 4, 8, 14, 20, 24);
        say '<table class="glyphs">';
        for my $row (pairs @table) {
                my ($title, $cells) = @{$row};
                printf '<tr id="%s">', (lc $title) =~ s/<[^>]+>//gr =~ s/\s+/-/gr;
                say '<th>', $title;
                my $colspan = 1;
+               my $col = 0;
                for (@{$cells}) {
+                       $col++;
                        if ($_ eq '>') {
                                $colspan++;
                                next;
                        }
+                       my @class;
+                       push @class ,'l0' if $VOWELCOLS{$col - $colspan};
+                       push @class, $_ ? 'ex' : 'u-invalid' if s/^-//;
+
                        print "\t<td";
+                       if ($col > 26) {
+                               # special character for sample generation
+                               print ' hidden';  # sample only
+                       }
+                       else {
+                               print ' title=', chr($col + ord('A') - $colspan);
+                       }
                        if ($colspan > 1) {
                                print " colspan=$colspan";
                                $colspan = 1;
                        }
-                       print ' class=', $_ ? 'ex' : 'u-invalid' if s/^-//;
+                       printf ' class="%s"', "@class" if @class;
                        print '>';
                        say;
                }