From: Mischa POSLAWSKY Date: Mon, 16 Mar 2015 18:25:41 +0000 (+0100) Subject: font: aggregate counts for unicode versions X-Git-Tag: v1.7~14 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/290c85c0f46c87ae95eeece911bdd3f57ba51dfd font: aggregate counts for unicode versions --- diff --git a/font.plp b/font.plp index a7812d0..a93835c 100644 --- a/font.plp +++ b/font.plp @@ -122,6 +122,8 @@ my @ossel = @{ $cover->{osdefault} }; my @fontlist = map { @{ $cover->{os}->{$_} } } @ossel; my @rows = ( + 'version/11', + 'version/63', 'block/Latin-1 Supplement', 'block/Latin Extended-A', 'block/Latin Extended Additional', @@ -182,6 +184,7 @@ for (@rows) { my $row = $cover->{$group}->{$name}; print ''; + $name = sprintf 'Unicode v%.1f', $name / 10 if $group eq 'version'; $name = sprintf '%s', EncodeURI("/chars/$group/$name"), EscapeHTML($name) if $row->{count} and $row->{count} < 1280; print '', $name; diff --git a/tools/mkfontinfo b/tools/mkfontinfo index 6072600..ed328cf 100755 --- a/tools/mkfontinfo +++ b/tools/mkfontinfo @@ -64,12 +64,17 @@ eval { } or warn "Could not include count for html entities: $@"; eval { + my $agemap = do 'unicode-age.inc.pl' + or warn "Could not include unicode version data: $!"; + use Unicode::UCD 'charinfo'; for my $code (0 .. 256**2*2) { my $charinfo = charinfo($code) or next; next if $charinfo->{category} =~ /^[MC]/; # ignore Marks and "other" Control chars push @{ $charlist{$_}->{ $charinfo->{$_} } }, chr $code for qw( script category block ); + push @{ $charlist{version}->{$_} }, (chr $code) x ($agemap->{$code} <= $_) + for 11, 30, 63; } 1; } or warn "Could not include unicode groups: $@";