5 # output (TT-)unhinted glyphs
6 # (c)2005 Stepan Roh (PUBLIC DOMAIN)
7 # usage: ./unhinted.pl [-v] [-c] sfd_files+
9 sub parse_sfd_file
($$$);
11 sub parse_sfd_file
($$$) {
12 my ($sfd_file, $verbose, $composites) = @_;
14 open (SFD
, $sfd_file) || die "Unable to open $sfd_file : $!\n";
15 print $sfd_file, ': ';
27 if (/^FullName:\s+\S+\s+(.*?)\s*$/) {
29 $experimental = ($typeface =~ /Condensed|(Serif.*Oblique)/);
30 } elsif (/^StartChar:\s*(\S+)\s*$/) {
36 } elsif (/^TtfInstrs:/) {
38 } elsif (/^Colour:/) {
39 # XXX this is quick'n'dirty hack to detect non-empty glyphs
43 } elsif (/^Encoding:\s*\d+\s*(\d+)\s*\d+\s*$/) {
44 $hex_enc = sprintf ('%04X', $1);
45 } elsif ($hex_enc && !$empty && /^EndChar\s*$/) {
47 if (($composites || $contours) && !$hinted) {
49 push (@unhinted, $curchar . ' (U+' . $hex_enc . ')');
53 print "[experimental] " if ($experimental);
54 printf "%.0d%% (%d/%d)", $unhinted / $total * 100, $unhinted, $total;
56 print ' ', join (', ', @unhinted), "\n" if ($verbose);
61 print STDERR
"usage: [-v] [-c] sfd_files+\n";
65 while ($ARGV[0] =~ /^-/) {
66 if ($ARGV[0] eq '-v') {
68 } elsif ($ARGV[0] eq '-c') {
77 foreach $sfd_file (@sfd_files) {
78 parse_sfd_file
($sfd_file, $verbose, $composites);