summaryrefslogtreecommitdiff
path: root/fonts/utilities
diff options
context:
space:
mode:
Diffstat (limited to 'fonts/utilities')
-rwxr-xr-xfonts/utilities/fontools/bin/afm2afm4
-rwxr-xr-xfonts/utilities/fontools/bin/autoinst99
-rwxr-xr-xfonts/utilities/fontools/bin/ot2kpx4
-rwxr-xr-xfonts/utilities/fontools/bin/splitttc4
-rw-r--r--fonts/utilities/fontools/doc/afm2afm.pdfbin27065 -> 27053 bytes
-rw-r--r--fonts/utilities/fontools/doc/autoinst.pdfbin69654 -> 69866 bytes
-rw-r--r--fonts/utilities/fontools/doc/ot2kpx.pdfbin27441 -> 27426 bytes
-rw-r--r--fonts/utilities/fontools/doc/splitttc.pdfbin20583 -> 20571 bytes
8 files changed, 80 insertions, 31 deletions
diff --git a/fonts/utilities/fontools/bin/afm2afm b/fonts/utilities/fontools/bin/afm2afm
index b1233e0c52..9a6319a9da 100755
--- a/fonts/utilities/fontools/bin/afm2afm
+++ b/fonts/utilities/fontools/bin/afm2afm
@@ -37,7 +37,7 @@ use File::Basename;
use Getopt::Long;
use Pod::Usage;
-my $VERSION = "20210401";
+my $VERSION = "20210721";
parse_commandline();
@@ -421,7 +421,7 @@ See the GNU General Public License for more details.
=head1 VERSION
-This document describes B<afm2afm> version 20210401.
+This document describes B<afm2afm> version 20210721.
=head1 RECENT CHANGES
diff --git a/fonts/utilities/fontools/bin/autoinst b/fonts/utilities/fontools/bin/autoinst
index 77e17aa92e..46e0a598cb 100755
--- a/fonts/utilities/fontools/bin/autoinst
+++ b/fonts/utilities/fontools/bin/autoinst
@@ -41,7 +41,7 @@ use Getopt::Long ();
use Pod::Usage ();
use POSIX ();
-my $VERSION = '20210401';
+my $VERSION = '20210721';
my ($d, $m, $y) = (localtime time)[3 .. 5];
my $TODAY = sprintf "%04d/%02d/%02d", $y + 1900, $m + 1, $d;
@@ -265,7 +265,7 @@ my @WEIGHT = (
el => [ qw( extralight 200 ) ],
l => [ qw( light 300 ) ],
sl => [ qw( semilight blond ) ],
- '' => [ qw( regular normal text book 400 normallight normaldark ) ],
+ '' => [ qw( regular normal text book 400 normallight normaldark plain ) ],
sb => [ qw( semibold demibold 600 medium 500 ) ],
b => [ qw( bold 700 ) ],
eb => [ qw( extrabold 800 ) ],
@@ -606,14 +606,14 @@ sub _get_metadata {
my $cmd = qq(otfinfo --info "$filename");
open my $otfinfo, '-|', $cmd
- or die "[ERROR] Could not fork(): $!";
+ or die "[ERROR] Could not run '$cmd': $!";
my %data = map { my ($k,$v) = m/\A\s* ([^:]+?) \s*:\s* ([^\r\n]+)/xms;
$k =~ s/\s+//xmsg;
(lc $k => $v);
}
grep { m/\A\s* [^:]+? \s*:\s* [^\r\n]+/xms } <$otfinfo>;
close $otfinfo
- or die "[ERROR] '$cmd' failed.";
+ or die "[ERROR] '$cmd' failed";
return \%data;
}
@@ -709,6 +709,20 @@ sub _parse_metadata {
$self->{weight} = Attr::unabbreviate($self->{weight});
$self->{shape} = Attr::unabbreviate($self->{shape});
+ # Handle the (semi)condensed widths of the Thesis family.
+ # Doing this in the WIDTH table is tricky (i.e., TheSansCd might be
+ # parsed as the SCd width of the TheSan family), so we treat it as
+ # a special case instead.
+ if ($self->{family} =~ m/\A (The (?: Sans | Serif | Mix)) (S? Cd) \z/xms
+ and $self->{width} eq 'regular') {
+ $self->{family} = $1;
+ $self->{width}
+ = $2 eq 'Cd' ? 'condensed'
+ : $2 eq 'SCd' ? 'semicondensed'
+ : die '[ERROR] Internal error, please report!'
+ ;
+ }
+
# Some font families put small caps into separate families;
# we merge these into the 'main' family.
# We have to test both 'family', 'subfamily' and 'name' for hints
@@ -813,17 +827,17 @@ sub _parse_featuredata {
my $cmd = qq(otfinfo --features "$self->{filename}");
open my $otfinfo, '-|', $cmd
- or die "[ERROR] Could not fork(): $!";
+ or die "[ERROR] Could not run '$cmd': $!";
my @data = map { substr $_, 0, 4 } <$otfinfo>;
close $otfinfo
- or die "[ERROR] '$cmd' failed.";
+ or die "[ERROR] '$cmd' failed";
$cmd = qq(otfinfo --tables "$self->{filename}");
open $otfinfo, '-|', $cmd
- or die "[ERROR] Could not fork(): $!";
+ or die "[ERROR] Could not run '$cmd': $!";
my $data = do { local $/; <$otfinfo> };
close $otfinfo
- or die "[ERROR] '$cmd' failed.";
+ or die "[ERROR] '$cmd' failed";
if ($data =~ m/\d+ \s+ kern/xms) {
push @data, 'kern';
@@ -843,14 +857,14 @@ sub _parse_sizedata {
my $cmd = qq(otfinfo --optical-size "$self->{filename}");
open my $otfinfo, '-|', $cmd
- or die "[ERROR] Could not fork(): $!";
+ or die "[ERROR] Could not run '$cmd': $!";
my $data = do { local $/; <$otfinfo> };
close $otfinfo
- or die "[ERROR] '$cmd' failed.";
+ or die "[ERROR] '$cmd' failed";
my ($minsize, $maxsize)
- = $data =~ m/[(] ([\d.]+) \s* pt, \s*
- ([\d.]+) \s* pt \s* [])]/xms;
+ = $data =~ m/[([] ([\d.]+) (?:\s* pt)?, \s*
+ ([\d.]+) (?:\s* pt)? \s* [])]/xms;
$minsize //= 0;
$maxsize //= 0;
@@ -1258,7 +1272,9 @@ END_STY_FONTAXES_ORN
if ($seen{Numr}) {
print {$STY} <<'END_STY_FONTAXES_NUMR';
\fa@naming@exception{figures}{{numerators}{proportional}}{Numr}
+ \fa@naming@exception{figures}{{numerator}{proportional}}{Numr}
\fa@naming@exception{figures}{{numerators}{tabular}}{Numr}
+ \fa@naming@exception{figures}{{numerator}{tabular}}{Numr}
END_STY_FONTAXES_NUMR
}
@@ -1266,7 +1282,9 @@ END_STY_FONTAXES_NUMR
if ($seen{Dnom}) {
print {$STY} <<'END_STY_FONTAXES_DNOM';
\fa@naming@exception{figures}{{denominators}{proportional}}{Dnom}
+ \fa@naming@exception{figures}{{denominator}{proportional}}{Dnom}
\fa@naming@exception{figures}{{denominators}{tabular}}{Dnom}
+ \fa@naming@exception{figures}{{denominator}{tabular}}{Dnom}
END_STY_FONTAXES_DNOM
}
@@ -2272,7 +2290,7 @@ sub create_command {
return join q( ), 'otftotfm',
'--automatic',
- "--encoding='$workitem->{enc_file}'",
+ "--encoding=$workitem->{enc_file}",
$targetdirs,
'--no-updmap',
'--force',
@@ -2302,11 +2320,22 @@ sub create_command {
sub run_commands {
my ($commandlist, $family, $log) = @_;
+ my $n_cmds = scalar @{$commandlist};
+ my ($log_ncmds, $ceil) = (1, 10);
+ while ($n_cmds >= $ceil) {
+ $log_ncmds++;
+ $ceil *= 10;
+ }
+ my $template = sprintf "%%%dd of %%%dd", $log_ncmds, $log_ncmds;
+ my $l_template = 4 + 2 * $log_ncmds;
+ $| = 1; # autoflush
+ print "[INFO] Generating fonts for $family: ", " " x $l_template;
+
+ my $i_cmd = 1;
my $oops = 0;
- $| = 1; # turn on autoflush, to make a poor man's progress bar
- print "[INFO] Generating fonts for $family ";
for my $command (@{$commandlist}) {
- print '.';
+ print "\b" x $l_template;
+ printf $template, $i_cmd++, $n_cmds;
open my $otftotfm, '-|', "$command 2>&1"
or die "could not fork(): $!";
my $msgs = do { local $/; <$otftotfm> };
@@ -3049,13 +3078,13 @@ sub cleanup {
# Figure out whether the encoding option refers to a custom encoding file
# in the current directory, or to the name of one of our standard
- # encodings. In the latter case, we add the 'fontools_' prefix.
- my $try = $workitem->{encoding};
- $try .= '.enc' if $try !~ m/[.]enc\z/xmsi;
- if (-e $try) {
- $workitem->{enc_file} = $try;
+ # encodings. In the former case, we quote the filename, to account
+ # for possible spaces or other metacharacters; in the latter case,
+ # we add the 'fontools_' prefix.
+ if (-e $workitem->{encoding}) {
+ $workitem->{enc_file} = qq{"$workitem->{encoding}"};
$workitem->{encoding}
- = File::Basename::basename($try, '.enc', '.ENC');
+ = File::Basename::basename($workitem->{encoding}, '.enc', '.ENC');
}
else {
($workitem->{enc_file} = $workitem->{encoding})
@@ -3173,7 +3202,7 @@ sub modify_fontnames {
my $cmd = qq(t1disasm "$oldfn");
open my $t1disasm, '-|:raw', $cmd
- or die "[ERROR] Could not fork(): $!";
+ or die "[ERROR] Could not run '$cmd': $!";
my @pfbdata = readline $t1disasm;
close $t1disasm
or die "[ERROR] '$cmd' failed";
@@ -3193,7 +3222,7 @@ sub modify_fontnames {
$cmd = qq(t1asm --pfb >"$newfn");
open my $t1asm, '|-:raw', $cmd
- or die "[ERROR] Could not fork(): $!";
+ or die "[ERROR] Could not run '$cmd': $!";
print {$t1asm} @pfbdata;
close $t1asm
or die "[ERROR] '$cmd' failed";
@@ -4000,7 +4029,7 @@ GNU General Public License for more details.
=head1 VERSION
-This document describes B<autoinst> version 20210401.
+This document describes B<autoinst> version 20210721.
=head1 RECENT CHANGES
@@ -4009,6 +4038,26 @@ This document describes B<autoinst> version 20210401.
=over 12
+=item I<2021-07-21>
+
+Bugfixes:
+
+=over 3
+
+=item -
+
+Yet another problem with argument quoting on Windows.
+
+=item -
+
+Selecting numerator/denominator fonts didn't work as documented.
+
+=item -
+
+Font info parsing failed for Microsoft Sitka and LucasFonts Thesis.
+
+=back
+
=item I<2021-04-01>
The I<-encoding> option now also accepts filenames of encoding files
diff --git a/fonts/utilities/fontools/bin/ot2kpx b/fonts/utilities/fontools/bin/ot2kpx
index 295c917782..a037fa7685 100755
--- a/fonts/utilities/fontools/bin/ot2kpx
+++ b/fonts/utilities/fontools/bin/ot2kpx
@@ -38,7 +38,7 @@ use Getopt::Long ();
use List::Util @List::Util::EXPORT_OK;
use Pod::Usage;
-my $VERSION = "20210401";
+my $VERSION = "20210721";
our ($NUM_GLYPHS, $UNITS_PER_EM, %kern);
@@ -858,7 +858,7 @@ See the GNU General Public License for more details.
=head1 VERSION
-This document describes B<ot2kpx> version 20210401.
+This document describes B<ot2kpx> version 20210721.
=head1 RECENT CHANGES
diff --git a/fonts/utilities/fontools/bin/splitttc b/fonts/utilities/fontools/bin/splitttc
index 28e52c5a2e..f0950a1256 100755
--- a/fonts/utilities/fontools/bin/splitttc
+++ b/fonts/utilities/fontools/bin/splitttc
@@ -38,7 +38,7 @@ use File::Basename;
use Getopt::Long;
use Pod::Usage;
-my $VERSION = "20210401";
+my $VERSION = "20210721";
parse_commandline();
@@ -303,7 +303,7 @@ See the GNU General Public License for more details.
=head1 VERSION
-This document describes B<splitttc> version 20210401.
+This document describes B<splitttc> version 20210721.
=head1 RECENT CHANGES
diff --git a/fonts/utilities/fontools/doc/afm2afm.pdf b/fonts/utilities/fontools/doc/afm2afm.pdf
index 0c4610bbfa..5729170dfd 100644
--- a/fonts/utilities/fontools/doc/afm2afm.pdf
+++ b/fonts/utilities/fontools/doc/afm2afm.pdf
Binary files differ
diff --git a/fonts/utilities/fontools/doc/autoinst.pdf b/fonts/utilities/fontools/doc/autoinst.pdf
index 9d3defddd8..003afb51d0 100644
--- a/fonts/utilities/fontools/doc/autoinst.pdf
+++ b/fonts/utilities/fontools/doc/autoinst.pdf
Binary files differ
diff --git a/fonts/utilities/fontools/doc/ot2kpx.pdf b/fonts/utilities/fontools/doc/ot2kpx.pdf
index b335757e7b..f2187ab324 100644
--- a/fonts/utilities/fontools/doc/ot2kpx.pdf
+++ b/fonts/utilities/fontools/doc/ot2kpx.pdf
Binary files differ
diff --git a/fonts/utilities/fontools/doc/splitttc.pdf b/fonts/utilities/fontools/doc/splitttc.pdf
index 454684a60d..5c68b8c142 100644
--- a/fonts/utilities/fontools/doc/splitttc.pdf
+++ b/fonts/utilities/fontools/doc/splitttc.pdf
Binary files differ