diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-21 20:55:25 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-21 20:55:25 +0000 |
commit | cde7add49b05077ff24b6006f031bbdd70c91d7d (patch) | |
tree | 5beec57ac5092f86eb2db3ce46db12dc5f0c3a25 /Build/source | |
parent | 2697dc3d2c099b15f96861286d6863d5a15bda10 (diff) |
luaotfload (21apr16)
git-svn-id: svn://tug.org/texlive/trunk@40655 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/luaotfload/luaotfload-tool.lua | 241 | ||||
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl | 75 |
2 files changed, 132 insertions, 184 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/luaotfload/luaotfload-tool.lua b/Build/source/texk/texlive/linked_scripts/luaotfload/luaotfload-tool.lua index 69b6c976fb1..4b4dc50ecda 100755 --- a/Build/source/texk/texlive/linked_scripts/luaotfload/luaotfload-tool.lua +++ b/Build/source/texk/texlive/linked_scripts/luaotfload/luaotfload-tool.lua @@ -2,13 +2,13 @@ ----------------------------------------------------------------------- -- FILE: luaotfload-tool.lua -- DESCRIPTION: database functionality --- REQUIREMENTS: luaotfload 2.6 +-- REQUIREMENTS: luaotfload 2.7 -- AUTHOR: Khaled Hosny, Élie Roux, Philipp Gesang -- LICENSE: GPL v2.0 ----------------------------------------------------------------------- luaotfload = luaotfload or { } -local version = "2.6" +local version = "2.7" luaotfload.version = version luaotfload.self = "luaotfload-tool" @@ -104,6 +104,7 @@ local iosavedata = io.savedata local lfsisdir = lfs.isdir local lfsisfile = lfs.isfile local stringsplit = string.split +local tablekeys = table.keys local tableserialize = table.serialize local tablesortedkeys = table.sortedkeys local tabletohash = table.tohash @@ -130,11 +131,38 @@ local backup = { texio.write, texio.write_nl = dummy_function, dummy_function require "fontloader-basics-gen.lua" - texio.write, texio.write_nl = backup.write, backup.write_nl utilities = backup.utilities -fonts = { names = { } } -- for db; normally provided by the fontloaders +require "fontloader-data-con" +require "fontloader-font-ini" +require "fontloader-font-con" +require "fontloader-fonts-enc" +require "fontloader-font-cid" +require "fontloader-font-map" +require "fontloader-font-tfm" +require "fontloader-font-afm" +require "fontloader-font-afk" +require "fontloader-font-oti" +require "fontloader-font-otr" +require "fontloader-font-cff" +require "fontloader-font-ttf" +require "fontloader-font-dsp" +require "fontloader-font-oup" +require "fontloader-font-otl" +require "fontloader-font-oto" +------- "fontloader-font-otj" +------- "fontloader-font-ota" +------- "fontloader-font-ots" +------- "fontloader-font-osd" +require "fontloader-font-lua" +require "fontloader-font-def" +require "fontloader-fonts-ext" +------- "fontloader-font-gbn" + +fonts = fonts or { } +local fontsnames = fonts.names or { } +fonts.names = fontsnames local require_init = { } @@ -239,8 +267,6 @@ Usage: %s [OPTIONS...] -i --info display basic font metadata -I --inspect display detailed font metadata - -w --warnings display warnings generated by the - fontloader library --list=<criterion> output list of entries by field <criterion> --list=<criterion>:<value> restrict to entries with <criterion>=<value> @@ -310,14 +336,15 @@ local version_msg = function ( ) local out = function (...) texiowrite_nl (stringformat (...)) end local uname = os.uname () local meta = fonts.names.getmetadata () + local info = status.list () out (about, luaotfload.self) out ("%s version: %q", luaotfload.self, version) out ("Revision: %q", config.luaotfload.status.notes.revision) out ("Lua interpreter: %s; version %q", runtime[1], runtime[2]) - out ("Luatex SVN revision: %d", status.luatex_svn) +--[[out ("Luatex SVN revision: %d", info.luatex_svn)]] --> SVN r5624 out ("Luatex version: %.2f.%d", - status.luatex_version / 100, - status.luatex_revision) + info.luatex_version / 100, + info.luatex_revision) out ("Platform: type=%s name=%s", os.type, os.name) local uname_vars = tablesortedkeys (uname) @@ -363,6 +390,7 @@ local format_counter = function (stack) end local print_heading = function (title, level) + if not title then return end local structuredata if currentdepth == level then -- top is current counterstack[#counterstack] = counterstack[#counterstack] + 1 @@ -397,7 +425,7 @@ local baseindent = " " --[[doc-- show_info_items -- Together with show_info_table prints the table returned by - fontloader.info(), recursing into nested tables if appropriate (as necessitated + readers.getinfo(), recursing into nested tables if appropriate (as necessitated by Luatex versions 0.78+ which include the pfminfo table in the result. --doc]]-- @@ -425,29 +453,6 @@ local show_info_items = function (fontinfo) texiowrite_nl "" end -local p_eol = S"\n\r"^1 -local p_space = S" \t\v"^0 -local p_line = p_space * C((1 - p_eol)^1)^-1 -local p_lines = Ct(p_line * (p_eol^1 * p_line^-1)^0) - -local show_fontloader_warnings = function (ws) - local nws = #ws - print_heading(stringformat( - [[the fontloader emitted %d warnings]], - nws), 2) - texiowrite_nl "" - for i=1, nws do - local w = ws[i] - texiowrite_nl (stringformat("%d:", i)) - local lines = lpegmatch(p_lines, w) - for i=1, #lines do - local line = lines[i] - texiowrite_nl(" · " .. line) - end - texiowrite_nl "" - end -end - local p_spacechar = S" \n\r\t\v" local p_wordchar = (1 - p_spacechar) local p_whitespace = p_spacechar^1 @@ -457,15 +462,16 @@ local p_words = Ct(p_word * (p_whitespace * p_word)^0) --- string -> int -> string list local reflow = function (text, width) local words - if type(text) == "string" then + local t_text = type (text) + if t_text == "string" then words = lpegmatch(p_words, text) if #words < 2 then return { text } end - else + elseif t_text == "table" then words = text - if #words < 2 then - return words + if #text < 2 then + return text end end @@ -512,42 +518,24 @@ local print_field = function (key, val) end end -local display_names = function (names) - print_heading("Font Metadata", 2) - for i=1, #names do - local lang, namedata = names[i].lang, names[i].names - print_heading(stringformat("Language: %s ", i, lang), 3) - texiowrite_nl "" - if namedata then - for field, value in next, namedata do - print_field(field, value) - end - end - end -end - --- see luafflib.c local general_fields = { --- second: l -> literal | n -> length | d -> date { "fullname", "l", "font name" }, { "version", "l", "font version" }, - { "creationtime", "d", "creation time" }, - { "modificationtime", "d", "modification time" }, - { "subfonts", "n", "number of subfonts" }, - { "glyphcnt", "l", "number of glyphs" }, + { "width", "l", "width" }, + { "averagewidth", "l", "average width" }, + { "panosewidth", "l", "panose width" }, { "weight", "l", "weight indicator" }, - { "design_size", "l", "design size" }, - { "design_range_bottom", "l", "design size min" }, - { "design_range_top", "l", "design size max" }, - { "fontstyle_id", "l", "font style id" }, - { "fontstyle_name", "S", "font style name" }, - { "strokewidth", "l", "stroke width" }, - { "units_per_em", "l", "units per em" }, - { "ascent", "l", "ascender height" }, - { "descent", "l", "descender height" }, - { "comments", "l", "comments" }, - { "os2_version", "l", "os2 version" }, - { "sfd_version", "l", "sfd version" }, + { "pfmweight", "l", "numerical weight" }, + { "panoseweight", "l", "panose weight" }, + { "designsize", "l", "design size" }, + { "minsize", "l", "design size min" }, + { "maxsize", "l", "design size max" }, + { "units", "l", "units per em" }, + { "ascender", "l", "ascender height" }, + { "descender", "l", "descender height" }, + { "capheight", "l", "capital height" }, } local display_general = function (fullinfo) @@ -607,7 +595,7 @@ local print_features = function (features) for script, languages in next, data do local field = stringformat(key_fmt, script).. fieldseparator .. " " local wd_field = #field - local lines = reflow(languages.list, textwidth - wd_field) + local lines = reflow(tablekeys(languages), textwidth - wd_field) local indent = stringrep(" ", wd_field) texiowrite_nl(field) texiowrite(lines[1]) @@ -620,88 +608,40 @@ local print_features = function (features) end end -local extract_feature_info = function (set) - local collected = { } - for i=1, #set do - local features = set[i].features - if features then - for j=1, #features do - local feature = features[j] - local scripts = feature.scripts - local tagname = stringlower(feature.tag) - local entry = collected[tagname] or { } - - for k=1, #scripts do - local script = scripts[k] - local scriptname = stringlower(script.script) - local c_script = entry[scriptname] or { - list = { }, - set = { }, - } - local list, set = c_script.list, c_script.set - - for l=1, #script.langs do - local langname = stringlower(script.langs[l]) - if not set[langname] then - list[#list+1] = langname - set[langname] = true - end - end - entry[scriptname] = c_script - end - collected[tagname] = entry - end - end - end - return collected +local display_feature_set = function (set) + print_features(set) end -local display_feature_set = function (set) - local collected = extract_feature_info(set) - print_features(collected) +local display_features_type = function (id, feat) + if next (feat) then + print_heading(id, 3) + display_feature_set(feat) + return true + end + return false end -local display_features = function (gsub, gpos) +local display_features = function (features) texiowrite_nl "" + print_heading("Features", 2) - if gsub or gpos then - print_heading("Features", 2) - - if gsub then - print_heading("GSUB Features", 3) - display_feature_set(gsub) - end - - if gpos then - print_heading("GPOS Features", 3) - display_feature_set(gpos) - end + if not display_features_type ("GSUB Features", features.gsub) + or not display_features_type ("GPOS Features", features.gpos) + then + texiowrite_nl("font defines neither gsub nor gpos features") end end -local show_full_info = function (path, subfont, warnings) - local rawinfo, warn = fontloader.open(path, subfont) - if warnings then - show_fontloader_warnings(warn) - end +local show_full_info = function (path, subfont) + local rawinfo, warn = fonts.handlers.otf.readers.loadfont (path, subfont) if not rawinfo then texiowrite_nl(stringformat([[cannot open font %s]], path)) return end - local fontdata = { } - local fullinfo = fontloader.to_table(rawinfo) - local fields = fontloader.fields(rawinfo) - fontloader.close(rawinfo) - display_names(fullinfo.names) - display_general(fullinfo) - display_features(fullinfo.gsub, fullinfo.gpos) + display_general(rawinfo.metadata) + display_features(rawinfo.resources.features) end ---- Subfonts returned by fontloader.info() do not correspond ---- to the actual indices required by fontloader.open(), so ---- we try and locate the correct one by matching the request ---- against the full name. - local subfont_by_name subfont_by_name = function (lst, askedname, n) if not n then @@ -713,7 +653,7 @@ subfont_by_name = function (lst, askedname, n) if fonts.names.sanitize_fontname (font.fullname) == askedname then return font end - return subfont_by_name (lst, askedname, n+1) + return subfont_by_name (lst, askedname, n) end return false end @@ -721,12 +661,12 @@ end --[[doc-- The font info knows two levels of detail: - a) basic information returned by fontloader.info(); and + a) basic information returned by readers.getinfo(); and b) detailed information that is a subset of the font table - returned by fontloader.open(). + returned by readers.loadfont(). --doc]]-- -local show_font_info = function (basename, askedname, detail, warnings) +local show_font_info = function (basename, askedname, detail) local filenames = fonts.names.data().files local index = filenames.base[basename] local fullname = filenames.full[index] @@ -735,7 +675,11 @@ local show_font_info = function (basename, askedname, detail, warnings) fullname = resolvers.findfile(basename) end if fullname then - local shortinfo = fontloader.info(fullname) + local shortinfo = fonts.handlers.otf.readers.getinfo (fullname, { + subfont = nil, + platformnames = true, + rawfamilynames = true, + }) local nfonts = #shortinfo if nfonts > 0 then -- true type collection local subfont @@ -748,7 +692,7 @@ local show_font_info = function (basename, askedname, detail, warnings) if subfont then show_info_items(subfont) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end else -- list all subfonts logreport (true, 1, "resolve", @@ -758,14 +702,14 @@ local show_font_info = function (basename, askedname, detail, warnings) [[Showing info for font no. %d]], n) show_info_items(shortinfo[subfont]) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end end end else show_info_items(shortinfo) if detail == true then - show_full_info(fullname, subfont, warnings) + show_full_info(fullname, subfont) end end else @@ -1240,7 +1184,7 @@ actions.query = function (job) "Resolved file name %q", foundname) end if job.show_info then - show_font_info (foundname, query, job.full_info, job.warnings) + show_font_info (foundname, query, job.full_info) iowrite "\n" end else @@ -1465,7 +1409,6 @@ local process_cmdline = function ( ) -- unit -> jobspec local result = { -- jobspec force_reload = nil, full_info = false, - warnings = false, criterion = "", query = "", log_level = nil, @@ -1506,10 +1449,9 @@ local process_cmdline = function ( ) -- unit -> jobspec update = "u", verbose = 1, version = "V", - warnings = "w", } - local short_options = "bcDfFiIlLnpqRSuvVhw" + local short_options = "bcDfFiIlLnpqRSuvVh" local options, _, optarg = alt_getopt.get_ordered_opts (arg, short_options, long_options) @@ -1541,12 +1483,7 @@ local process_cmdline = function ( ) -- unit -> jobspec if lvl then lvl = tonumber(lvl) result.log_level = lvl - if lvl > 2 then - result.warnings = true - end end - elseif v == "w" then - result.warnings = true elseif v == "log" then local str = optarg[n] if str then diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl index 66ed99bd78b..a62571837ae 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl @@ -1,13 +1,13 @@ #!/usr/bin/env perl -# $Id: tlmgr.pl 40615 2016-04-19 07:41:55Z preining $ +# $Id: tlmgr.pl 40640 2016-04-21 00:31:43Z preining $ # # Copyright 2008-2016 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. # -my $svnrev = '$Revision: 40615 $'; -my $datrev = '$Date: 2016-04-19 09:41:55 +0200 (Tue, 19 Apr 2016) $'; +my $svnrev = '$Revision: 40640 $'; +my $datrev = '$Date: 2016-04-21 02:31:43 +0200 (Thu, 21 Apr 2016) $'; my $tlmgrrevision; my $prg; if ($svnrev =~ m/: ([0-9]+) /) { @@ -104,7 +104,7 @@ use TeXLive::TLWinGoo; use TeXLive::TLDownload; use TeXLive::TLConfFile; TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname - mkdirhier copy log debug tlcmp)); + mkdirhier copy debug tlcmp)); use TeXLive::TLPaper; # @@ -746,7 +746,7 @@ sub do_cmd_and_check { } if ($ret == 0) { info("done running $cmd.\n"); - log("--output of $cmd:\n$out\n--end of output of $cmd."); + ddebug("--output of $cmd:\n$out\n--end of output of $cmd."); return ($F_OK); } else { info("\n"); @@ -864,7 +864,7 @@ sub handle_execute_actions { if ($opt_fmt && !$::regenerate_all_formats) { # first regenerate all formats --byengine for my $e (keys %updated_engines) { - log ("updating formats based on $e\n"); + debug ("updating formats based on $e\n"); $errors += do_cmd_and_check ("$invoke_fmtutil --no-error-if-no-format --byengine $e"); } @@ -873,7 +873,7 @@ sub handle_execute_actions { next if defined($updated_engines{$format_to_engine{$f}}); # ignore disabled formats next if !$::execute_actions{'enable'}{'formats'}{$f}{'mode'}; - log ("(re)creating format dump $f\n"); + debug ("(re)creating format dump $f\n"); $errors += do_cmd_and_check ("$invoke_fmtutil --byfmt $f"); $done_formats{$f} = 1; } @@ -2573,7 +2573,7 @@ sub action_update { # don't do anything if we have been invoked in a strange way if (!@todo) { if ($opts{"self"}) { - info("$prg: no updates for tlmgr present.\n"); + info("$prg: no self-updates for tlmgr available.\n"); } else { tlwarn("$prg update: please specify a list of packages, --all, or --self.\n"); return ($F_ERROR); @@ -3418,8 +3418,9 @@ sub action_update { } # if a real update from default disk location didn't find anything, - # warn if nothing is updated. - if (!(@new || @updated)) { + # warn if nothing is updated. Unless they said --self, in which case + # we've already reported it. + if (!(@new || @updated) && ! $opts{"self"}) { info("$prg: no updates available\n"); if ($remotetlpdb->media ne "NET" && $remotetlpdb->media ne "virtual" @@ -5710,7 +5711,7 @@ sub handle_gpg_config_settings { # now we know whether we setup gpg or not if ($do_setup_gpg) { if (TeXLive::TLUtils::setup_gpg($Master)) { - log("will verify cryptographic signatures\n") + debug("will verify cryptographic signatures\n") } else { my $prefix = "$prg: No gpg found"; # just to shorten the strings if ($opts{'verify-downloads'}) { @@ -5732,9 +5733,9 @@ sub handle_gpg_config_settings { # log normally is *NOT* logged to a file # tlmgr does by default *NOT* set up a log file (cmd line option) # user requested it, so don't bother with output - log("$prefix, requested on command line\n"); + debug("$prefix, requested on command line\n"); } elsif (defined($config{'verify-downloads'})) { - log("$prefix, requested in config file\n"); + debug("$prefix, requested in config file\n"); } else { tldie("$prg: how could this happen? gpg setup.\n"); } @@ -5818,7 +5819,8 @@ sub init_tlmedia { # this "location-url" line should not be changed since GUI programs # depend on it: print "location-url\t$locstr\n" if $::machinereadable; - info("$prg: package repositories:\n"); + info("$prg: package repositories" . + ($::gpg ? " (all verified)" : "") . ":\n"); info("\tmain = " . $repos{'main'} . "\n"); for my $t (@tags) { if ($t ne 'main') { @@ -5857,7 +5859,8 @@ sub _init_tlmedia { # this "location-url" line should not be changed since GUI programs # depend on it: print "location-url\t$location\n" if $::machinereadable; - info("$prg: package repository $location\n"); + info("$prg: package repository $location" . + ($::gpg ? " (verified)" : "") . "\n"); return 1; } @@ -5916,12 +5919,19 @@ END_NO_INTERNET $remotetlpdb = TeXLive::TLPDB->new(root => $location, tlpdbfile => $loc_copy_of_remote_tlpdb); $local_copy_tlpdb_used = 1; - } elsif ($ret > 0) { + } elsif ($ret == 1) { # no problem, checksum is wrong, we need to get new tlpdb - } else { + } elsif ($ret == 2) { + # umpf, signature error + # TODO should we die here? Probably yes because one of + # checksum file or signature file has changed! + tldie("$0: verification of checksum for $location failed: $msg\n"); + } elsif ($ret == 0) { $remotetlpdb = TeXLive::TLPDB->new(root => $location, tlpdbfile => $loc_copy_of_remote_tlpdb); $local_copy_tlpdb_used = 1; + } else { + tldie("$0: unexpected return value from verify_checksum: $ret\n"); } } } @@ -6212,7 +6222,7 @@ sub clear_old_backups { if ($verb) { info ("Removing backup $backupdir/$pkg.r$e.tar.xz\n"); } else { - log ("Removing backup $backupdir/$pkg.r$e.tar.xz\n"); + debug ("Removing backup $backupdir/$pkg.r$e.tar.xz\n"); } unlink("$backupdir/$pkg.r$e.tar.xz") unless $dryrun; } @@ -7557,11 +7567,11 @@ a different hash), it's harmless to delete them. =head1 CRYPTOGRAPHIC VERIFICATION -If a working GnuPG binary (C<gpg>) is found (see below for how it is -searched), by default verification of -downloaded files is performed. This can be supressed by specifying -C<--no-verify-downloads> on the command line, or adding an entry -C<verify-downloads = 0> to a tlmgr config file. +If a working GnuPG binary (C<gpg>) is found (see below for the search +method), by default verification of downloaded files is performed. This +can be suppressed by specifying C<--no-verify-downloads> on the command +line, or adding an entry C<verify-downloads = 0> to a tlmgr config file +(described in another section below). Verification is performed as follows: For each C<texlive.tlpdb> loaded for a repository, the respective checksum C<texlive.tlpdb.sha512> is @@ -7569,11 +7579,12 @@ always downloaded, too, and C<tlmgr> confirms whether the checksum of the download tlpdb file agrees with the download data. This is done in any case. -If cryptographic verification is done, then a signature of the checksum -file is downloaded and the signature verified. The signature is done with -the TeX Live Distribution GPG key 0x06BAB6BC, which in turn is signed -by Karl Berry's key 0x9DEB46C0 and Norbert Preining's key 0x6CACA448. -All of these keys are obtainable from the standard key servers. +If cryptographic verification is also requested, then a signature of the +checksum file is downloaded and the signature verified. The signature is +done with the TeX Live Distribution GPG key 0x06BAB6BC, which in turn is +signed by Karl Berry's key 0x9DEB46C0 and Norbert Preining's key +0x6CACA448. All of these keys are obtainable from the standard key +servers. =head2 Configuration of GnuPG invocation @@ -7581,10 +7592,10 @@ The executable used for GnuPG is searched as follows: If the environment variable C<TL_GNUPG> is set, it is tested and used. Otherwise C<gpg> is checked, and finally C<gpg2>. -Further adaption of the invocation of C<gpg> can be done using the -two enviroment variables C<TL_GNUPGHOME>, which is passed to -C<gpg> with C<--homedir>, and C<TL_GNUPGARGS>, which replaces the -default arguments C<--no-secmem-warning --no-permission-warning>. +Further adaptation of the C<gpg> invocation can be made using the two +enviroment variables C<TL_GNUPGHOME>, which is passed to C<gpg> as the +value for C<--homedir>, and C<TL_GNUPGARGS>, which replaces the default +arguments C<--no-secmem-warning --no-permission-warning>. =head1 USER MODE |