summaryrefslogtreecommitdiff
path: root/Master/texmf/scripts
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2012-01-19 03:02:14 +0000
committerNorbert Preining <preining@logic.at>2012-01-19 03:02:14 +0000
commite42dd19488824735430ee669e24535de3ef0d104 (patch)
treed3edbddc175d1a3bf67b9e759907b3aa07efba96 /Master/texmf/scripts
parent5f2110d67731dfb4fa9f1b986929c20cced256ac (diff)
mupdmap:
- support for kanjiVariant - do not include a generated map file if it does not exist (set kanjiEmbed to foobarbaz will otherwise break) git-svn-id: svn://tug.org/texlive/trunk@25148 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-xMaster/texmf/scripts/texlive/mupdmap.pl57
1 files changed, 47 insertions, 10 deletions
diff --git a/Master/texmf/scripts/texlive/mupdmap.pl b/Master/texmf/scripts/texlive/mupdmap.pl
index e3da31309b4..9034d1953e6 100755
--- a/Master/texmf/scripts/texlive/mupdmap.pl
+++ b/Master/texmf/scripts/texlive/mupdmap.pl
@@ -132,6 +132,10 @@ my %settings = (
type => "any",
default => "noEmbed",
},
+ kanjiVariant => {
+ type => "any",
+ default => "",
+ },
);
&main();
@@ -386,6 +390,14 @@ sub main {
my @aaa = @{$alldata->{'order'}};
unshift @aaa, $changes_config_file;
$alldata->{'order'} = [ @aaa ];
+ #
+ # since things have changed, reread the whole updmap files
+ if ($changed) {
+ delete $alldata->{'updmap'};
+ delete $alldata->{'maps'};
+ read_updmap_files(@{$opts{'cnffile'}}) if $changed;
+ }
+ #
setupOutputDir("dvips");
setupOutputDir("pdftex");
setupOutputDir("dvipdfmx");
@@ -416,6 +428,8 @@ sub main {
print "$prg: Updating ls-R files.\n" if !$opts{'quiet'};
$updLSR->{exec}() unless $opts{"dry-run"};
}
+
+ return 0;
}
##################################################################
@@ -790,6 +804,7 @@ sub mkMaps {
get_cfg('pdftexDownloadBase14');
my ($pxdviUse, $pxdviUse_origin) = get_cfg('pxdviUse');
my ($kanjiEmbed, $kanjiEmbed_origin) = get_cfg('kanjiEmbed');
+ my ($kanjiVariant, $kanjiVariant_origin) = get_cfg('kanjiVariant');
print_and_log ("\n$prg is creating new map files"
. "\nusing the following configuration:"
@@ -805,6 +820,8 @@ sub mkMaps {
. "$pdftexDownloadBase14 ($pdftexDownloadBase14_origin)"
. "\n kanjiEmbed replacement string : "
. "$kanjiEmbed ($kanjiEmbed_origin)"
+ . "\n kanjiVariant replacement string : "
+ . "$kanjiVariant ($kanjiVariant_origin)"
. "\n create a mapfile for pxdvi : "
. "$pxdviUse ($pxdviUse_origin)"
. "\n\n");
@@ -1151,7 +1168,8 @@ sub setOptions {
my ($key,$val) = split (/=/, $o, 2);
die "$prg: unexpected empty key or val for options (@options), goodbye.\n"
- if !$key || !$val;
+ if !$key || !defined($val);
+
&setOption ($key, $val);
}
return save_updmap($alldata->{'changes_config'});
@@ -1543,22 +1561,32 @@ sub read_updmap_files {
merge_settings();
#
my ($kanjiEmbed, $kanjiEmbed_origin) = get_cfg('kanjiEmbed');
+ my ($kanjiVariant, $kanjiVariant_origin) = get_cfg('kanjiVariant');
#
# go through all map files and check that the text is properly replaced
+ # after the replacement check that the generated map file actually
+ # exists, we do NOT want to break in this case!
#
for my $l (@l) {
for my $m (keys %{$alldata->{'updmap'}{$l}{'maps'}}) {
- if ($m =~ m/\@kanjiEmbed@/) {
+ if ($m =~ m/\@kanjiEmbed@/ || $m =~ m/\@kanjiVariant@/) {
my $newm = $m;
$newm =~ s/\@kanjiEmbed@/$kanjiEmbed/;
- # now we have to update various linked items
- $alldata->{'updmap'}{$l}{'maps'}{$newm}{'type'} =
- $alldata->{'updmap'}{$l}{'maps'}{$m}{'type'};
- $alldata->{'updmap'}{$l}{'maps'}{$newm}{'status'} =
- $alldata->{'updmap'}{$l}{'maps'}{$m}{'status'};
- $alldata->{'updmap'}{$l}{'maps'}{$newm}{'line'} =
- $alldata->{'updmap'}{$l}{'maps'}{$m}{'line'};
- $alldata->{'updmap'}{$l}{'maps'}{$newm}{'original'} = $m;
+ $newm =~ s/\@kanjiVariant@/$kanjiVariant/;
+ if (locateMap($newm)) {
+ # now we have to update various linked items
+ $alldata->{'updmap'}{$l}{'maps'}{$newm}{'type'} =
+ $alldata->{'updmap'}{$l}{'maps'}{$m}{'type'};
+ $alldata->{'updmap'}{$l}{'maps'}{$newm}{'status'} =
+ $alldata->{'updmap'}{$l}{'maps'}{$m}{'status'};
+ $alldata->{'updmap'}{$l}{'maps'}{$newm}{'line'} =
+ $alldata->{'updmap'}{$l}{'maps'}{$m}{'line'};
+ $alldata->{'updmap'}{$l}{'maps'}{$newm}{'original'} = $m;
+ } else {
+ print "$prg: generated map $newm (from $m) does not exists, not activating it!\n";
+ }
+ # in any case delete the @kanji...@ entry line, such a map will
+ # never exist
delete $alldata->{'updmap'}{$l}{'maps'}{$m};
}
}
@@ -1611,6 +1639,8 @@ sub read_updmap_file {
# allow for commands on the line itself
s/([^#].*)#.*$/$1/;
my ($a, $b, @rest) = split ' ';
+ # make sure we get empty strings as arguments
+ $b = "" if (!defined($b));
if ($a eq "#!") {
if ($b eq "Map" || $b eq "MixedMap" || $b eq "KanjiMap") {
my $c = shift @rest;
@@ -1900,6 +1930,7 @@ Explanation of the possible OPTIONS (showoptions, showoptions, setoption):
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
@@ -1907,6 +1938,12 @@ Explanation of the possible OPTIONS (showoptions, showoptions, setoption):
command-line options or configuration files to the programs, as
explained at the beginning of updmap.cfg.
+ The options kanjiEmbed and kanjiVariant govern special replacements
+ in the map lines. If a map contains the string \@kanjiEmbed\@, then
+ this will be replaced by the value of the respective option. Similarly
+ for kanjiVariant. This way users of Japanese TeX can select different
+ fonts to be included in the final pdf.
+
Explanation of trees and files normally used:
NEEDS TO BE FIXED TODO TODO TODO AFTER FINAL INCLUSION