font: load unicode data optionally
[sheet.git] / tools / mkfontinfo
index c6626fa397bbb32e0e74e8b5d963355cf0a6efbd..e212d94a8aba715362a91c3957b2c2a971229f53 100755 (executable)
@@ -35,6 +35,7 @@ if ($chartables) {
                                next if /^[.-]/;
                                next if $_ eq '>' or $_ eq '=';
                                s/^\\//;  # escape
+                               length $_ == 1 or next;  # multiple characters lost in query
                                push @{ $charlist{table}->{"$tablegroup/$tablename"} }, $_;
                                push @{ $charlist{table}->{$tablegroup} }, $_;
                        }
@@ -56,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 %{$_}) {