summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-02 21:00:47 +0000
committerKarl Berry <karl@freefriends.org>2020-05-02 21:00:47 +0000
commit16dc363f7718f96063d15f77eecf3db8a19789cc (patch)
tree4c6c7df92086e8d28dceddad5011d5abddf185db /Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua
parent83bce5369c17e79e461fc45c3707d11990d9c9a7 (diff)
luaotfload (2may20)
git-svn-id: svn://tug.org/texlive/trunk@54971 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua79
1 files changed, 39 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua
index b6b214c249f..736b9c64d3f 100644
--- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua
+++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-configuration.lua
@@ -7,8 +7,8 @@
local ProvidesLuaModule = {
name = "luaotfload-configuration",
- version = "3.12", --TAGVERSION
- date = "2020-02-02", --TAGDATE
+ version = "3.13", --TAGVERSION
+ date = "2020-05-01", --TAGDATE
description = "luaotfload submodule / config file reader",
license = "GPL v2.0"
}
@@ -137,7 +137,7 @@ local feature_presets = {
--doc]]--
-local default_fontloader = function ()
+local function default_fontloader ()
return luaotfloadstatus and luaotfloadstatus.notes.loader or "reference"
end
@@ -148,10 +148,10 @@ local registered_loaders = {
context = "context",
}
-local pick_fontloader = function (s)
+local function pick_fontloader (s)
local ldr = registered_loaders[s]
if ldr ~= nil and type (ldr) == "string" then
- logreport ("log", 2, "conf", "Using predefined fontloader \"%s\".", ldr)
+ logreport ("log", 2, "conf", "Using predefined fontloader %q.", ldr)
return ldr
end
local idx = stringfind (s, ":")
@@ -159,17 +159,17 @@ local pick_fontloader = function (s)
if stringsub (s, 1, idx - 1) == "context" then
local pth = stringsub (s, idx + 1)
pth = stringstrip (pth)
- logreport ("log", 2, "conf", "Context base path specified at \"%s\".", pth)
+ logreport ("log", 2, "conf", "Context base path specified at %q.", pth)
if lfsisdir (pth) then
- logreport ("log", 5, "conf", "Context base path exists at \"%s\".", pth)
+ logreport ("log", 5, "conf", "Context base path exists at %q.", pth)
return pth
end
pth = kpseexpand_path (pth)
if lfsisdir (pth) then
- logreport ("log", 5, "conf", "Context base path exists at \"%s\".", pth)
+ logreport ("log", 5, "conf", "Context base path exists at %q.", pth)
return pth
end
- logreport ("both", 0, "conf", "Context base path not found at \"%s\".", pth)
+ logreport ("both", 0, "conf", "Context base path not found at %q.", pth)
end
end
return nil
@@ -281,7 +281,7 @@ local min_terminal_width = 40
--- The “termwidth” value is only considered when printing
--- short status messages, e.g. when building the database
--- online.
-local check_termwidth = function ()
+local function check_termwidth ()
if config.luaotfload.misc.termwidth == nil then
local tw = 79
if not ( os.type == "windows" --- Assume broken terminal.
@@ -306,7 +306,7 @@ local check_termwidth = function ()
return true
end
-local set_font_filter = function ()
+local function set_font_filter ()
local names = fonts.names
if names and names.set_font_filter then
local formats = config.luaotfload.db.formats
@@ -318,7 +318,7 @@ local set_font_filter = function ()
return true
end
-local set_size_dimension = function ()
+local function set_size_dimension ()
local names = fonts.names
if names and names.set_size_dimension then
local dim = config.luaotfload.db.designsize_dimen
@@ -330,7 +330,7 @@ local set_size_dimension = function ()
return true
end
-local set_name_resolver = function ()
+local function set_name_resolver ()
local names = fonts.names
if names and names.resolve_cached then
--- replace the resolver from luatex-fonts
@@ -344,7 +344,7 @@ local set_name_resolver = function ()
return true
end
-local set_loglevel = function ()
+local function set_loglevel ()
if luaotfload then
luaotfload.log.set_loglevel (config.luaotfload.run.log_level)
return true
@@ -352,7 +352,7 @@ local set_loglevel = function ()
return false
end
-local build_cache_paths = function ()
+local function build_cache_paths ()
local paths = config.luaotfload.paths
local prefix = getwritablepath (paths.names_dir, "")
@@ -362,7 +362,7 @@ local build_cache_paths = function ()
end
prefix = lpegmatch (stripslashes, prefix)
- logreport ("log", 0, "conf", "Root cache directory is %s.", prefix)
+ logreport ("log", 0, "conf", "Root cache directory is %q.", prefix)
local index_file = filejoin (prefix, paths.index_file)
local lookups_file = filejoin (prefix, paths.lookups_file)
@@ -376,7 +376,7 @@ local build_cache_paths = function ()
end
-local set_default_features = function ()
+local function set_default_features ()
local default_features = config.luaotfload.default_features
luaotfload.features = luaotfload.features or {
global = { },
@@ -413,14 +413,14 @@ local number_t = "number"
local boolean_t = "boolean"
local function_t = "function"
-local tointeger = function (n)
+local function tointeger (n)
n = tonumber (n)
if n then
return mathfloor (n + 0.5)
end
end
-local toarray = function (s)
+local function toarray (s)
local fields = { lpegmatch (commasplitter, s) }
local ret = { }
for i = 1, #fields do
@@ -432,7 +432,7 @@ local toarray = function (s)
return ret
end
-local tohash = function (s)
+local function tohash (s)
local result = { }
local fields = toarray (s)
for _, field in next, fields do
@@ -571,7 +571,7 @@ local option_spec = {
return ldr
end
logreport ("log", 0, "conf",
- "Requested fontloader \"%s\" not defined, "
+ "Requested fontloader %q not defined, "
.. "use at your own risk.",
id)
return id
@@ -590,12 +590,12 @@ local option_spec = {
local cb = permissible_color_callbacks[cb_spec]
if cb then
logreport ("log", 3, "conf",
- "Using callback \"%s\" for font colorization.",
+ "Using callback %q for font colorization.",
cb)
return cb
end
logreport ("log", 0, "conf",
- "Requested callback identifier \"%s\" invalid, "
+ "Requested callback identifier %q invalid, "
.. "falling back to default.",
cb_spec)
return permissible_color_callbacks.default
@@ -637,32 +637,32 @@ local option_spec = {
--- FORMATTERS
-------------------------------------------------------------------------------
-local commented = function (str)
+local function commented (str)
return ";" .. str
end
local underscore_replacer = lpeg.replacer ("_", "-", true)
-local dashed = function (var)
+local function dashed (var)
--- INI spec dictates that dashes are valid in variable names, not
--- underscores.
return underscore_replacer (var) or var
end
local indent = " "
-local format_string = function (var, val)
+local function format_string (var, val)
return stringformat (indent .. "%s = %s", var, val)
end
-local format_integer = function (var, val)
+local function format_integer (var, val)
return stringformat (indent .. "%s = %d", var, val)
end
-local format_boolean = function (var, val)
+local function format_boolean (var, val)
return stringformat (indent .. "%s = %s", var, val == true and "true" or "false")
end
-local format_keyval = function (var, val)
+local function format_keyval (var, val)
local list = { }
local keys = table.sortedkeys (val)
for i = 1, #keys do
@@ -681,7 +681,7 @@ local format_keyval = function (var, val)
end
end
-local format_list = function (var, val)
+local function format_list (var, val)
local elts = { }
for i = 1, #val do elts [i] = val [i] end
if next (elts) then
@@ -690,7 +690,7 @@ local format_list = function (var, val)
end
end
-local format_section = function (title)
+local function format_section (title)
return stringformat ("[%s]", dashed (title))
end
@@ -764,7 +764,7 @@ local formatters = {
--doc]]--
-local tilde_expand = function (p)
+local function tilde_expand (p)
if #p > 2 then
if stringsub (p, 1, 2) == "~/" then
local homedir = osgetenv "HOME"
@@ -776,7 +776,7 @@ local tilde_expand = function (p)
return p
end
-local resolve_config_path = function ()
+local function resolve_config_path ()
for i = 1, #config_paths do
local t, p = unpack (config_paths[i])
local fullname
@@ -799,7 +799,7 @@ local resolve_config_path = function ()
return false
end
-local add_config_paths = function (t)
+local function add_config_paths (t)
if not next (t) then
return
end
@@ -887,8 +887,7 @@ local process_options = function (opts)
return new
end
-local apply
-apply = function (old, new)
+local function apply (old, new)
if not new then
if not old then
return false
@@ -916,7 +915,7 @@ apply = function (old, new)
return result
end
-local reconfigure = function ()
+local function reconfigure()
for i = 1, #reconf_tasks do
local name, task = unpack (reconf_tasks[i])
logreport ("both", 3, "conf", "Launch post-configuration task %q.", name)
@@ -928,7 +927,7 @@ local reconfigure = function ()
return true
end
-local read = function (extra)
+local function read (extra)
if extra then
add_config_paths (extra)
end
@@ -960,7 +959,7 @@ local read = function (extra)
return ret
end
-local apply_defaults = function ()
+local function apply_defaults ()
local defaults = default_config
local vars = read ()
--- Side-effects galore ...
@@ -968,7 +967,7 @@ local apply_defaults = function ()
return reconfigure ()
end
-local dump = function ()
+local function dump ()
local sections = table.sortedkeys (config.luaotfload)
local confdata = { }
for i = 1, #sections do