From d4c8352975ac08a69cb1e14a355a0451e0d6ddbe Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 15 Oct 2012 17:40:54 +0000 Subject: fontools git-svn-id: svn://tug.org/texlive/trunk@27975 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/fontools/autoinst | 173 ++++++++++++++++++---------- 1 file changed, 110 insertions(+), 63 deletions(-) (limited to 'Master/texmf-dist/scripts/fontools') diff --git a/Master/texmf-dist/scripts/fontools/autoinst b/Master/texmf-dist/scripts/fontools/autoinst index 4b3d50fa935..79fb13a9b19 100755 --- a/Master/texmf-dist/scripts/fontools/autoinst +++ b/Master/texmf-dist/scripts/fontools/autoinst @@ -421,7 +421,7 @@ sub make_commands { my @commands = map { make_cmdline($_) } @worklist; # make sure the last command *does* call updmap - $commands[-1] =~ s/--no-updmap//xms; + $commands[-1] =~ s/--no-updmap//xms if $ARGV{updmap}; if ($ARGV{manual}) { open my $BAT, '>', 'autoinst.bat' @@ -486,12 +486,16 @@ sub set_targetdirs { my $family = shift; my %dir = map { ($_ => File::Spec->catdir( - $ARGV{target}, 'fonts', $_, 'lcdftools', $family)) + $ARGV{target}, + 'fonts', + $_, + $ARGV{vendor}, + $ARGV{typeface} || $family)) } qw(tfm vf pl vpl type1 truetype type42); $dir{$_} = File::Spec->catdir( - $ARGV{target}, 'fonts', $_, 'dvips', 'lcdftools') + $ARGV{target}, 'fonts', $_, 'dvips', $ARGV{vendor}) for qw(enc map); File::Path::make_path(values %dir); @@ -531,18 +535,24 @@ Possible options: -sanserif Install font as sanserif font -typewriter Install font as typewriter font + -extra="TEXT" Add TEXT to the command line for 'otftotfm' -target="DIRECTORY" Install files into specified TEXMF tree + -vendor="VENDOR" Specify part of directory name for installation + -typeface="TYPEFACE" Specify part of directory name for installation + -(no)updmap Toggle running of updmap + -manual Manual mode (see documentation) - + -(no)figurekern Keep or remove kerns between tabular figures - -help Print this text - -verbose Make some noise + -help Prints this text and exit + -verbose Prints detailed info about operation font[s] The fonts (either .otf or .ttf) to install. Please report any bugs or suggestions to . + END_USAGE # Default values for the command-line arguments @@ -559,6 +569,9 @@ END_USAGE nfss => 'rm', extra => '', target => '', + vendor => 'lcdftools', + typeface => '', + updmap => '1', # 0 = no, 1 = yes manual => '0', # 0 = no, 1 = yes verbose => '0', # 0 = no, 1 = yes figurekern => '1', # 0 = no, 1 = yes @@ -585,6 +598,9 @@ sub parse_options { 'typewriter' => sub { $ARGV{nfss} = 'tt' }, 'extra=s' => \$ARGV{extra}, 'target=s' => \$ARGV{target}, + 'vendor=s' => \$ARGV{vendor}, + 'typeface=s' => \$ARGV{typeface}, + 'updmap!' => \$ARGV{updmap}, 'manual' => \$ARGV{manual}, 'figurekern!' => \$ARGV{figurekern}, 'verbose' => \$ARGV{verbose}, @@ -717,7 +733,7 @@ $info->{filename} END_FONTINFO } - + return $info; } @@ -1002,7 +1018,8 @@ sub write_stylefile { my %seen = %{ get_keys($data) }; my $fn = sprintf "%s.sty", $fam; - my $dir = File::Spec->catdir($ARGV{target}, 'tex', 'latex', $fam); + my $dir = File::Spec->catdir( + $ARGV{target}, 'tex', 'latex', $ARGV{typeface} || $fam); File::Path::make_path($dir); $fn = File::Spec->catfile($dir, $fn); open my $STY, '>', $fn or die "[ERROR] Can't create '$fn': $!"; @@ -1204,7 +1221,8 @@ sub write_fdfile { my ($fam, $enc, $sty, $data) = @_; my $fn = sprintf "%s%s-%s.fd", $enc, $fam, $sty; - my $dir = File::Spec->catdir($ARGV{target}, 'tex', 'latex', $fam); + my $dir = File::Spec->catdir( + $ARGV{target}, 'tex', 'latex', $ARGV{typeface} || $fam); File::Path::make_path($dir); $fn = File::Spec->catfile($dir, $fn); open my $FD, '>', $fn or die "[ERROR] Can't create '$fn': $!"; @@ -1300,8 +1318,8 @@ B will create several LaTeX font families: =item - -Four text families (with lining and oldstyle digits, in tabular and -proportional variants), each with the following shapes: +Four text families (with lining and oldstyle digits, in both tabular +and proportional variants), each with the following shapes: =over 2 @@ -1394,9 +1412,9 @@ tabular oldstyle figures =item I -superior characters (many fonts have only an incomplete set of superiors: -digits, punctuation and the letters I; -normal forms will be used for the other characters) +superior characters (many fonts have only an incomplete set of superior +characters: digits, some punctuation and the letters I; +normal forms will then be used for the other characters) =item I @@ -1509,8 +1527,8 @@ LaTeX installation) and supplying the name of the ornament font. To access the ornaments, B creates a font-specific encoding file F<< _orn.enc >>, but only if that file doesn't yet exist. -This means you can provide your own encoding vector, -e.g. if your fonts use non-standard glyph names for ornaments. +This is a deliberate feature that allows you to provide your own +encoding vector, e.g. if your fonts use non-standard glyph names for ornaments. These commands are only generated for shapes and number styles that actually exist; no commands are generated for shapes and styles @@ -1534,16 +1552,17 @@ NFSS identifies fonts by a combination of family, series (weight plus width), shape and size. B parses the output of C to determine these parameters. When this fails -(e.g., because the font family contains unusual widths or weights), +(e.g., because the font family contains uncommon widths or weights), B ends up with different fonts having the I values for the font parameters, which means that these fonts cannot be used in NFSS. B will then split the font family into multiple subfamilies -(based on the font's "Subfamily" value) and try again. -(Since many font families overdo the "Subfamily" by making each font -a separate subfamily, this strategy is only used as a last resort.) +(based on each font file's "Subfamily" value) and try again. +(Since many font families misunderstand the "Subfamily" concept +and make each font file a separate subfamily, +this strategy is only used as a last resort.) If this proliferation of font families is unwanted, -either rerun B on a smaller set of fonts (omitting the ones that +either run B on a smaller set of fonts (omitting the ones that failed to parse correctly) or else add the missing widths, weights and shapes to the tables C<%FD_WIDTH>, C<%FD_WEIGHT> and C<%FD_SHAPE>, near the top of the source code. @@ -1629,7 +1648,8 @@ and TeXLive (F) don't have this problem. You may use either one or two dashes before options, and option names may be shortened to a unique prefix -(e.g., B<-enc> instead of B<-encoding>). +(e.g., B<-encoding> may be abbreviated to B<-enc> or even B<-en>, +but B<-e> is ambiguous (B<-encoding>, B<-extra>). =over 4 @@ -1650,14 +1670,14 @@ specified, so the last one will be the default text encoding. Install the font as a sanserif font, accessed via C<\sffamily> and C<\textsf>. Note that the generated style file redefines C<\familydefault>, -so including it will still make this font the default text font. +so including it will make this font the default text font. =item B<-typewriter> Install the font as a typewriter font, accessed via C<\ttfamily> and C<\texttt>. Note that the generated style file redefines C<\familydefault>, -so including it will still make this font the default text font. +so including it will make this font the default text font. =item B<-ts1> @@ -1713,20 +1733,31 @@ The default is B<-nofractions>. Turn the creation of ornament fonts on or off. The default is B<-ornaments>. -=item B<-target>=I +=item B<-verbose> -Install all generated files into the TEXMF tree at I. +Verbose mode; print detailed info about what B thinks it's doing, +especially during font info parsing. -By default, B searches your $TEXMFLOCAL and $TEXMFHOME paths -and installs all files into subdirectories of the first writable TEXMF tree -it finds (or into subdirectories of the current directory, -if no writable directory is found). +=item B<-extra>=I + +Pass I as options to I. To prevent I from accidentily +being interpreted as options to B, it should be properly quoted. -B: this option gets overriden by the B<-manual> option! +=item B<-figurekern> + +=item B<-nofigurekern> + +Some fonts provide kerning pairs for tabular figures. +This is very probably unwanted (e.g., numbers in tables won't line up exactly). +The option B<-nofigurekern> adds extra I< --ligkern> options +to the command lines for I to suppress such kerns +(but only for the "TLF" and "TOsF" families). +Since this leads to very long command lines (it adds one hundred such options) +and the problem affects only few fonts, the default is however B<-figurekern>. =item B<-manual> -Manual mode. By default, B immediately executes all F +Manual mode. By default, B executes all F command lines it generates; with the B<-manual> option, these commands are instead written to a file F. Also, the generated F command lines specify the I< --pl> option @@ -1738,30 +1769,42 @@ them into your TEXMF tree). When using this option, you should run F and F after executing all commands, -to convert the F and F files to F and F format. +to convert the F and F files to F and F format. -B: this option overrides the B<-target> option! +=back -=item B<-verbose> +The following options are only meaningful in automatic mode, +and hence ignored in manual mode: -Verbose mode; print detailed info about what B thinks it's doing. +=over 4 -=item B<-extra>=I +=item B<-target>=I -Pass I as options to I. To prevent I from accidentily -being interpreted as options to B, it should be properly quoted. +Install all generated files into the TEXMF tree at I. -=item B<-figurekern> +By default, B searches your $TEXMFLOCAL and $TEXMFHOME paths +and installs all files into subdirectories of the first writable TEXMF tree +it finds (or into subdirectories of the current directory, +if no writable directory is found). -=item B<-nofigurekern> +=item B<-vendor>=I -Some fonts provide kerning pairs for tabular figures. -This is probably unwanted (e.g., numbers in tables won't line up exactly). -The option B<-nofigurekern> adds extra I< --ligkern> options -to the command lines for I to suppress such kerns -(but only for the "TLF" and "TOsF" families). -Since this leads to very long command lines (it adds one hundred such options) -and the problem affects only few fonts, the default is B<-figurekern>. +=item B<-typeface>=I + +These options are equivalent to F's I< --vendor> and I< --typeface> +options: they change the "vendor" and "typeface" parts of the names of the +subdirectories in the TEXMF tree where generated files will be stored. +The default values are "lcdftools" and the font's FontFamily name. + +Please note that these options change I directory names, +not the names of any generated files. + +=item B<-updmap> + +=item B<-noupdmap> + +Control whether or not F is called after the last call to F. +The default is B<-updmap>. =back @@ -1770,21 +1813,21 @@ and the problem affects only few fonts, the default is B<-figurekern>. Eddie Kohler's TypeTools (F). -Perl is pre-installed on most Linux and Unix systems; -on Windows, try ActiveState's ActivePerl -(available from F) -or Strawberry Perl (F). +The FontPro project (F) +offers very complete support for Adobe's Minion Pro and Myriad Pro +(including math), and is currently working on Cronos Pro as well. XeTeX (F) and LuaTeX (F) are TeX extensions that can use any font (including both flavours of OpenType) without TeX-specific support files. John Owens' F (available from CTAN) is another wrapper -around F, and may work when B doesn't. +around F, and may work for you when B doesn't. -The FontPro project (F) -offers very complete support for Adobe's Minion Pro and Myriad Pro -(including math), and is currently working on Cronos Pro as well. +Perl is pre-installed on most Linux and Unix systems; +on Windows, try ActiveState's ActivePerl +(available from F) +or Strawberry Perl (F). =head1 AUTHOR @@ -1827,6 +1870,10 @@ GNU General Public License for more details. =over 12 +=item I<2012-10-03> + +Added the I<-vendor>, I<-typeface> and I<-(no)updmap> command line options. + =item I<2012-07-06> Documentation update. @@ -1855,6 +1902,13 @@ Generate OT1, T1 and LY1 encoded text fonts by default. Made I<-titling> a default option (instead of I<-notitling>). Updated the documentation. +=back + + +=begin Really_old_history + +=over 12 + =item I<2011-06-15> Fixed the font info parsing code for some fonts that are @@ -1893,13 +1947,6 @@ A small patch to the C subroutine: it now also recognises the I ornament glyphs in Adobe Kepler Pro. -=back - - -=begin Really_old_history - -=over 12 - =item I<2007-08-07> Fixed a small bug with filename quoting on Windows. -- cgit v1.2.3