summaryrefslogtreecommitdiff
path: root/fonts/utilities
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-01-30 03:00:45 +0000
committerNorbert Preining <norbert@preining.info>2020-01-30 03:00:45 +0000
commit1f2683ba3ec9c1855d5518e773c72d2241637449 (patch)
tree8e8cacd9473406eeaf6736cf32f6fa6996439a8d /fonts/utilities
parent0d9a20b65398ec99149b5c3d700e78f891b90842 (diff)
CTAN sync 202001300300
Diffstat (limited to 'fonts/utilities')
-rw-r--r--fonts/utilities/fontools/README2
-rwxr-xr-xfonts/utilities/fontools/bin/afm2afm8
-rwxr-xr-xfonts/utilities/fontools/bin/autoinst151
-rwxr-xr-xfonts/utilities/fontools/bin/ot2kpx8
-rwxr-xr-xfonts/utilities/fontools/bin/splitttc8
-rw-r--r--fonts/utilities/fontools/doc/afm2afm.pdfbin27061 -> 26948 bytes
-rw-r--r--fonts/utilities/fontools/doc/autoinst.pdfbin69935 -> 69988 bytes
-rw-r--r--fonts/utilities/fontools/doc/ot2kpx.pdfbin27439 -> 27327 bytes
-rw-r--r--fonts/utilities/fontools/doc/splitttc.pdfbin20550 -> 20436 bytes
9 files changed, 94 insertions, 83 deletions
diff --git a/fonts/utilities/fontools/README b/fonts/utilities/fontools/README
index 4ceee70eff..50e0114ac2 100644
--- a/fonts/utilities/fontools/README
+++ b/fonts/utilities/fontools/README
@@ -78,6 +78,6 @@ See the GNU General Public License for more details.
LICENSE & COPYRIGHT
===================
-This software is copyright (C) 2005-2019 Marc Penninga.
+This software is copyright (C) 2005-2020 Marc Penninga.
It is released under the terms of the GNU General Public Licence;
see the file GPLv2.txt for the license conditions.
diff --git a/fonts/utilities/fontools/bin/afm2afm b/fonts/utilities/fontools/bin/afm2afm
index 65d03e3ef3..90b5c0bd4f 100755
--- a/fonts/utilities/fontools/bin/afm2afm
+++ b/fonts/utilities/fontools/bin/afm2afm
@@ -4,7 +4,7 @@
----------------------------------------------------------------------------
- Copyright (C) 2005-2019 Marc Penninga.
+ Copyright (C) 2005-2020 Marc Penninga.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -37,7 +37,7 @@ use File::Basename;
use Getopt::Long;
use Pod::Usage;
-my $VERSION = "20191126";
+my $VERSION = "20200129";
parse_commandline();
@@ -398,7 +398,7 @@ Marc Penninga <marcpenninga@gmail.com>
=head1 COPYRIGHT
-Copyright (C) 2005-2019 Marc Penninga.
+Copyright (C) 2005-2020 Marc Penninga.
=head1 LICENSE
@@ -421,7 +421,7 @@ See the GNU General Public License for more details.
=head1 VERSION
-This document describes B<afm2afm> version 20191126.
+This document describes B<afm2afm> version 20200129.
=head1 RECENT CHANGES
diff --git a/fonts/utilities/fontools/bin/autoinst b/fonts/utilities/fontools/bin/autoinst
index 038769de76..7ca9cad378 100755
--- a/fonts/utilities/fontools/bin/autoinst
+++ b/fonts/utilities/fontools/bin/autoinst
@@ -4,7 +4,7 @@
----------------------------------------------------------------------------
- Copyright (C) 2005-2019 Marc Penninga.
+ Copyright (C) 2005-2020 Marc Penninga.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -40,7 +40,7 @@ use Getopt::Long ();
use Pod::Usage ();
use POSIX ();
-my $VERSION = '20191126';
+my $VERSION = '20200129';
my ($d, $m, $y) = (localtime time)[3 .. 5];
my $TODAY = sprintf "%04d/%02d/%02d", $y + 1900, $m + 1, $d;
@@ -89,7 +89,7 @@ for my $full (keys %ABBREV) {
- width: uc, ec, c, sc, m, sx, x, ex, ux
These codes are not always a perfect match with the weights and widths
- present in a font family; some families (especially sanserif ones)
+ present in a font family; some families (especially many sans serif ones)
contain more or different weights and widths, and the naming of those
weights and widths isn't always consistent between font families.
To handle this situation, we use a two-tiered approach:
@@ -199,15 +199,6 @@ my @WIDTHS = grep { $_ ne 'regular' } map { @{$_} } values %NFSS_WIDTH;
The NFSS_SHAPE table maps various shape names to NFSS codes.
- Note that this table works the other way around compared to
- the two previous tables; it directly maps shape names to NFSS codes.
- The reason the other tables are a bit contorted is that there,
- we might have multiple weighs or widths mapping to the same code,
- and we need a way to prioritise some weights/widths over others.
-
- For shapes, that's not the case; font families don't have both Slanted
- and Oblique shapes, since these are different names for the same thing.
-
Like in the other NFSS_* tables, entries may be added to teach autoinst
about new shapes.
@@ -219,8 +210,6 @@ my @NFSS_SHAPE = (
roman => 'n',
upright => 'n',
italic => 'it',
- cursive => 'it',
- kursiv => 'it',
inclined => 'sl',
oblique => 'sl',
slanted => 'sl',
@@ -304,7 +293,7 @@ my %SHAPE = (
=begin Comment
- The next table is used to generate extra ssub rules in the .fd files
+ The SSUB_SHAPE table is used to generate extra ssub rules in .fd files
to map missing Slanted shapes to Italic and vice versa.
=end Comment
@@ -463,15 +452,18 @@ my %STYLE_DEFAULTS = (
sub main {
+ print "autoinst, version $VERSION\n";
+
ARGV::parse_options();
my @fonts = map { Fontinfo::parse_fontinfo($_) } @ARGV;
+ $ARGV{logfile} ||= sprintf "%s.log", lc $fonts[0]->{family};
create_logfile(@fonts);
Fontinfo::assert_unique(@fonts);
# We can only handle the '-inferiors=auto' option now,
- # since this requires knowing which inferior figures this font supports;
+ # since we need to know which inferior figures this font supports;
# so we have to do the font info parsing first.
if ($ARGV{inferiors} eq 'auto') {
Fontinfo::handle_auto_inferiors(@fonts);
@@ -517,6 +509,7 @@ sub main {
}
close $ARGV{logfile};
+ print "\n";
return;
}
@@ -751,6 +744,7 @@ sub create_logfile {
}
open my $LOG, '>>', $ARGV{logfile}
or die "$0: cannot create $ARGV{logfile}: $!";
+ $ARGV{logfile} = $LOG;
print {$LOG} <<"END_ARGUMENTS";
@@ -787,44 +781,21 @@ I'm using the following options:
fractions: @{[ $ARGV{fractions} ? 'yes' : 'no' ]}
ligatures: @{[ $ARGV{ligatures} ? 'yes' : 'no' ]}
- dry run/real: @{[ $ARGV{dryrun} ? 'dry run' : 'real' ]}
auto/manual: @{[ $ARGV{manual} ? 'manual' : 'auto' ]}
target: $ARGV{target}
- extra: @{[ $ARGV{extra} || '<empty>' ]}
+ extra: $ARGV{extra}
figurekern: @{[ $ARGV{figurekern} ? 'keep' : 'remove' ]}
mergewidths: @{[ $ARGV{mergewidths} ? 'yes' : 'no' ]}
mergeweights: @{[ $ARGV{mergeweights} ? 'yes' : 'no' ]}
mergeshapes: @{[ $ARGV{mergeshapes} ? 'yes' : 'no' ]}
- nfssweight: @{[ join q{, }, @{$ARGV{nfssweight}} or '-' ]}
- nfsswidth: @{[ join q{, }, @{$ARGV{nfsswidth}} or '-' ]}
+ nfssweight: @{[ join q{, }, @{$ARGV{nfssweight}} ]}
+ nfsswidth: @{[ join q{, }, @{$ARGV{nfsswidth}} ]}
-END_ARGUMENTS
+ @{[ $ARGV{dryrun} ? 'DRY RUN' : '' ]}
- my %fontfamilies = map { ( $_->{family} => 1 ) } @fonts;
- my @fontfamilies = keys %fontfamilies;
- if (scalar @fontfamilies > 1) {
- warn <<"END_WARNING_MULTIPLE_FAMILIES";
-[WARNING] Your fonts seem to belong to multiple families:
-
- @{[ join( "\n" . q{ } x 12, sort @fontfamilies ) ]}
-
- "autoinst" performs best when installing one family at a time.
- If you think your fonts should all be in the same family,
- you might have found a bug in autoinst's font info parsing.
-
- Please see the log file $ARGV{logfile} for details on how
- the fonts' families, weights, widths and shapes were parsed.
-END_WARNING_MULTIPLE_FAMILIES
-
- # increase verbosity if necessary, to log all relevant info
- if ($ARGV{verbose} < 1) {
- $ARGV{verbose} = 1;
- }
- }
-
- $ARGV{logfile} = $LOG;
+END_ARGUMENTS
return if $ARGV{verbose} < 1;
@@ -836,10 +807,11 @@ END_WARNING_MULTIPLE_FAMILIES
$font->{filename}
Name: $font->{name}
Family: $font->{family}
+ Subfamily: $font->{subfamily}
Weight: $font->{weight} ($font->{weight_class})
Width: $font->{width} ($font->{width_class})
Shape: $font->{shape} @{[ $font->{is_smallcaps}
- ? '(smallcaps)' : '' ]}
+ ? 'smallcaps' : '' ]}
Size: $font->{minsize}-$font->{maxsize}
Features: @{[ join ', ', sort keys %{$font->{feature}} ]}
END_PARSE_FONT
@@ -905,6 +877,7 @@ END_FONTINFO
}
return if $ARGV{verbose} < 2;
+ print {$LOG} "\n\n";
print {$LOG} join "\n\n", @cmds;
print {$LOG} "\n";
}
@@ -981,7 +954,7 @@ sub make_cmdline {
return join ' ', 'otftotfm',
($ARGV{manual} ? '--pl' : '--automatic'),
"--encoding=$item->{encoding}[0]",
- set_targetdirs($item->{font}{family}),
+ set_targetdirs($item->{font}),
'--no-updmap',
($item->{font}{filename} =~ m/[.]ttf\z/xmsi
? '--no-type1'
@@ -1008,23 +981,34 @@ sub make_cmdline {
#-----------------------------------------------------------------------
# Return a string with all "directory" options for otftotfm set
#-----------------------------------------------------------------------
-my @FILETYPES = qw(tfm vf type1 truetype);
-
sub set_targetdirs {
- my $family = shift;
-
- my %dir = map { ($_ => File::Spec->catdir(
- $ARGV{target},
- 'fonts',
- $_,
- $ARGV{vendor},
- $ARGV{typeface} || $family))
+ my $font = shift;
+
+ my $family = $font->{family};
+ my ($fonttype) = map { lc $_ } $font->{filename} =~ m/[.]([ot]tf)\z/xmsi;
+
+ my @FILETYPES = qw(tfm vf);
+ push @FILETYPES, $fonttype eq 'otf' ? qw(type1)
+ : $fonttype eq 'ttf' ? qw(truetype)
+ : qw(type1 truetype)
+ ;
+
+ my %dir = map { (
+ $_ => File::Spec->catdir(
+ $ARGV{target},
+ 'fonts',
+ $_,
+ $ARGV{vendor},
+ $ARGV{typeface} || $family
+ )
+ )
}
@FILETYPES;
- $dir{$_} = File::Spec->catdir(
- $ARGV{target}, 'fonts', $_, 'dvips', $ARGV{typeface} || $family)
- for qw(enc map);
+ $dir{$_}
+ = File::Spec->catdir(
+ $ARGV{target}, 'fonts', $_, 'dvips', $ARGV{typeface} || $family
+ ) for qw(enc map);
File::Path::make_path(values %dir) unless $ARGV{dryrun};
@@ -1085,7 +1069,7 @@ Possible options:
-manual Manual mode (see documentation)
-(no)figurekern Keep or remove kerns between tabular figures
- -(no)mergewidths Merge Condended/Extended subfamilies with main
+ -(no)mergewidths Merge condended/extended subfamilies with main
-(no)mergeweights Merge separate weights with main family
-(no)mergeshapes Merge separate shapes with main family
@@ -1461,7 +1445,6 @@ sub parse_basicinfo {
# In many font families, each font is in a subfamily of its own;
# so we remove width, weight and shape from the 'subfamily' value.
- my $subst;
$data{subfamily} =~ s/$info->{width}//xmsi;
$data{subfamily} =~ s/$info->{weight}//xmsi;
$data{subfamily} =~ s/$info->{shape}//xmsi;
@@ -1520,8 +1503,13 @@ sub parse_basicinfo {
# Some font families put extreme weights into separate families;
# we provide an option to merge these with the 'main' font family.
+ # Note that if the font's family name includes the word "Text"
+ # (as in Libre Caslon Text) this should not be mistaken for a weight.
if ($ARGV{mergeweights}) {
my $weights = join '|', mqrs(@WEIGHTS), qw(medium regular);
+ if ( $info->{family} =~ m/text \z/xmsi ) {
+ $weights =~ s/text[|]?//xms;
+ }
if ( $info->{family} =~ m/(.+?) (${weights}) \z/xmsi
and ( $info->{weight} eq 'regular'
or $info->{weight} eq ( $UNABBREVIATE{ lc($2) } // lc($2) )
@@ -1532,14 +1520,11 @@ sub parse_basicinfo {
}
}
- # Fix confusion about "Text": weight vs part of familyname.
- # In the latter case, we strip it off anyway.
+ # Strip off the "Text" from family names that contain this string.
+ # This was a crude way to fix a bug in the previous paragraph;
+ # it's unnecessary now, but we don't want to break the old behaviour.
$info->{family} =~ s/text \z//xmsi;
- if ( !$ARGV{logfile} ) {
- $ARGV{logfile} = sprintf "%s.log", lc $info->{family}
- }
-
$info->{basicshape} = $NFSS_SHAPE{$info->{shape}};
# We define 'series' as 'weight + width'. This matches NFSS,
@@ -1708,6 +1693,28 @@ sub assert_unique {
die $err_details, $ERR_PARSE;
}
+ my %fontfamilies = map { ( $_->{family} => 1 ) } @fonts;
+ my @fontfamilies = keys %fontfamilies;
+ if (scalar @fontfamilies > 1) {
+ warn <<"END_WARNING_MULTIPLE_FAMILIES";
+[WARNING] Your fonts seem to belong to multiple families:
+
+ @{[ join( "\n" . q{ } x 16, sort @fontfamilies ) ]}
+
+ "autoinst" performs best when installing one family at a time.
+ If you think your fonts should all be in the same family,
+ you may have found a bug in autoinst's font info parsing.
+
+ Please see the log file for details on how the fonts' families,
+ weights, widths and shapes were parsed.
+END_WARNING_MULTIPLE_FAMILIES
+
+ # increase verbosity if necessary, to log all relevant info
+ if ($ARGV{verbose} < 1) {
+ $ARGV{verbose} = 1;
+ }
+ }
+
return 1;
}
@@ -2461,7 +2468,7 @@ The mapping of shapes to NFSS codes is done using the following table:
SHAPE CODE
-------------------------------- ----
Roman, Upright n
- Italic, Cursive, Kursive it
+ Italic it
Oblique, Slant(ed), Incline(d) sl
(I<Exception:> Adobe Silentium Pro contains two Roman shapes;
@@ -2810,7 +2817,7 @@ don't paraphase.
=head1 COPYRIGHT
-Copyright (C) 2005-2019 Marc Penninga.
+Copyright (C) 2005-2020 Marc Penninga.
=head1 LICENSE
@@ -2833,7 +2840,7 @@ GNU General Public License for more details.
=head1 VERSION
-This document describes B<autoinst> version 20191126.
+This document describes B<autoinst> version 20200129.
=head1 RECENT CHANGES
@@ -2842,6 +2849,10 @@ This document describes B<autoinst> version 20191126.
=over 12
+=item I<2020-01-29>
+
+Don't create empty subdirectories in the target TEXMF tree.
+
=item I<2019-11-18>
Fine-tuned calling of F<kpsewhich> on Windows (patch by Akira Kakuto).
diff --git a/fonts/utilities/fontools/bin/ot2kpx b/fonts/utilities/fontools/bin/ot2kpx
index 91e34e0fa8..2fa8d8c456 100755
--- a/fonts/utilities/fontools/bin/ot2kpx
+++ b/fonts/utilities/fontools/bin/ot2kpx
@@ -4,7 +4,7 @@
----------------------------------------------------------------------------
- Copyright (C) 2005-2019 Marc Penninga.
+ Copyright (C) 2005-2020 Marc Penninga.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -38,7 +38,7 @@ use Getopt::Long ();
use List::Util @List::Util::EXPORT_OK;
use Pod::Usage;
-my $VERSION = "20191126";
+my $VERSION = "20200129";
our ($NUM_GLYPHS, $UNITS_PER_EM, %kern);
@@ -835,7 +835,7 @@ Marc Penninga <marcpenninga@gmail.com>
=head1 COPYRIGHT
-Copyright (C) 2005-2019 Marc Penninga.
+Copyright (C) 2005-2020 Marc Penninga.
=head1 LICENSE
@@ -858,7 +858,7 @@ See the GNU General Public License for more details.
=head1 VERSION
-This document describes B<ot2kpx> version 20191126.
+This document describes B<ot2kpx> version 20200129.
=head1 RECENT CHANGES
diff --git a/fonts/utilities/fontools/bin/splitttc b/fonts/utilities/fontools/bin/splitttc
index 44da4eafff..5f609f3003 100755
--- a/fonts/utilities/fontools/bin/splitttc
+++ b/fonts/utilities/fontools/bin/splitttc
@@ -4,7 +4,7 @@
----------------------------------------------------------------------------
- Copyright (C) 2019 Marc Penninga.
+ Copyright (C) 2020 Marc Penninga.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -37,7 +37,7 @@ use File::Basename;
use Getopt::Long;
use Pod::Usage;
-my $VERSION = "20191126";
+my $VERSION = "20200129";
parse_commandline();
@@ -222,7 +222,7 @@ Marc Penninga <marcpenninga@gmail.com>
=head1 COPYRIGHT
-Copyright (C) 2019 Marc Penninga.
+Copyright (C) 2020 Marc Penninga.
=head1 LICENSE
@@ -245,7 +245,7 @@ See the GNU General Public License for more details.
=head1 VERSION
-This document describes B<splitttc> version 20191126.
+This document describes B<splitttc> version 20200129.
=head1 RECENT CHANGES
diff --git a/fonts/utilities/fontools/doc/afm2afm.pdf b/fonts/utilities/fontools/doc/afm2afm.pdf
index 436dbc988e..d3d5ffd085 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 ec9d0c5124..af3b7c64b0 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 25e7b37726..1efb69c3ed 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 a1549ee1f1..a8a8d9ff7a 100644
--- a/fonts/utilities/fontools/doc/splitttc.pdf
+++ b/fonts/utilities/fontools/doc/splitttc.pdf
Binary files differ