summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-07-21 20:46:10 +0000
committerKarl Berry <karl@freefriends.org>2021-07-21 20:46:10 +0000
commitb03788d15a8e96a8631d99b12936f40b6341ddb2 (patch)
tree65ba7b291289dd60fac9717b50b5d783174d9445 /Build/source
parent8e350e2335e60d52c5502d1f1aea633fb8008cdd (diff)
fontools (21jul21)
git-svn-id: svn://tug.org/texlive/trunk@60005 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/fontools/afm2afm4
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/fontools/autoinst99
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/fontools/ot2kpx4
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/fmtutil.pl66
4 files changed, 110 insertions, 63 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/fontools/afm2afm b/Build/source/texk/texlive/linked_scripts/fontools/afm2afm
index b1233e0c521..9a6319a9da8 100755
--- a/Build/source/texk/texlive/linked_scripts/fontools/afm2afm
+++ b/Build/source/texk/texlive/linked_scripts/fontools/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/Build/source/texk/texlive/linked_scripts/fontools/autoinst b/Build/source/texk/texlive/linked_scripts/fontools/autoinst
index 77e17aa92e9..46e0a598cb6 100755
--- a/Build/source/texk/texlive/linked_scripts/fontools/autoinst
+++ b/Build/source/texk/texlive/linked_scripts/fontools/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/Build/source/texk/texlive/linked_scripts/fontools/ot2kpx b/Build/source/texk/texlive/linked_scripts/fontools/ot2kpx
index 295c9177825..a037fa76852 100755
--- a/Build/source/texk/texlive/linked_scripts/fontools/ot2kpx
+++ b/Build/source/texk/texlive/linked_scripts/fontools/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/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl b/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
index 1e87a90bc36..064da24f2c2 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: fmtutil.pl 59207 2021-05-15 13:58:40Z preining $
+# $Id: fmtutil.pl 59983 2021-07-18 22:18:08Z karl $
# fmtutil - utility to maintain format files.
# (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.)
#
@@ -24,11 +24,11 @@ BEGIN {
TeX::Update->import();
}
-my $svnid = '$Id: fmtutil.pl 59207 2021-05-15 13:58:40Z preining $';
-my $lastchdate = '$Date: 2021-05-15 15:58:40 +0200 (Sat, 15 May 2021) $';
+my $svnid = '$Id: fmtutil.pl 59983 2021-07-18 22:18:08Z karl $';
+my $lastchdate = '$Date: 2021-07-19 00:18:08 +0200 (Mon, 19 Jul 2021) $';
$lastchdate =~ s/^\$Date:\s*//;
$lastchdate =~ s/ \(.*$//;
-my $svnrev = '$Revision: 59207 $';
+my $svnrev = '$Revision: 59983 $';
$svnrev =~ s/^\$Revision:\s*//;
$svnrev =~ s/\s*\$$//;
my $version = "r$svnrev ($lastchdate)";
@@ -36,7 +36,6 @@ my $version = "r$svnrev ($lastchdate)";
use strict;
use Getopt::Long qw(:config no_autoabbrev ignore_case_always);
use File::Basename;
-use File::Copy;
use File::Spec;
use Cwd;
@@ -736,7 +735,7 @@ sub rebuild_one_format {
if ($poolfile && -f $poolfile) {
print_verbose("attempting to create localized format "
. "using pool=$pool and tcx=$tcx.\n");
- File::Copy::copy($poolfile, "$eng.pool");
+ TeXLive::TLUtils::copy("-f", $poolfile, "$eng.pool");
$tcxflag = "-translate-file=$tcx" if ($tcx);
$localpool = 1;
}
@@ -798,7 +797,7 @@ sub rebuild_one_format {
# to make sure that in SElinux enabled cases the rules of
# the destination directory are applied.
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900580
- if (File::Copy::copy($logfile, "$destdir/$logfile")) {
+ if (TeXLive::TLUtils::copy("-f", $logfile, "$destdir/$logfile")) {
print_info("log file copied to: $destdir/$logfile\n");
} else {
print_deferred_error("cannot copy log $logfile to: $destdir\n")
@@ -846,7 +845,7 @@ sub rebuild_one_format {
# package dependencies for each format. Unfortunately omega-based
# engines gratuitiously changed the extension from .fls to .ofl.
my $recfile = $fmt . ($fmt =~ m/^(aleph|lamed)$/ ? ".ofl" : ".fls");
- if (!File::Copy::copy($recfile, "$destdir/$recfile")) {
+ if (! TeXLive::TLUtils::copy("-f", $recfile, "$destdir/$recfile")) {
print_deferred_error("cannot copy recorder $recfile to: $destdir\n");
}
}
@@ -856,39 +855,38 @@ sub rebuild_one_format {
# we check whether the next command **would** create a new file,
# and if it succeeded, we set the actual flag.
my $possibly_warn = ($opts{'user'} && ! -r $destfile);
- if (File::Copy::copy($fmtfile, $destfile )) {
+ if (TeXLive::TLUtils::copy("-f", $fmtfile, $destfile)) {
print_info("$destfile installed.\n");
$first_time_creation_in_usermode = $possibly_warn;
#
# original fmtutil.sh did some magic trick for mplib-luatex.mem
- #
# nowadays no mplib mem is created and all files loaded
# so we comment and do not convert this
#
- # As a special special case, we create mplib-luatex.mem for use by
- # the mplib embedded in luatex if it doesn't already exist. (We
- # never update it if it does exist.)
- #
- # This is used by the luamplib package. This way, an expert user
- # who wants to try a new version of luatex (hence with a new
- # version of mplib) can manually update mplib-luatex.mem without
- # having to tamper with mpost itself.
- #
- # if test "x$format" = xmpost && test "x$engine" = xmpost; then
- # mplib_mem_name=mplib-luatex.mem
- # mplib_mem_file=$fulldestdir/$mplib_mem_name
- # if test \! -f $mplib_mem_file; then
- # verboseMsg "$progname: copying $destfile to $mplib_mem_file"
- # if cp "$destfile" "$mplib_mem_file" </dev/null; then
- # mktexupd "$fulldestdir" "$mplib_mem_name"
- # else
- # # failure to copy merits failure handling: e.g., full file system.
- # log_failure "cp $destfile $mplib_mem_file failed."
- # fi
- # else
- # verboseMsg "$progname: $mplib_mem_file already exists, not updating."
- # fi
- # fi
+ ## As a special special case, we create mplib-luatex.mem for use by
+ ## the mplib embedded in luatex if it doesn't already exist. (We
+ ## never update it if it does exist.)
+ ##
+ ## This is used by the luamplib package. This way, an expert user
+ ## who wants to try a new version of luatex (hence with a new
+ ## version of mplib) can manually update mplib-luatex.mem without
+ ## having to tamper with mpost itself.
+ ##
+ ## if test "x$format" = xmpost && test "x$engine" = xmpost; then
+ ## mplib_mem_name=mplib-luatex.mem
+ ## mplib_mem_file=$fulldestdir/$mplib_mem_name
+ ## if test \! -f $mplib_mem_file; then
+ ## verboseMsg "$progname: copying $destfile to $mplib_mem_file"
+ ## if cp "$destfile" "$mplib_mem_file" </dev/null; then
+ ## mktexupd "$fulldestdir" "$mplib_mem_name"
+ ## else
+ ## ## failure to copy merits failure handling: e.g., full file system.
+ ## log_failure "cp $destfile $mplib_mem_file failed."
+ ## fi
+ ## else
+ ## verboseMsg "$progname: $mplib_mem_file already exists, not updating."
+ ## fi
+ ## fi
if ($mktexfmtMode && $mktexfmtFirst) {
print "$destfile\n";