font: load unicode data optionally
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 5 Mar 2015 03:50:28 +0000 (04:50 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:43 +0000 (05:43 +0200)
tools/mkfontinfo

index 3be474c26c3f4d72fde4249694383021ed94441b..e212d94a8aba715362a91c3957b2c2a971229f53 100755 (executable)
@@ -57,13 +57,16 @@ eval {
        1;
 } or warn "Could not include count for html entities: $@";
 
-use Unicode::UCD 'charinfo';
-for my $code (0 .. 256**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 );
-}
+eval {
+       use Unicode::UCD 'charinfo';
+       for my $code (0 .. 256**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 );
+       }
+       1;
+} or warn "Could not include unicode groups: $@";
 
 for (values %charlist) {
 for my $chars (values %{$_}) {