summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2012-01-19 04:48:20 +0000
committerNorbert Preining <preining@logic.at>2012-01-19 04:48:20 +0000
commit61ced79f31735b7e345e4414a0ef5e07ae461634 (patch)
treeaa41f42ed7014875f15b5ba31632d3ff51f95320
parent456eaad11372914b0ac168b2c14049be1438cb1a (diff)
support kanjiVariant in updmap.pl
git-svn-id: svn://tug.org/texlive/trunk@25151 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/tetex/ChangeLog4
-rwxr-xr-xBuild/source/texk/tetex/updmap.pl38
2 files changed, 36 insertions, 6 deletions
diff --git a/Build/source/texk/tetex/ChangeLog b/Build/source/texk/tetex/ChangeLog
index 16726b04c63..a611278f2cd 100644
--- a/Build/source/texk/tetex/ChangeLog
+++ b/Build/source/texk/tetex/ChangeLog
@@ -1,6 +1,8 @@
2012-01-19 Norbert Preining <preining@logic.at>
- * updmap.pl: allow --enable Map foo.map again
+ * updmap.pl:
+ . allow --enable Map foo.map again
+ . support kanjiVariant options and replacement
2011-12-12 Karl Berry <karl@tug.org>
diff --git a/Build/source/texk/tetex/updmap.pl b/Build/source/texk/tetex/updmap.pl
index 01d03f0d5d2..da9202fb431 100755
--- a/Build/source/texk/tetex/updmap.pl
+++ b/Build/source/texk/tetex/updmap.pl
@@ -58,6 +58,7 @@ my $dvipsDownloadBase35;
my $pdftexDownloadBase14;
my $pxdviUse;
my $kanjiEmbed;
+my $kanjiVariant;
my $dvips35;
my $pdftex35;
@@ -127,7 +128,8 @@ Commands:
--showoptions ITEM show alternatives for options
--setoption OPTION VALUE set option, where OPTION is one of:
LW35, dvipsPreferOutline, dvipsDownloadBase35,
- pdftexDownloadBase14, pxdviUse, or kanjiEmbed
+ pdftexDownloadBase14, pxdviUse, kanjiEmbed,
+ or kanjiVariant
--setoption OPTION=VALUE as above, just different syntax
--enable MAPTYPE MAPFILE add "MAPTYPE MAPFILE" to updmap.cfg,
where MAPTYPE is one of: Map, MixedMap, KanjiMap
@@ -163,6 +165,7 @@ Explanation of the --setoption possibilities:
ADOBEkb Adobe fonts with "berry" filenames (e.g. phvbo8an.pfb)
ADOBE Adobe fonts with "vendor" filenames (e.g. hvnbo___.pfb)
kanjiEmbed (any string)
+ kanjiVariant (any string)
These options are only read and acted on by updmap; dvips, pdftex, etc.,
do not know anything about them. They work by changing the default map
@@ -644,7 +647,7 @@ m/^(dvipsPreferOutline|dvipsDownloadBase35|(pdftex|dvipdfm)DownloadBase14|pxdviU
if ($val !~ m/^(true|false)$/) {
die "$0: Invalid value $val for option $opt; should be \"true\" or \"false\".\n";
}
- } elsif ($opt eq "kanjiEmbed"){
+ } elsif ($opt eq "kanjiEmbed" || $opt eq "kanjiVariant"){
# do nothing
} else {
die "$0: Unsupported option $opt (value given: $val).\n";
@@ -670,12 +673,12 @@ sub showOptions {
m/(dvipsPreferOutline|(dvipdfm|pdftex)DownloadBase14|dvipsDownloadBase35|pxdviUse)/) {
print "true false\n";
}
- elsif ($item eq "kanjiEmbed") {
+ elsif ($item eq "kanjiEmbed" || $item eq "kanjiVariant") {
print "(any string)\n";
}
else {
print "Unknown item \"$item\"; should be one of LW35, dvipsPreferOutline,\n"
- . " dvipsDownloadBase35, pdftexDownloadBase14, pxdviUse or kanjiEmbed\n";
+ . " dvipsDownloadBase35, pdftexDownloadBase14, pxdviUse, kanjiEmbed, or kanjiVariant\n";
}
}
exit 0
@@ -802,9 +805,28 @@ sub catMaps {
map{
$_ =~ s/\#.*//;
$_ =~ s/\@kanjiEmbed@/$kanjiEmbed/;
+ $_ =~ s/\@kanjiVariant@/$kanjiVariant/;
$_ =~ s/\s*([^\s]*)\s*([^\s]*)/$2/;
} @maps;
- @maps = sort(@maps);
+
+ my @newmaps;
+ for my $m (@maps) {
+ if ($m =~ m/\@kanjiEmbed@/ || $m =~ m/\@kanjiVariant@/) {
+ my $newm = $m;
+ $newm =~ s/\@kanjiEmbed@/$kanjiEmbed/;
+ $newm =~ s/\@kanjiVariant@/$kanjiVariant/;
+ my $mf = `kpsewhich --format=map $newm`;
+ chomp($mf);
+ if (!$mf) {
+ print "$0: generated map $newm (from $m) does not exists, not activating it!\n";
+ } else {
+ push @newmaps, $newm;
+ }
+ } else {
+ push @newmaps, $m;
+ }
+ }
+ @maps = sort(@newmaps);
@maps = grep { ++$count{$_} < 2; } @maps;
@maps = &locateMap(@maps);
@@ -821,6 +843,8 @@ sub listMaps {
my @paths;
$kanjiEmbed = &cfgval("kanjiEmbed");
$kanjiEmbed = "noEmbed" unless (defined $kanjiEmbed);
+ $kanjiVariant = &cfgval("kanjiVariant");
+ $kanjiVariant = "" unless (defined $kanjiVariant);
my @lines = grep {
if ($what eq 'sync') {
@@ -835,6 +859,7 @@ sub listMaps {
map { print "$_\n"; } @lines;
} else {
map { $_ =~ s/\@kanjiEmbed@/$kanjiEmbed/ } @lines;
+ map { $_ =~ s/\@kanjiVariant@/$kanjiVariant/ } @lines;
@mapfiles=grep { $_ =~ s/^(\#! *)?(Mixed|Kanji)?Map\s+// } @lines;
@paths=&locateMap(@mapfiles);
@@ -984,6 +1009,9 @@ sub mkMaps {
$kanjiEmbed = &cfgval("kanjiEmbed");
$kanjiEmbed = "noEmbed" unless (defined $kanjiEmbed);
+ $kanjiVariant = &cfgval("kanjiVariant");
+ $kanjiVariant = "" unless (defined $kanjiVariant);
+
$pxdviUse = &cfgval("pxdviUse");
$pxdviUse = 0 unless (defined $pxdviUse);