diff options
author | Karl Berry <karl@freefriends.org> | 2021-05-21 21:05:05 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-05-21 21:05:05 +0000 |
commit | 18c4b51ca1b98fb507d18afb9dbf02c3f0dd4baf (patch) | |
tree | 40df74fcad10980ff11a5c7a5dd2227af9ff7e2d /Build/source | |
parent | b1faafa7a3280da5554864dc3b75351f780b7c74 (diff) |
luaotfload (21may21)
git-svn-id: svn://tug.org/texlive/trunk@59293 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/luaotfload/luaotfload-tool.lua | 58 | ||||
-rwxr-xr-x | Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl | 17 |
2 files changed, 61 insertions, 14 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 0c583639033..df80d4da78b 100755 --- a/Build/source/texk/texlive/linked_scripts/luaotfload/luaotfload-tool.lua +++ b/Build/source/texk/texlive/linked_scripts/luaotfload/luaotfload-tool.lua @@ -9,8 +9,8 @@ local ProvidesLuaModule = { name = "luaotfload-tool", - version = "3.17", --TAGVERSION - date = "2021-01-08", --TAGDATE + version = "3.18", --TAGVERSION + date = "2021-05-21", --TAGDATE description = "luaotfload-tool / database functionality", license = "GPL v2.0" } @@ -584,7 +584,7 @@ local function display_general (fullinfo) --- the MS compiler doesn’t support C99, so --- strftime is missing some functionality; --- see loslib.c for details. - val = osdate("%Y-%m-d %H:%M:%S", fullinfo[key]) + val = osdate("%Y-%m-%d %H:%M:%S", fullinfo[key]) end end if not val then @@ -736,7 +736,7 @@ local action_sequence = { "config" , "loglevel" , "help" , "version" , "dumpconf" , "diagnose" , "blacklist" , "cache" , "flush" , "bisect" , "generate" , "list" , - "query" , + "query" , "aliases" , } local action_pending = tabletohash(action_sequence, false) @@ -834,7 +834,7 @@ local bisect_status_fmt = [[ local function write_bisect_status (data) local payload = tableserialize (data, true) local status = stringformat (bisect_status_fmt, - osdate ("%Y-%m-d %H:%M:%S", os.time ()), + osdate ("%Y-%m-%d %H:%M:%S", os.time ()), payload) if status and iosavedata (bisect_status_file, status) then logreport ("info", 4, "bisect", @@ -1396,6 +1396,51 @@ function actions.diagnose (job) return diagnose (job) end +function actions.aliases (job) + --- Help XeTeX find fonts + local name_index = fonts.names.data() or fonts.names.load() + local mappings = name_index.mappings + local fontnames = name_index.fontnames.texmf + local families = name_index.families.texmf + local formats = { 'ttf', 'otf', } + for _, format in ipairs(formats) do + for name, mapping in pairs(fontnames[format]) do + mapping = mappings[mapping] + print(string.format('%s %s', mapping.basename, name)) + end + end + local function best_match(options, target) + if not options then return end + if options.default then return mappings[options.default] end + local best, best_diff = nil, math.huge + for _, option in ipairs(options) do + local diff = math.abs(option[1]-target) + if diff < best_diff then + best, best_diff = option[4], diff + end + end + return mappings[best] + end + for _, format in ipairs(formats) do + for name, family in pairs(families[format]) do + local r = best_match(family.r, 655360, mappings) + local b = best_match(family.b, 655360, mappings) + local i = best_match(family.i, 655360, mappings) + local bi = best_match(family.bi, 655360, mappings) + r = r or b or i or bi -- Not sure if this is still needed + if r then + b, i, bi = b or r, i or r, bi or r + print(string.format('%s %s\n%s %s-b\n%s %s-i\n%s %s-bi', + r.basename, name, + b.basename, name, + i.basename, name, + bi.basename, name)) + end + end + end + return true +end + --- stuff to be carried out prior to exit local finalizers = { } @@ -1434,6 +1479,7 @@ local function process_cmdline ( ) -- unit -> jobspec } local long_options = { + aliases = 0, ["bisect"] = 1, cache = 1, conf = 1, @@ -1587,6 +1633,8 @@ local function process_cmdline ( ) -- unit -> jobspec action_pending["dumpconf"] = true elseif v == "print-conf" then result.print_config = true + elseif v == "aliases" then + action_pending["aliases"] = true end end diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl index 7e935f9cc05..bd9bb1175c1 100755 --- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl +++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl @@ -1,12 +1,12 @@ #!/usr/bin/env perl -# $Id: tlmgr.pl 59273 2021-05-19 23:02:14Z preining $ +# $Id: tlmgr.pl 59287 2021-05-20 21:34:36Z karl $ # # Copyright 2008-2021 Norbert Preining # This file is licensed under the GNU General Public License version 2 # or any later version. -my $svnrev = '$Revision: 59273 $'; -my $datrev = '$Date: 2021-05-20 01:02:14 +0200 (Thu, 20 May 2021) $'; +my $svnrev = '$Revision: 59287 $'; +my $datrev = '$Date: 2021-05-20 23:34:36 +0200 (Thu, 20 May 2021) $'; my $tlmgrrevision; my $tlmgrversion; my $prg; @@ -398,11 +398,6 @@ sub main { GetOptions(\%opts, keys(%optarg)) or pod2usage(2); - # load the config file and set the config options - # load it BEFORE starting downloads as we set persistent-downloads there! - load_config_file(); - - $::debug_translation = 0; $::debug_translation = 1 if $opts{"debug-translation"}; @@ -674,6 +669,10 @@ for the full story.\n"; $loadmediasrcerror = "Cannot load TeX Live database from "; + # load the config file and set the config options + # load it BEFORE starting downloads as we set persistent-downloads there! + load_config_file(); + # in system mode verify that the selected action is allowed if (!$opts{"usermode"} && $config{'allowed-actions'}) { if (!TeXLive::TLUtils::member($action, @{$config{'allowed-actions'}})) { @@ -10225,7 +10224,7 @@ This script and its documentation were written for the TeX Live distribution (L<https://tug.org/texlive>) and both are licensed under the GNU General Public License Version 2 or later. -$Id: tlmgr.pl 59273 2021-05-19 23:02:14Z preining $ +$Id: tlmgr.pl 59287 2021-05-20 21:34:36Z karl $ =cut # test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html |