262
259
warning("Please consider moving the information from updmap-local.cfg to TEXMFLOCAL/web2c/updmap.cfg\n");
262
# reorder used files: we move TEXMFLOCAL (if used) just above TEXMFMAIN
263
# as sysadmins will probably adjust values there
268
# TEXMFCONFIG $HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg
269
# TEXMFVAR $HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg
270
# TEXMFHOME $HOME/texmf/web2c/updmap.cfg
271
# TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg
272
# TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg
273
# TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg
274
# TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg
275
# TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg
278
# TEXMFCONFIG $HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg
279
# TEXMFVAR $HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg
280
# TEXMFHOME $HOME/texmf/web2c/updmap.cfg
281
# TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg
282
# TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg
283
# TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg
284
# TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg
285
# TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg
290
# TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg
291
# TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg
292
# TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg
293
# TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg
294
# TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg
297
# TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg
298
# TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg
299
# TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg
300
# TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg
301
# TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg
264
303
if ($found || $old_updmap_local_found) {
266
my $local_pushed = 0;
267
305
for my $f (@used_files) {
268
if ($f =~ m!\Q$TEXMFCONFIG\E|\Q$TEXMFVAR\E|\Q$TEXMFHOME\E!) {
306
if ($f =~ m!\Q$TEXMFMAIN/\E!) {
307
if ($old_updmap_local_found) {
308
push @tmp, "$TEXMFLOCAL/web2c/updmap-local.cfg";
310
# since we are under if ($found || $old_updmap_local_found)
311
# we know that TEXMFLOCAL/web2c/updmap.cfg exists!
312
push @tmp, "$TEXMFLOCAL/web2c/updmap.cfg";
271
if (!$local_pushed) {
272
# should we use the return value of grep here, but we know
273
# what we will find?!?!
274
if ($old_updmap_local_found) {
275
push @tmp, "$TEXMFLOCAL/web2c/updmap-local.cfg";
277
push @tmp, "$TEXMFLOCAL/web2c/updmap.cfg";
316
if ($f !~ m!\Q$TEXMFLOCAL\E!) {
282
push @tmp, $f unless ($f =~ m!\Q$TEXMFLOCAL\E!);
285
321
@used_files = @tmp;
1909
# $HOME and sudo and updmap-sys horror
1910
# some instances of sudo do not reset $HOME to the home of root
1911
# as an effect of "sudo updmap" creates root owned files in the home
1912
# of a normal user, and "sudo updmap-sys" uses map files and updmap.cfg
1913
# files from the directory of a normal user, but creating files
1914
# in TEXMFSYSCONFIG. This is *all* wrong.
1915
# we check: if we are running as UID 0 (root) on Unix and the
1916
# ENV{HOME} is NOT the same as the one of root, then give a warning
1917
# and reset it to the real home dir of root.
1919
sub reset_root_home {
1920
if (!win32() && ($> == 0)) { # $> is effective uid
1921
my $envhome = $ENV{'HOME'};
1922
# if $HOME isn't an existing directory, we don't care.
1923
if (defined($envhome) && (-d $envhome)) {
1924
# we want to avoid calling getpwuid as far as possible, so if
1925
# $envhome is one of some usual values we accept it without worrying.
1926
if ($envhome =~ m,^(/|/root|/var/root)/*$,) {
1929
# $HOME is defined, check what is the home of root in reality
1930
my (undef,undef,undef,undef,undef,undef,undef,$roothome) = getpwuid(0);
1931
if (defined($roothome)) {
1932
if ($envhome ne $roothome) {
1933
warning("$prg: resetting \$HOME value (was $envhome) to root's "
1934
. "actual home ($roothome).\n");
1935
$ENV{'HOME'} = $roothome;
1937
# envhome and roothome do agree, nothing to do, that is the good case
1940
warning("$prg: home of root not defined, strange!\n");
1872
1947
print STDERR @_;
1887
1962
or: $prg-sys [OPTION] ... [COMMAND]
1889
1964
Update the default font map files used by pdftex, dvips, and dvipdfm(x),
1890
(and optionally pxdvi) as determined by all configuration files updmap.cfg
1965
and optionally pxdvi, as determined by all configuration files updmap.cfg
1891
1966
(the ones returned by running "kpsewhich --all updmap.cfg", but see below).
1893
1968
Among other things, these map files are used to determine which fonts
1894
1969
should be used as bitmaps and which as outlines, and to determine which
1895
fonts are included in the output.
1970
font files are included in the PDF or PostScript output.
1897
1972
By default, the TeX filename database (ls-R) is also updated.
1900
1975
--cnffile FILE read FILE for the updmap configuration
1901
(can be given multiple times, in which case
1902
all the files are used)
1903
--dvipdfmxoutputdir DIR specify output directory (dvipdfm syntax)
1976
(can be given multiple times, in which case
1977
all the files are used)
1978
--dvipdfmxoutputdir DIR specify output directory (dvipdfm(x) syntax)
1904
1979
--dvipsoutputdir DIR specify output directory (dvips syntax)
1905
1980
--pdftexoutputdir DIR specify output directory (pdftex syntax)
1906
1981
--pxdvioutputdir DIR specify output directory (pxdvi syntax)
1916
1991
--help show this message and exit
1917
1992
--version show version information and exit
1993
--showoption OPTION show the current setting of OPTION
1918
1994
--showoptions OPTION show possible settings for OPTION
1919
--showoption OPTION show the current setting of OPTION
1920
--setoption OPTION VALUE set OPTION to value
1995
--setoption OPTION VALUE set OPTION to value; option names below
1921
1996
--setoption OPTION=VALUE as above, just different syntax
1922
1997
--enable MAPTYPE MAPFILE add "MAPTYPE MAPFILE" to updmap.cfg,
1923
where MAPTYPE is either Map, MixedMap, KanjiMap
1998
where MAPTYPE is Map, MixedMap, or KanjiMap
1924
1999
--enable Map=MAPFILE add \"Map MAPFILE\" to updmap.cfg
1925
2000
--enable MixedMap=MAPFILE add \"MixedMap MAPFILE\" to updmap.cfg
1926
2001
--enable KanjiMap=MAPFILE add \"KanjiMap MAPFILE\" to updmap.cfg
1927
--disable MAPFILE disable MAPFILE, whether Map, MixedMap, or KanjiMap
2002
--disable MAPFILE disable MAPFILE, of whatever type
1928
2003
--listmaps list all active and inactive maps
1929
2004
--listavailablemaps same as --listmaps, but without
1930
2005
unavailable map files
1933
2008
Explanation of the map types: the (only) difference between Map and
1934
2009
MixedMap is that MixedMap entries are not added to psfonts_pk.map.
1935
KanjiMap entries are added to psfonts_t1.map and kanjix.map.
1936
The purpose is to help users with printers that render Type 1 outline
2010
The purpose is to help users with devices that render Type 1 outline
1937
2011
fonts worse than mode-tuned Type 1 bitmap fonts. So, MixedMap is used
1938
2012
for fonts that are available as both Type 1 and Metafont.
2013
KanjiMap entries are added to psfonts_t1.map and kanjix.map.
1940
Explanation of the possible OPTIONS (showoptions, showoptions, setoption):
2015
Explanation of the OPTION names for --showoptions, --showoptions, --setoption:
1942
2017
dvipsPreferOutline true|false (default true)
1943
2018
Whether dvips uses bitmaps or outlines, when both are available.
1944
dvipsDownloadBase35 true|false (default false)
2019
dvipsDownloadBase35 true|false (default true)
1945
2020
Whether dvips includes the standard 35 PostScript fonts in its output.
1946
2021
pdftexDownloadBase14 true|false (default true)
1947
2022
Whether pdftex includes the standard 14 PDF fonts in its output.
1948
2023
pxdviUse true|false (default false)
1949
Whether maps for pxdvi (Japanese-patched xdvi) is under control of updmap.
2024
Whether maps for pxdvi (Japanese-patched xdvi) are under updmap's control.
2025
kanjiEmbed (any string)
2026
kanjiVariant (any string)
1950
2028
LW35 URWkb|URW|ADOBEkb|ADOBE (default URWkb)
1951
2029
Adapt the font and file names of the standard 35 PostScript fonts.
1952
2030
URWkb URW fonts with "berry" filenames (e.g. uhvbo8ac.pfb)
1953
2031
URW URW fonts with "vendor" filenames (e.g. n019064l.pfb)
1954
2032
ADOBEkb Adobe fonts with "berry" filenames (e.g. phvbo8an.pfb)
1955
2033
ADOBE Adobe fonts with "vendor" filenames (e.g. hvnbo___.pfb)
1956
kanjiEmbed (any string)
1957
kanjiVariant (any string)
1959
2035
These options are only read and acted on by updmap; dvips, pdftex, etc.,
1960
2036
do not know anything about them. They work by changing the default map
1962
2038
command-line options or configuration files to the programs, as
1963
2039
explained at the beginning of updmap.cfg.
1965
The options kanjiEmbed and kanjiVariant govern special replacements
1966
in the map lines. If a map contains the string \@kanjiEmbed\@, then
1967
this will be replaced by the value of the respective option. Similarly
1968
for kanjiVariant. This way users of Japanese TeX can select different
1969
fonts to be included in the final pdf.
2041
The options kanjiEmbed and kanjiVariant specify special replacements
2042
in the map lines. If a map contains the string \@kanjiEmbed\@, then
2043
this will be replaced by the value of that option; similarly for
2044
kanjiVariant. In this way, users of Japanese TeX can select different
2045
fonts to be included in the final output.
1971
2047
Explanation of trees and files normally used:
1973
updmap reads all the updmap.cfg files found by
1974
kpsewhich -all updmap.cfg
1975
in the order returned by kpsewhich. There is one exception to keep
1976
upgradability from earlier versions of TeX Live: If there is a file
1977
TEXMFLOCAL/web2c/updmap-local.cfg (which was formerly used by tlmgr
1978
to merge local fonts), then a (not necessarily existing) file
1979
TEXMFLOCAL/web2c/updmap.cfg is ignored and the updmap-local.cfg is
1980
used instead. In this case updmap recognizes also the syntax for
1981
disabling map files in the updmap-local.cfg (this syntax was different
1982
to what is used now!).
1984
According to the actions updmap might write to one of the given files or
1985
create a new updmap.cfg, see below for details.
1987
If multiple updmap.cfg files are found, all the map files mentioned
1988
in all the updmap.cfg files are merged.
1990
CAVEATS with multiple updmap.cfg files
1991
* where changes are saved
1992
If config files are given on the cmd line, then the first given will
1993
be used to save changes (by --setoption, --enable or --disable).
1994
If the config files are taken from kpsewhich, then the algorithm is
1996
- if one of \$TEXMFHOME/web2c/updmap.cfg or \$TEXMFCONFIG/web2c/updmap.cfg
1997
appears in the list of used files, then the one given *first* by
1998
kpsewhich --all, or equivalently, the one given by kpsewhich updmap.cfg,
2000
- if none of the above two are present, a new config file is created
2001
in \$TEXMFCONFIG/web2c/updmap.cfg (in case there are actual changes)
2004
* multiple font definitions
2005
If a font is defined multiple times in different maps, then the
2006
definition of the map file that comes from the highest priority
2007
updmap.cfg file is used.
2008
If a font is defined multiple times in the same map file, an
2009
arbitrary definition is used.
2010
In both cases warnings are issued.
2012
* disabling map files
2013
updmap.cfg files with higher priority can disable map files that
2014
are mentioned in lower priority updmap.cfg files by disabling
2049
If --cnffile is specified on the command line (possibly multiple
2050
times), its value(s) are used. Otherwise, updmap reads all the
2051
updmap.cfg files found by running \`kpsewhich -all updmap.cfg', in the
2052
order returned by kpsewhich, with one exception: an updmap.cfg found
2053
in TEXMFLOCAL is given higher priority than the updmap.cfg in
2054
TEXMFMAIN, to ensure that local adjustments by administrators take
2055
precedence over what is shipped in TeX Live.
2057
In any case, if multiple updmap.cfg files are found, all the maps
2058
mentioned in all the updmap.cfg files are merged.
2060
Thus, if updmap.cfg files are present in all trees, and the default
2061
layout is used as shipped with TeX Live, the following files are
2062
read, in the given order.
2065
TEXMFSYSCONFIG \$TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg
2066
TEXMFSYSVAR \$TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg
2067
TEXMFLOCAL \$TEXLIVE/texmf-local/web2c/updmap.cfg
2068
TEXMFMAIN \$TEXLIVE/YYYY/texmf/web2c/updmap.cfg
2069
TEXMFDIST \$TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg
2072
TEXMFCONFIG \$HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg
2073
TEXMFVAR \$HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg
2074
TEXMFHOME \$HOME/texmf/web2c/updmap.cfg
2075
TEXMFSYSCONFIG \$TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg
2076
TEXMFSYSVAR \$TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg
2077
TEXMFLOCAL \$TEXLIVE/texmf-local/web2c/updmap.cfg
2078
TEXMFMAIN \$TEXLIVE/YYYY/texmf/web2c/updmap.cfg
2079
TEXMFDIST \$TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg
2081
(where YYYY is the TeX Live release version).
2083
There is another exception to keep upgradability from earlier versions
2084
of TeX Live: if a file TEXMFLOCAL/web2c/updmap-local.cfg exists
2085
(formerly used by tlmgr to merge local fonts), then the file
2086
TEXMFLOCAL/web2c/updmap.cfg is ignored (if it exists) and that
2087
updmap-local.cfg is used instead. In this case, updmap recognizes the
2088
previous syntax for disabling map files in updmap-local.cfg (this
2089
syntax is different from what is used now).
2091
According to the actions, updmap might write to one of the given files
2092
or create a new updmap.cfg, described further below.
2094
Where changes are saved: if config files are given on the command
2095
line, then the first one given will be used to save any changes from
2096
--setoption, --enable or --disable. If the config files are taken
2097
from kpsewhich output, then the algorithm is more complex:
2099
1) If \$TEXMFCONFIG/web2c/updmap.cfg or \$TEXMFHOME/web2c/updmap.cfg
2100
appears in the list of used files, then the one listed first by
2101
kpsewhich --all (equivalently, the one returned by kpsewhich
2102
updmap.cfg), is used.
2104
2) If neither of the above two are present and changes are made, a
2105
new config file is created in \$TEXMFCONFIG/web2c/updmap.cfg.
2107
Resolving multiple definitions of a font:
2108
If a font is defined in more than one map file, then the definition
2109
coming from the first-listed updmap.cfg is used. If a font is
2110
defined multiple times within the same map file, one is chosen
2111
arbitrarily. In both cases a warning is issued.
2114
updmap.cfg files with higher priority (listed earlier) can disable
2115
maps mentioned in lower priority (listed later) updmap.cfg files by
2016
2117
\#! Map mapname.map
2018
2119
\#! MixedMap mapname.map
2019
into the higher prioprity updmap.cfg file.
2120
in the higher-priority updmap.cfg file.
2021
As an example take a user with a copy of the commercial MTPRO fonts.
2022
He wants to disable the belleek version of the fonts, that is
2023
disable the map belleek.map. The user should create a updmap.cfg file
2024
in \$TEXMFCONFIG/web2c/updmap.cfg with the content
2122
As an example, suppose you have a copy of MathTime Pro fonts
2123
and want to disable the Belleek version of the fonts; that is,
2124
disable the map belleek.map. You can create the file
2125
\$TEXMFCONFIG/web2c/updmap.cfg with the content
2025
2126
#! Map belleek.map
2026
2127
Map mt-plus.map