texlive[42939] Master/texmf-dist: updmap: updates to support

commits+preining at tug.org commits+preining at tug.org
Fri Jan 13 15:32:10 CET 2017


Revision: 42939
          http://tug.org/svn/texlive?view=revision&revision=42939
Author:   preining
Date:     2017-01-13 15:32:10 +0100 (Fri, 13 Jan 2017)
Log Message:
-----------
updmap: updates to support embedding settings for sc/tc/ko

Modified Paths:
--------------
    trunk/Master/texmf-dist/scripts/texlive/updmap.pl
    trunk/Master/texmf-dist/web2c/updmap-hdr.cfg

Modified: trunk/Master/texmf-dist/scripts/texlive/updmap.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/updmap.pl	2017-01-13 01:05:31 UTC (rev 42938)
+++ trunk/Master/texmf-dist/scripts/texlive/updmap.pl	2017-01-13 14:32:10 UTC (rev 42939)
@@ -136,14 +136,26 @@
     type     => "binary",
     default  => "false",
   },
-  kanjiEmbed            => {
+  jaEmbed               => {
     type     => "any",
     default  => "noEmbed",
   },
-  kanjiVariant          => {
+  jaVariant             => {
     type     => "any",
     default  => "",
   },
+  scEmbed            => {
+    type     => "any",
+    default  => "noEmbed",
+  },
+  tcEmbed            => {
+    type     => "any",
+    default  => "noEmbed",
+  },
+  koEmbed            => {
+    type     => "any",
+    default  => "noEmbed",
+  },
 );
 
 &main();
@@ -995,9 +1007,20 @@
   my ($pdftexDownloadBase14, $pdftexDownloadBase14_origin) = 
     get_cfg('pdftexDownloadBase14');
   my ($pxdviUse, $pxdviUse_origin) = get_cfg('pxdviUse');
-  my ($kanjiEmbed, $kanjiEmbed_origin) = get_cfg('kanjiEmbed');
-  my ($kanjiVariant, $kanjiVariant_origin) = get_cfg('kanjiVariant');
+  my ($jaEmbed, $jaEmbed_origin) = get_cfg('jaEmbed');
+  my ($jaVariant, $jaVariant_origin) = get_cfg('jaVariant');
+  my ($scEmbed, $scEmbed_origin) = get_cfg('scEmbed');
+  my ($tcEmbed, $tcEmbed_origin) = get_cfg('tcEmbed');
+  my ($koEmbed, $koEmbed_origin) = get_cfg('koEmbed');
 
+  # keep backward compatibility with old definitions
+  # of kanjiEmbed, kanjiVariant
+  ($jaEmbed, $jaEmbed_origin) = get_cfg('kanjiEmbed')
+    if (!defined($jaEmbed));
+  ($jaVariant, $jaVariant_origin) = get_cfg('kanjiVariant')
+    if (!defined($jaVariant));
+
+
   # pxdvi is optional, and off by default.  Don't create the output
   # directory unless we are going to put something there.
   setupOutputDir("pxdvi") if $pxdviUse eq "true";
@@ -1014,10 +1037,16 @@
          .      "$dvipsDownloadBase35 ($dvipsDownloadBase35_origin)"
          . "\n  download standard fonts (pdftex) : "
          .      "$pdftexDownloadBase14 ($pdftexDownloadBase14_origin)"
-         . "\n  kanjiEmbed replacement string    : "
-         .      "$kanjiEmbed ($kanjiEmbed_origin)"
-         . "\n  kanjiVariant replacement string  : "
-         .      "$kanjiVariant ($kanjiVariant_origin)"
+         . "\n  jaEmbed replacement string       : "
+         .      "$jaEmbed ($jaEmbed_origin)"
+         . "\n  jaVariant replacement string     : "
+         .      ($jaVariant ? $jaVariant : "<empty>") . " ($jaVariant_origin)"
+         . "\n  scEmbed replacement string       : "
+         .      "$scEmbed ($scEmbed_origin)"
+         . "\n  tcEmbed replacement string       : "
+         .      "$tcEmbed ($tcEmbed_origin)"
+         . "\n  koEmbed replacement string       : "
+         .      "$koEmbed ($koEmbed_origin)"
          . "\n  create a mapfile for pxdvi       : "
          .      "$pxdviUse ($pxdviUse_origin)"
          . "\n\n");
@@ -1639,6 +1668,16 @@
 sub setOption {
   my ($opt, $val) = @_;
 
+  # allow backward compatility with old kanjiEmbed and kanjiVariant settings
+  if ($opt eq "kanjiEmbed") {
+    print_warning("using jaEmbed instead of kanjiEmbed\n");
+    $opt = "jaEmbed";
+  }
+  if ($opt eq "kanjiVariant") {
+    print_warning("using jaVariant instead of kanjiVariant\n");
+    $opt = "jaVariant";
+  }
+
   die "$prg: Unsupported option $opt." if (!defined($settings{$opt}));
   die "$0: Invalid value $val for option $opt." 
     if (!check_option($opt, $val));
@@ -1862,8 +1901,19 @@
     }
   }
   #
-  my ($kanjiEmbed, $kanjiEmbed_origin) = get_cfg('kanjiEmbed');
-  my ($kanjiVariant, $kanjiVariant_origin) = get_cfg('kanjiVariant');
+  my ($jaEmbed, $jaEmbed_origin) = get_cfg('jaEmbed');
+  my ($jaVariant, $jaVariant_origin) = get_cfg('jaVariant');
+  my ($scEmbed, $scEmbed_origin) = get_cfg('scEmbed');
+  my ($tcEmbed, $tcEmbed_origin) = get_cfg('tcEmbed');
+  my ($koEmbed, $koEmbed_origin) = get_cfg('koEmbed');
+
+  # keep backward compatibility with old definitions
+  # of kanjiEmbed, kanjiVariant
+  ($jaEmbed, $jaEmbed_origin) = get_cfg('kanjiEmbed')
+    if (!defined($jaEmbed));
+  ($jaVariant, $jaVariant_origin) = get_cfg('kanjiVariant')
+    if (!defined($jaVariant));
+
   #
   # go through all map files and check that the text is properly replaced
   # after the replacement check that the generated map file actually
@@ -1871,10 +1921,19 @@
   #
   for my $l (@l) {
     for my $m (keys %{$alldata->{'updmap'}{$l}{'maps'}}) {
-      if ($m =~ m/\@kanjiEmbed@/ || $m =~ m/\@kanjiVariant@/) {
-        my $newm = $m;
-        $newm =~ s/\@kanjiEmbed@/$kanjiEmbed/;
-        $newm =~ s/\@kanjiVariant@/$kanjiVariant/;
+      my $newm = $m;
+      # do all kinds of substitutions
+      $newm =~ s/\@jaEmbed@/$jaEmbed/;
+      $newm =~ s/\@jaVariant@/$jaVariant/;
+      $newm =~ s/\@scEmbed@/$scEmbed/;
+      $newm =~ s/\@tcEmbed@/$tcEmbed/;
+      $newm =~ s/\@koEmbed@/$koEmbed/;
+      # also do substitutions of old strings in case they are left
+      # over somewhere
+      $newm =~ s/\@kanjiEmbed@/$jaEmbed/;
+      $newm =~ s/\@kanjiVariant@/$jaVariant/;
+      if ($newm ne $m) {
+        # something was substituted
         if (locateMap($newm)) {
           # now we have to update various linked items
           $alldata->{'updmap'}{$l}{'maps'}{$newm}{'type'} =
@@ -1885,7 +1944,7 @@
             $alldata->{'updmap'}{$l}{'maps'}{$m}{'line'};
           $alldata->{'updmap'}{$l}{'maps'}{$newm}{'original'} = $m;
         } else {
-          print_warning("generated map $newm (from $m) does not exists, not activating it!\n");
+          print_warning("generated map $newm (from $m) does not exist, not activating it!\n");
         }
         # in any case delete the @kanji...@ entry line, such a map will
         # never exist
@@ -1952,6 +2011,9 @@
     if (@rest) {
       print_warning("line $i in $fn contains a syntax error, more than two words!\n");
     }
+    # backward compatibility with kanjiEmbed/kanjiVariant
+    $a = ($a eq "kanjiEmbed" ? "jaEmbed" : $a);
+    $a = ($a eq "kanjiVariant" ? "jaVariant" : $a);
     if (defined($settings{$a})) {
       if (check_option($a, $b)) {
         $data{'setting'}{$a}{'val'} = $b;
@@ -2290,8 +2352,11 @@
     Whether pdftex includes the standard 14 PDF fonts in its output.
   pxdviUse              true,false  (default false)
     Whether maps for pxdvi (Japanese-patched xdvi) are under updmap's control.
-  kanjiEmbed            (any string)
-  kanjiVariant          (any string)
+  jaEmbed               (any string)
+  jaVariant             (any string)
+  scEmbed               (any string)
+  tcEmbed               (any string)
+  koEmbed               (any string)
     See below.
   LW35                  URWkb,URW,ADOBEkb,ADOBE  (default URWkb)
     Adapt the font and file names of the standard 35 PostScript fonts.
@@ -2307,11 +2372,13 @@
   command-line options or configuration files to the programs, as
   explained at the beginning of updmap.cfg.
 
-  The options kanjiEmbed and kanjiVariant specify special replacements
-  in the map lines.  If a map contains the string \@kanjiEmbed\@, then
-  this will be replaced by the value of that option; similarly for
-  kanjiVariant.  In this way, users of Japanese TeX can select different
-  fonts to be included in the final output.
+  The options jaEmbed and jaVariant (formerly kanjiEmbed and kanjiVariant)
+  specify special replacements in the map lines.  If a map contains the 
+  string \@jaEmbed\@, then this will be replaced by the value of that option;
+  similarly for jaVariant.  In this way, users of Japanese TeX can select
+  different fonts to be included in the final output.  The counterpart for
+  Simplified Chinese, Traditional Chinese and Korean fonts are
+  scEmbed, tcEmbed and koEmbed respectively.
 
 Explanation of trees and files normally used:
 

Modified: trunk/Master/texmf-dist/web2c/updmap-hdr.cfg
===================================================================
--- trunk/Master/texmf-dist/web2c/updmap-hdr.cfg	2017-01-13 01:05:31 UTC (rev 42938)
+++ trunk/Master/texmf-dist/web2c/updmap-hdr.cfg	2017-01-13 14:32:10 UTC (rev 42939)
@@ -85,7 +85,7 @@
 dvipdfmDownloadBase14 true
 
 
-# kanjiEmbed
+# jaEmbed, scEmbed, tcEmbed, koEmbed
 #
 # updmap generates a file kanjix.map for usage with dvipdfmx. With this
 # option one can switch between not embedding any kanji font, or
@@ -92,10 +92,14 @@
 # any of the several available. 
 # 
 # The value can be any string. When updmap is run, the substring
-# @kanjiEmbed@ in a map file name will be replaced with this value, and
+# @jaEmbed@ in a map file name will be replaced with this value, and
 # the respective map file used.
 #
-kanjiEmbed ipaex
+jaEmbed ipaex
+scEmbed arphic
+tcEmbed arphic
+koEmbed baekmuk
 
 
+
 # 
 (end of updmap-hdr.cfg)



More information about the tex-live-commits mailing list