From faafae680cd217cf8d85185f8a78818dac402a7d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 5 Apr 2021 01:27:54 +0000 Subject: fontools (5apr21) git-svn-id: svn://tug.org/texlive/trunk@58747 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/fontools/afm2afm | 8 +- Master/texmf-dist/scripts/fontools/autoinst | 269 ++++++++++++++-------------- Master/texmf-dist/scripts/fontools/ot2kpx | 8 +- 3 files changed, 147 insertions(+), 138 deletions(-) (limited to 'Master/texmf-dist/scripts/fontools') diff --git a/Master/texmf-dist/scripts/fontools/afm2afm b/Master/texmf-dist/scripts/fontools/afm2afm index e5ace31b1c0..b1233e0c521 100755 --- a/Master/texmf-dist/scripts/fontools/afm2afm +++ b/Master/texmf-dist/scripts/fontools/afm2afm @@ -4,7 +4,7 @@ ---------------------------------------------------------------------------- - Copyright (C) 2005-2020 Marc Penninga. + Copyright (C) 2005-2021 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 = "20201218"; +my $VERSION = "20210401"; parse_commandline(); @@ -398,7 +398,7 @@ Marc Penninga =head1 COPYRIGHT -Copyright (C) 2005-2020 Marc Penninga. +Copyright (C) 2005-2021 Marc Penninga. =head1 LICENSE @@ -421,7 +421,7 @@ See the GNU General Public License for more details. =head1 VERSION -This document describes B version 20201218. +This document describes B version 20210401. =head1 RECENT CHANGES diff --git a/Master/texmf-dist/scripts/fontools/autoinst b/Master/texmf-dist/scripts/fontools/autoinst index 79eb1e13024..77e17aa92e9 100755 --- a/Master/texmf-dist/scripts/fontools/autoinst +++ b/Master/texmf-dist/scripts/fontools/autoinst @@ -4,7 +4,7 @@ ---------------------------------------------------------------------------- - Copyright (C) 2005-2020 Marc Penninga. + Copyright (C) 2005-2021 Marc Penninga. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -34,13 +34,14 @@ use strict; use warnings; use Cwd (); +use File::Basename (); use File::Path (); use File::Spec (); use Getopt::Long (); use Pod::Usage (); use POSIX (); -my $VERSION = '20201218'; +my $VERSION = '20210401'; my ($d, $m, $y) = (localtime time)[3 .. 5]; my $TODAY = sprintf "%04d/%02d/%02d", $y + 1900, $m + 1, $d; @@ -641,15 +642,14 @@ sub _parse_metadata { $data->{family} =~ s/(\d)/$DIGITS[$1]/xmsge; $data->{family} =~ s/[^A-Za-z]+//xmsg; - if ($data->{family} =~ m/\A DTL/xms) { - $data->{family} =~ s/\A DTL//xms; - $data->{subfamily} =~ s/\A (?: ST | T)//xms; + if ($data->{family} =~ s/\A DTL//xms) { + $data->{subfamily} =~ s/\A (?: ST | T | SD | D)//xms; } # remove Adobe's SmallText size, to avoid mistaking it for Text weight - $data->{family} =~ s/(?: SmallText | SmText )\z//xmsi; - $data->{subfamily} =~ s/(?: SmallText | SmText )\z//xmsi; - $data->{fullname} =~ s/(?: SmallText | SmText )\z//xmsi; + for my $fieldname (qw(family subfamily fullname)) { + $data->{$fieldname} =~ s/(?: SmallText | SmText )\z//xmsi; + } # Sometimes the relevant info is in Fullname, sometimes in Subfamily; # so we need to test against both @@ -2272,7 +2272,7 @@ sub create_command { return join q( ), 'otftotfm', '--automatic', - "--encoding=$workitem->{enc_file}", + "--encoding='$workitem->{enc_file}'", $targetdirs, '--no-updmap', '--force', @@ -2676,12 +2676,11 @@ sub process_encoding_options { # All specified encodings should either be built-in, # or have an accompanying .enc file in the current directory. - $ARGV{encoding} =~ s/\s+//xmsg; my @encodings = split /,/, $ARGV{encoding}; for my $enc (@encodings) { if ($enc !~ m/\A(OT1|T1|TS1|LY1|LGR|T2[ABC]|T3|TS3)\z/xmsi) { my $try = $enc; - $try .= '.enc' if $try !~ m/[.]enc\z/xms; + $try .= '.enc' if $try !~ m/[.]enc\z/xmsi; if (!-e $try) { die "[ERROR] No .enc file found for '$enc'"; } @@ -3052,9 +3051,11 @@ sub cleanup { # 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/xms; + $try .= '.enc' if $try !~ m/[.]enc\z/xmsi; if (-e $try) { $workitem->{enc_file} = $try; + $workitem->{encoding} + = File::Basename::basename($try, '.enc', '.ENC'); } else { ($workitem->{enc_file} = $workitem->{encoding}) @@ -3256,7 +3257,7 @@ OpenType fonts in LaTeX, but they can be hard to use: they need many, often long, command lines and don't generate the F and F files LaTeX needs. B simplifies the use of the I for font installation -by generating and executing all commands for I +by generating and executing all commands for I, and by creating and installing all necessary F and F files. Given a family of font files (in F or F format), @@ -3298,7 +3299,7 @@ Swash =item I -`Upright swash' +"Upright swash" =back @@ -3316,16 +3317,16 @@ in roman, italic and slanted shapes. =item - -Families with `Titling' characters; -these `... replace the default glyphs +Families with "Titling" characters; +these "... replace the default glyphs with corresponding forms designed specifically for titling. These may be all-capital and/or larger on the body, -and adjusted for viewing at larger sizes' +and adjusted for viewing at larger sizes" (according to the OpenType Specification). =item - -An ornament family, also in roman, italic and slanted shapes. +An ornament family; also in roman, italic and slanted shapes. =back @@ -3384,20 +3385,20 @@ numerators and denominators The individual fonts are named I<< --- >>, where I<< >> is the same as above (but in lowercase), -I<< >> is either empty, `sc' or `swash', +I<< >> is either empty, "sc" or "swash", and I<< >> is the encoding (also in lowercase). -A typical name in this scheme would be `FiraSans-Light-osf-sc-ly1'. +A typical name in this scheme would be I. =head2 Using the fonts in your LaTeX documents B generates a style file for using the fonts in LaTeX documents, -named F<< .sty >>. This style file also takes care of loading -the F and F packages. +named F<< .sty >>. This style file also loads the F +and F packages, if necessary. To use the fonts, add the command C<<< \usepackage{I<< >>} >>> to the preamble of your document. -This style file defines a number of options: +This style file has a few options: =over 4 @@ -3413,7 +3414,7 @@ yourself. =item C, C, C, C Choose which figure style to use. -The defaults are `oldstyle' and `proportional' (if available). +The defaults are "oldstyle" and "proportional" (if available). =item C<<< scale=I<< >> >>>, C @@ -3421,25 +3422,25 @@ Scale the font by a factor of I<< >>. E.g., to increase the size of the font by 5%, use C<<< \usepackage[scale=1.05]{I<< >>} >>>. The special value C may be used to scale the font -so that its x-height matches that of the previously active font -(which is usually Computer Modern, unless you have loaded another -font package before this one). +so that its x-height matches that of the current main font +(which is usually Computer Modern Roman, unless you have loaded +another font package before this one). The name C may be used as a synonym for C. =item C, C, C, C, C -Select the weight that LaTeX will use as the `regular' weight. +Select the weight that LaTeX will use as the "regular" weight. =item C, C, C, C, C, C -Select the weight that LaTeX will use as the `bold' weight. +Select the weight that LaTeX will use as the "bold" weight. =back The last two groups of options will only work if you have the F package installed. The default here is not to change LaTeX's default, -i.e. use the `m' and `b' weights. +i.e. use the "m" and "b" weights. The style file will also try to load the F package (on CTAN), which gives easy access to various font shapes and styles. @@ -3457,9 +3458,9 @@ characters: \inffigures \textinferior \textinf, \textin -In addition, the C<\swshape> and C<\textsw> commands are redefined to place -swash on F' secondary shape axis (F places it on the -primary shape axis) to make them behave properly when nested, so that +In addition, the existing C<\swshape> and C<\textsw> commands are redefined +to place swash on F' secondary shape axis (F places it +on the primary shape axis) to make them behave properly when nested, so that C<\swshape\upshape> will give upright swash. There are no commands for accessing the numerator and denominator @@ -3467,8 +3468,8 @@ fonts; these can be selected using F' standard commands, e.g., C<\fontfigurestyle{numerator}\selectfont>. These commands are only generated for existing shapes and number styles; -no commands are generated for shapes and styles that don't exist, -or whose generation was turned off by the user. +no commands are generated for shapes and styles that are missing from +your fonts. Also these commands are built on top of F, so if that package cannot be found, you're limited to using the lower-level commands from standard NFSS (C<\fontfamily>, C<\fontseries>, C<\fontshape> etc.). @@ -3499,13 +3500,13 @@ Use these fonts for the maths in your document. =item C, C Choose which figure style to use in maths. -The default is `mathlining'. +The default is "mathlining". =item C Use the swash characters from your fonts as the C<\mathcal> alphabet. -(This option only exists if your fonts actually contain swash characters -and a C feature to access them). +(This option will only exist if your fonts actually contain swash characters, +plus a C feature to access them). =item C @@ -3513,7 +3514,7 @@ Don't redeclare greek letters in math. =item C<<< math-style=I<<