summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-30 18:09:21 +0000
committerKarl Berry <karl@freefriends.org>2010-04-30 18:09:21 +0000
commit0e290b30838946f452aa3ea2fd58654e9cc68b1e (patch)
treec9f3189279b8ab9b36f6fedd7b1407e8fdc2eeac /Master/texmf-dist/scripts
parent11b46b2232dae52dc269537ca46f392a0f1690f7 (diff)
fontools update (29apr10)
git-svn-id: svn://tug.org/texlive/trunk@18055 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-xMaster/texmf-dist/scripts/fontools/autoinst143
1 files changed, 100 insertions, 43 deletions
diff --git a/Master/texmf-dist/scripts/fontools/autoinst b/Master/texmf-dist/scripts/fontools/autoinst
index 0db4b22e5b7..5c31de73c06 100755
--- a/Master/texmf-dist/scripts/fontools/autoinst
+++ b/Master/texmf-dist/scripts/fontools/autoinst
@@ -112,6 +112,7 @@ my %FD_WIDTH = (
ultracondensed => 'uc',
extracondensed => 'ec',
condensed => 'c',
+ cond => 'c',
semicondensed => 'sc',
regular => '',
semiextended => 'sx',
@@ -331,10 +332,6 @@ END_PARSE_ERROR
$already_seen{$unique} = $filename;
}
- # Pretend all fonts have kerning feature;
- # otftotfm will use the kern table otherwise
- $fontinfo{features}{kern} = 1;
-
FIGURE_STYLE:
for my $figure_style (keys %FIGURE_STYLE) {
@@ -550,19 +547,19 @@ END_GENERAL_PARSE_ERROR
end_fd_file($FD) if $fd_prev[0];
- # Remove the --no-updmap option from the last command for each family
- map { $_->[-1] =~ s/--no-updmap//xms } values %commands;
-
# Print or execute the generated commands
if ($ARGV{manual}) {
while (my ($fam, $cmds_ref) = each %commands) {
open my $BAT, '>', "$fam.bat"
or die "ERROR: can't create '$fam.bat' - $!";
- map { print {$BAT} "$_\n" } @{$cmds_ref};
+ print {$BAT} "$_\n" for @{$cmds_ref};
close $BAT;
}
}
else {
+ # Remove the --no-updmap option from the last command for each family
+ map { $_->[-1] =~ s/--no-updmap//xms } values %commands;
+
for my $cmds_ref (values %commands) {
for my $cmd (@{$cmds_ref}) {
print "$cmd\n";
@@ -788,6 +785,17 @@ sub read_font_info {
}
close $OTFINFO;
+ # Check if there's a "kern" table
+ open $OTFINFO, '-|',"otfinfo --tables \"$fontfile\""
+ or die "ERROR: 'otfinfo --tables \"$fontfile\"' failed";
+ for my $line (<$OTFINFO>) {
+ if ($line =~ m/\d+ \s+ (\w{4}) \s+/xms && $1 eq 'kern') {
+ $fontinfo{features}{kern} = 1;
+ last;
+ }
+ }
+ close $OTFINFO;
+
if ($ARGV{verbose}) {
print <<"END_FONT_INFO";
@@ -868,15 +876,16 @@ sub make_ornament_encoding {
sub write_style_file {
my ($family, $safe, @fd_data) = @_;
- my (%seen_enc, %seen_style, %seen_series);
+ my (%seen_enc, %seen_style, %seen_series, %seen_shape);
LINE:
for my $line_ref (@fd_data) {
- my ($fam, $enc, $style, $series) = @{$line_ref}[0 .. 3];
+ my ($fam, $enc, $style, $series, $shape) = @{$line_ref}[0 .. 4];
next LINE if $fam ne $family;
$seen_enc{$enc} = 1;
$seen_style{$style} = 1;
$seen_series{$series} = 1;
+ $seen_shape{$shape} = 1;
}
open my $STYLE, '>', "$family.sty"
@@ -895,9 +904,13 @@ END_STY_HEADER
print {$STYLE} "\\RequirePackage[$textenc]{fontenc}\n" if $textenc;
print {$STYLE} "\\RequirePackage{textcomp}\n" if $seen_enc{TS1};
- print {$STYLE} <<'END_STY_FONTAXES';
+ print {$STYLE} <<'END_STY_FONTAXES_START';
\IfFileExists{fontaxes.sty}{
\RequirePackage{fontaxes}
+END_STY_FONTAXES_START
+
+ if ($seen_shape{tl} || $seen_shape{tlit}) {
+ print {$STYLE} <<'END_STY_FONTAXES_TL';
\providecommand{\tldefault}{tl}
\DeclareRobustCommand\tlshape{\not@math@alphabet\tlshape\relax
\fontsecondaryshape\tldefault\selectfont}
@@ -906,11 +919,21 @@ END_STY_HEADER
\fa@naming@exception{shape}{{n}{tl}}{tl}
\fa@naming@exception{shape}{{it}{tl}}{tlit}
+END_STY_FONTAXES_TL
+ }
+
+ if ($seen_shape{nw} || $seen_shape{sw}) {
+ print {$STYLE} <<'END_STY_FONTAXES_SW';
\DeclareRobustCommand\swshape{\not@math@alphabet\swshape\relax
\fontprimaryshape\itdefault\fontsecondaryshape\swdefault\selectfont}
\fa@naming@exception{shape}{{n}{sw}}{nw}
\fa@naming@exception{shape}{{it}{sw}}{sw}
+END_STY_FONTAXES_SW
+ }
+
+ if ($seen_style{Sup}) {
+ print {$STYLE} <<'END_STY_FONTAXES_SUP';
\fa@naming@exception{figures}{{superior}{proportional}}{Sup}
\fa@naming@exception{figures}{{superior}{tabular}}{Sup}
\def\sufigures{\@nomath\sufigures
@@ -918,6 +941,11 @@ END_STY_HEADER
\DeclareTextFontCommand{\textsu}{\sufigures}
\let\textsuperior\textsu
+END_STY_FONTAXES_SUP
+ }
+
+ if ($seen_style{Inf}) {
+ print {$STYLE} <<'END_STY_FONTAXES_INF';
\fa@naming@exception{figures}{{inferior}{proportional}}{Inf}
\fa@naming@exception{figures}{{inferior}{tabular}}{Inf}
\def\infigures{\@nomath\infigures
@@ -925,6 +953,11 @@ END_STY_HEADER
\DeclareTextFontCommand{\textin}{\infigures}
\let\textinferior\textin
+END_STY_FONTAXES_INF
+ }
+
+ if ($seen_style{Orn}) {
+ print {$STYLE} <<'END_STY_FONTAXES_ORN';
\fa@naming@exception{figures}{{ornament}{proportional}}{Orn}
\fa@naming@exception{figures}{{ornament}{tabular}}{Orn}
\def\ornaments{\@nomath\ornaments
@@ -932,14 +965,29 @@ END_STY_HEADER
\DeclareTextFontCommand{\textornaments}{\ornaments}
\providecommand{\ornament}[1]{\textornaments{\char##1}}
+END_STY_FONTAXES_ORN
+ }
+
+ if ($seen_style{Numr}) {
+ print {$STYLE} <<'END_STY_FONTAXES_NUMR';
\fa@naming@exception{figures}{{numerators}{proportional}}{Numr}
\fa@naming@exception{figures}{{numerators}{tabular}}{Numr}
+END_STY_FONTAXES_NUMR
+ }
+
+ if ($seen_style{Dnom}) {
+ print {$STYLE} <<'END_STY_FONTAXES_DNOM';
\fa@naming@exception{figures}{{denominators}{proportional}}{Dnom}
\fa@naming@exception{figures}{{denominators}{tabular}}{Dnom}
+
+END_STY_FONTAXES_DNOM
+ }
+
+ print {$STYLE} <<'END_STY_FONTAXES_END';
}{}
-END_STY_FONTAXES
+END_STY_FONTAXES_END
print {$STYLE} <<"END_STY_XKEYVAL";
\\IfFileExists{xkeyval.sty}{
@@ -1088,10 +1136,12 @@ automatic mode) is quite complicated because it needs lots of long
command lines and doesn't generate the F<fd> and F<sty> files LaTeX needs.
B<autoinst> simplifies the font installation
process by generating and executing all commands for F<otftotfm>
-and by creating all necessary F<fd> and F<sty> files. All the user then needs
+and by creating all necessary F<fd> and F<sty> files.
+
+All the user then needs
to do is move these files to a suitable location
-(C<< $LOCALTEXMF/tex/latex/<Supplier>/<FontFamily>/ >> being the
-canonical choice) and update TeX's filename database.
+(F<< $LOCALTEXMF/tex/latex/<Supplier>/<FontFamily>/ >> is the
+official choice) and update TeX's filename database.
Given a family of font files (in either F<.ttf> or F<.otf> format),
B<autoinst> will create several LaTeX font families:
@@ -1230,8 +1280,7 @@ A typical name in this scheme is F<MinionPro-Regular-osf-sc-ly1>.
By default, all text families use the LY1 encoding. This has been chosen
over T1 (Cork) because many OpenType fonts contain additional ligatures
such as fj and Th, and LY1 has a number of empty slots to accommodate these.
-
-A different encoding can be selected using the B< --encoding>
+Different encodings can be selected using the B< --encoding>
command line option (see below).
@@ -1281,8 +1330,8 @@ shapes and styles. This package can be downloaded from the project's homepage
(F<http://developer.berlios.de/projects/minionpro>) or directly through
the CVS web interface
(F<http://cvs.berlios.de/cgi-bin/viewcvs.cgi/minionpro/MinionPro/tex/>),
-and is also available from CTAN as part of the archive F<base-v2.zip>
-(F<http://www.ctan.org/tex-archive/fonts/minionpro/base-v2.zip>).
+and is also available from CTAN as part of the archive F<metrics-base.zip>
+(F<http://www.ctan.org/tex-archive/fonts/minionpro/metrics-base.zip>).
Using the machinery set up by F<fontaxes>, the generated style file
also defines a few commands (which take the text to be typeset as argument)
@@ -1318,11 +1367,14 @@ running LaTeX on the file F<nfssfont.tex> (part of a standard
LaTeX installation) and specifying the ornament font
(e.g., I<MinionPro-Regular-orn-u>).
+These commands are only generated for shapes and number styles
+that actually exist; no commands are generated for shapes and styles
+that don't exist, or whose generation has been turned off.
+
This whole machinery builds on F<fontaxes>; if that package cannot be found,
the style file doesn't provide high-level access to the more `exotic'
font shapes and styles. In that case, you're limited to using the lower-level
-commands from standard NFSS, or even plain TeX's C<\font> primitive
-(and it's called `primitive' for a reason!)
+commands from standard NFSS.
=head2 Using multiple font families in one document
@@ -1337,8 +1389,6 @@ of B<autoinst> may not be able to coexist peacefully.
=head2 NFSS codes
In NFSS, weight and width are concatenated into a single `series' attribute.
-(I<Note:> versions of B<autoinst> before 2007-07-27 erroneously formed
-the series as `width plus weight' instead of the reverse.)
B<autoinst> maps widths, weights and shapes to NFSS codes using
the following tables. These are based on the tables in Lehman's
F<Font Installation Guide>, but some changes had to be made to avoid
@@ -1399,11 +1449,10 @@ cannot find a writable F<texmf> directory and leave all generated F<tfm>,
F<vf>, F<enc> and F<map> files in the current working directory.
In that case, you need to move these to their correct destinations.
You also need to tell the dvi-driver (F<dvips>, F<dvipdfm>, F<pdfTeX> etc.)
-about the new font map files; this usually means editing some
-configuration file.
+about the new font map files; see the documentation for how this is done.
-Furthermore, some OpenType fonts lead to F<pl> and F<vpl> files that are too
-big for MiKTeX's F<pltotf> and F<vptovf>; the versions that come with TeXLive
+Also, some OpenType fonts lead to F<pl> and F<vpl> files that are too
+big for MiKTeX's F<pltotf> and F<vptovf>; the versions from TeXLive
(F<http://tug.org/ftp/texlive/Contents/live/bin/win32/>) don't have this
problem.
@@ -1519,24 +1568,22 @@ being interpreted as options to B<autoinst>, it should be properly quoted.
Eddie Kohler's TypeTools (F<http://www.lcdf.org/type>).
Perl is usually pre-installed on Linux and Unix systems;
-for Windows, good (and free) Perl implementations are
-Strawberry Perl (F<http://strawberryperl.com>) and
-ActivePerl (available from F<http://www.activestate.com>);
+on Windows, try ActivePerl (available from F<http://www.activestate.com>)
+or Strawberry Perl (F<http://strawberryperl.com>).
-John Owens' F<otfinst> (F<http://www.ece.ucdavis.edu/~jowens/code/otfinst/>;
-also available from CTAN) is another wrapper around F<otftotfm>,
-and may work for you when B<autoinst> doesn't.
+XeTeX (F<http://www.tug.org/xetex>) is an extension of TeX
+that can natively use any font installed in the operating system
+(including both flavours of OpenType fonts)
+without additional support files.
-Ready-made support files for MinionPro, providing more options and features
-than B<autoinst> ever will (including math), are available from
-F<http://developer.berlios.de/projects/minionpro/>.
+John Owens' F<otfinst> (available from CTAN) is another wrapper
+around F<otftotfm>, and may work when B<autoinst> doesn't.
-XeTeX (F<http://scripts.sil.org/xetex>) is a TeX extension that can use
-any font installed in the operating system (including both flavours of
-OpenType fonts) without additional support files.
-It also isn't hindered by standard TeX's limitation to 8-bit fonts,
-so it is especially well suited to fonts with many ligatures and
-alternate glyphs, such as Bickham, Poetica and Zapfino.
+The MinionPro for LaTeX project
+(F<http://developer.berlios.de/projects/minionpro/>, also on CTAN)
+developed very complete support files for Minion Pro (including math),
+but the project appears to have been abandoned;
+these files don't work with recent versions of Minion Pro.
=head1 AUTHOR
@@ -1564,7 +1611,6 @@ it under the terms of the GNU General Public License
as published by the Free Software Foundation,
either version 2 of the License, or (at your option)
any later version.
-
A copy of the GNU General Public License is included with the I<fontools>
collection; see the file F<GPLv2.txt>.
@@ -1584,6 +1630,17 @@ GNU General Public License for more details.
=over 12
+=item I<2010-04-29>
+
+The C< --feature=kern> option is only used for fonts that
+contain either a I<kern> feature or a I<kern> table.
+Font feature selection commands in the F<.sty> file are only
+generated for shapes and figure styles that are supported
+by the current font, and whose generation has not been
+turned off using the command line options.
+Fixed the font info parsing to work with the Condensed fonts
+in the Minion Pro family.
+
=item I<2010-04-23>
Always provide the C< --feature=kern> option to F<otftotfm>,