From dae26177176ef594f0f97da2fcd1fd69df745bb2 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 10 Apr 2012 01:40:08 +0200 Subject: [PATCH] font: list select or selected rows --- font.plp | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/font.plp b/font.plp index 11eba2f..644e1d0 100644 --- a/font.plp +++ b/font.plp @@ -37,6 +37,39 @@ my @fontlist = map { @{ $oslist{$_} } } @ossel; my $cover = do 'unicode-cover.inc.pl' or die $@ || $!; +my @rows = ( + 'block/Latin-1 Supplement', + 'block/Latin Extended-A', + 'block/Latin Extended Additional', + 'block/Latin Extended-B', + 'script/Latin', + 'script/Greek', + 'script/Cyrillic', + 'script/Arabic', + 'script/Hebrew', + 'script/Devanagari', + 'script/Thai', + 'script/Hangul', + 'table/japanese', + 'script/Han', + 'table/ipa', + 'table/punctuation', + 'block/Dingbats', + 'table/symbols', + 'table/math', + 'table/arrows/single', + 'table/lines/single', + 'table/block', + 'table/lines', +); + +for my $group ($ENV{PATH_INFO} || ()) { + $group =~ s{^/}{}; + my $grouprows = $cover->{$group} + or die "Unknown character category $_\n"; + @rows = map { "$group/$_" } sort keys %{$grouprows}; +} + # output character list print ''; @@ -52,10 +85,10 @@ print ''; -for my $name (sort keys %{ $cover->{$group} }) { +for (@rows) { + my ($group, $name) = split m{/}, $_, 2; my $row = $cover->{$group}->{$name}; + print ''; $name = sprintf '%s', EncodeURI("/chars/$group/$name"), EscapeHTML($name) if $row->{-count} and $row->{-count} < 1280; @@ -68,18 +101,20 @@ for my $name (sort keys %{ $cover->{$group} }) { next; } if (not $count) { - print ''; } - say ''; -} say "
'; printf '%s', $_ for @fontlist; say ''; -for my $group (sort keys %{$cover}) { - say '
0'; + print '✘'; + next; + } + if ($count == $row->{-count}) { + print '✔'; next; } my $rel = $count / $row->{-count}; - my $class = $rel < .5 ? 2 : $rel < .75 ? 3 : $rel < 1 ? 4 : 5; + my $class = $rel < .5 ? 2 : $rel < .9 ? 3 : 4; printf '%d%%', "l$class", $rel*100; } say '
\n"; -- 2.30.0