summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-04-29 13:56:56 +0000
committerKarl Berry <karl@freefriends.org>2010-04-29 13:56:56 +0000
commit6cb4314d6d70e5f494f89b54f9279ab40fc15edd (patch)
treeee97fd1cf92762bce3e6935eb1cefe798b6ba574 /Master/texmf-dist/scripts
parentf7ccaa5d547012cb2beaaa0d0c1540d18eca1124 (diff)
fontools update (23apr10)
git-svn-id: svn://tug.org/texlive/trunk@18043 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-xMaster/texmf-dist/scripts/fontools/autoinst113
1 files changed, 79 insertions, 34 deletions
diff --git a/Master/texmf-dist/scripts/fontools/autoinst b/Master/texmf-dist/scripts/fontools/autoinst
index 7939246d91c..0db4b22e5b7 100755
--- a/Master/texmf-dist/scripts/fontools/autoinst
+++ b/Master/texmf-dist/scripts/fontools/autoinst
@@ -1,12 +1,16 @@
#!/usr/bin/perl
-=begin COPYRIGHT -------------------------------------------------------------
+=begin COPYRIGHT
- Copyright (c) 2005-2009 Marc Penninga.
+----------------------------------------------------------------------------
+
+ Copyright (C) 2005, 2006, 2007, 2009, 2010 Marc Penninga.
This program is free software; you can redistribute it and/or modify
- it under the terms of version 2 of the GNU General Public License
- as published by the Free Software Foundation.
+ 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -21,7 +25,9 @@
Boston, MA 02111-1307,
USA
-=end -------------------------------------------------------------------------
+----------------------------------------------------------------------------
+
+=end COPYRIGHT
=cut
@@ -64,7 +70,7 @@ Please report any bugs or suggestions to <marc@penninga.info>.
END_USAGE
-=begin Comment ---------------------------------------------------------------
+=begin Comment
The next three tables map the names of weights, widths and shapes
to NFSS codes. New entries can be added without problems,
@@ -78,7 +84,7 @@ END_USAGE
families that have both italic and oblique shapes, but I doubt
whether these exist (apart from Computer Modern, of course).
-=end
+=end Comment
=cut
@@ -121,7 +127,7 @@ my %FD_SHAPE = (
romanii => 'it', # Map one of Silentium Pro's two roman shapes to 'it'
);
-=begin Comment ---------------------------------------------------------------
+=begin Comment
The following tables are used for deciding which font families and shapes
to generate. Each hash governs one of these aspects:
@@ -165,7 +171,7 @@ my %FD_SHAPE = (
name A string added to the name of the generated font,
to make it unique.
-=end
+=end Comment
=cut
@@ -324,6 +330,10 @@ END_PARSE_ERROR
else {
$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) {
@@ -410,6 +420,15 @@ END_PARSE_ERROR
. "\"$CODING_SCHEME{$enc_name}\""
: ''),
(map { "--feature=$_" } @features),
+ # if there's no 'liga' feature,
+ # add ligkern commands for common ligatures
+ ((grep { $_ eq 'liga' } @features)
+ ? ''
+ : '--ligkern="f i =: fi" '
+ . '--ligkern="f l =: fl" '
+ . '--ligkern="f f =: ff" '
+ . '--ligkern="ff i =: ffi" '
+ . '--ligkern="ff l =: ffl" '),
$FIGURE_STYLE{$figure_style}{extra},
$SHAPE{$shape}{extra},
$ARGV{extra},
@@ -489,12 +508,25 @@ END_GENERAL_PARSE_ERROR
my $FD;
for my $fd_line_ref (@fd_data) {
my @fd_line = @{$fd_line_ref};
-
- write_style_file($fd_line[0], @fd_data) if $fd_line[0] ne $fd_prev[0];
+
+ my $safe = $fd_line[0];
+ $safe =~ s/1/One/xmsg;
+ $safe =~ s/2/Two/xmsg;
+ $safe =~ s/3/Three/xmsg;
+ $safe =~ s/4/Four/xmsg;
+ $safe =~ s/5/Five/xmsg;
+ $safe =~ s/6/Six/xmsg;
+ $safe =~ s/7/Seven/xmsg;
+ $safe =~ s/8/Eight/xmsg;
+ $safe =~ s/9/Nine/xmsg;
+ $safe =~ s/0/Zero/xmsg;
+
+ write_style_file($fd_line[0], $safe, @fd_data)
+ if $fd_line[0] ne $fd_prev[0];
if (grep { $fd_line[$_] ne $fd_prev[$_] } 0 .. 2) {
end_fd_file($FD) if $fd_prev[0];
- $FD = start_fd_file(@fd_line[0 .. 2]);
+ $FD = start_fd_file(@fd_line[0 .. 2], $safe);
}
if (grep { $fd_line[$_] ne $fd_prev[$_] } 0 .. 4) {
@@ -509,7 +541,7 @@ END_GENERAL_PARSE_ERROR
# Write fontshape entry
printf {$FD} " %s \\%s\@\@scale %s\n",
sprintf("%5s-%-5s", '<' . $fd_line[5], $fd_line[6] . '>'),
- $fd_line[0],
+ $safe,
$fd_line[7],
;
@@ -780,14 +812,14 @@ END_FONT_INFO
}
-=begin Comment ---------------------------------------------------------------
+=begin Comment
Ornament glyph names vary across fonts, so we generate font-specific
encoding vectors.
This is skipped if a file `<family>_orn.enc' is found in the current
directory, so the user can provide her own vector if she wants to.
-=end
+=end Comment
=cut
@@ -834,8 +866,8 @@ sub make_ornament_encoding {
# ------------------------------------------------------------------------
sub write_style_file {
- my ($family, @fd_data) = @_;
-
+ my ($family, $safe, @fd_data) = @_;
+
my (%seen_enc, %seen_style, %seen_series);
LINE:
@@ -911,9 +943,9 @@ END_STY_FONTAXES
print {$STYLE} <<"END_STY_XKEYVAL";
\\IfFileExists{xkeyval.sty}{
- \\newcommand*{\\$family\@scale}{1}
+ \\newcommand*{\\$safe\@scale}{1}
\\RequirePackage{xkeyval}
- \\DeclareOptionX{scaled}{\\renewcommand*{\\$family\@scale}{##1}}
+ \\DeclareOptionX{scaled}{\\renewcommand*{\\$safe\@scale}{##1}}
}{
\\let\\DeclareOptionX\\DeclareOption
\\let\\ExecuteOptionsX\\ExecuteOptions
@@ -924,19 +956,19 @@ END_STY_XKEYVAL
if ($seen_style{LF} or $seen_style{TLF}) {
print {$STYLE}
- "\\DeclareOptionX{lining}{\\edef\\$family\@figurestyle{LF}}\n";
+ "\\DeclareOptionX{lining}{\\edef\\$safe\@figurestyle{LF}}\n";
}
if ($seen_style{OsF} or $seen_style{TOsF}) {
print {$STYLE}
- "\\DeclareOptionX{oldstyle}{\\edef\\$family\@figurestyle{OsF}}\n";
+ "\\DeclareOptionX{oldstyle}{\\edef\\$safe\@figurestyle{OsF}}\n";
}
if ($seen_style{TLF} or $seen_style{TOsF}) {
print {$STYLE}
- "\\DeclareOptionX{tabular}{\\edef\\$family\@figurealign{T}}\n";
+ "\\DeclareOptionX{tabular}{\\edef\\$safe\@figurealign{T}}\n";
}
if ($seen_style{LF} or $seen_style{OsF}) {
print {$STYLE}
- "\\DeclareOptionX{proportional}{\\edef\\$family\@figurealign{}}\n";
+ "\\DeclareOptionX{proportional}{\\edef\\$safe\@figurealign{}}\n";
}
my $defaults
@@ -977,7 +1009,7 @@ END_STY_XKEYVAL
\\renewcommand*
{\\$ARGV{nfss}default}
- {$family-\\$family\@figurealign\\$family\@figurestyle}
+ {$family-\\$safe\@figurealign\\$safe\@figurestyle}
\\renewcommand*{\\familydefault}{\\$ARGV{nfss}default}
\\endinput
@@ -989,7 +1021,7 @@ END_STYLE_REST
# ------------------------------------------------------------------------
sub start_fd_file {
- my ($fam, $enc, $fig) = @_;
+ my ($fam, $enc, $fig, $safe) = @_;
open my $FD, '>', "$enc$fam-$fig.fd"
or die "ERROR: can't create '$enc$fam-$fig.fd' - $!";
@@ -1000,10 +1032,10 @@ sub start_fd_file {
\\ProvidesFile{$enc$fam-$fig.fd}
[$date (autoinst) Font definitions for $enc/$fam-$fig.]
-\\expandafter\\ifx\\csname $fam\@scale\\endcsname\\relax
- \\let\\$fam\@\@scale\\\@empty
+\\expandafter\\ifx\\csname $safe\@scale\\endcsname\\relax
+ \\let\\$safe\@\@scale\\\@empty
\\else
- \\edef\\$fam\@\@scale{s*[\\csname $fam\@scale\\endcsname]}%
+ \\edef\\$safe\@\@scale{s*[\\csname $safe\@scale\\endcsname]}%
\\fi
\\DeclareFontFamily{$enc}{$fam-$fig}{}
@@ -1517,19 +1549,21 @@ running B<autoinst> with the B< --verbose> option.
Please make sure that this output includes all error messages (if any);
this can be done using the command
- autoinst I<(... all options and files ...)> >autoinst.log 2>&1
+C<< autoinst I<(... all options and files ...)> E<gt>autoinst.log 2>&1 >>
=head1 COPYRIGHT
-Copyright (c) 2005-2009 Marc Penninga.
+Copyright (C) 2005, 2006, 2007, 2009, 2010 Marc Penninga.
=head1 LICENSE
This program is free software; you can redistribute it and/or modify
-it under the terms of version 2 of the GNU General Public License
-as published by the Free Software Foundation.
+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>.
@@ -1550,14 +1584,25 @@ GNU General Public License for more details.
=over 12
+=item I<2010-04-23>
+
+Always provide the C< --feature=kern> option to F<otftotfm>,
+even if the font doesn't have a I<kern> feature;
+this will make F<otftotfm> use the I<kern> table if present.
+For fonts without a I<liga> feature, add C< --ligkern>
+options for the common f-ligatures to the F<otftotfm> command line,
+so that any ligatures present in the font will still be used.
+Bug fix: the generated F<.sty> files now work for font families
+with names containing digits.
+
=item I<2009-04-09>
Prefixed the filenames of the included encoding files with
-`fontools_', to prevent name clashes with other packages.
+I<fontools_>, to prevent name clashes with other packages.
=item I<2009-04-06>
-A small patch to the make_ornament_encoding subroutine;
+A small patch to the C<make_ornament_encoding> subroutine;
it now also recognises the I<bullet.xxx> ornament glyphs
in Adobe's Kepler Pro.