From 1df81cbdd55a0e40b4f8c7ee9e4a6d836a6d8562 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 24 Jul 2014 22:35:01 +0200 Subject: [doc] document the --conf and --dumpconf options --- doc/luaotfload-tool.rst | 13 +++++++++++-- doc/luaotfload.conf.rst | 9 ++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/luaotfload-tool.rst b/doc/luaotfload-tool.rst index 4b1a934..99e3fb2 100644 --- a/doc/luaotfload-tool.rst +++ b/doc/luaotfload-tool.rst @@ -6,7 +6,7 @@ generate and query the Luaotfload font names database ----------------------------------------------------------------------- -:Date: 2014-03-30 +:Date: 2014-07-24 :Copyright: GPL v2.0 :Version: 2.5 :Manual section: 1 @@ -42,6 +42,8 @@ SYNOPSIS **luaotfload-tool** --diagnose=CHECK +**luaotfload-tool** --conf=FILE --dumpconf + DESCRIPTION ======================================================================= @@ -277,6 +279,13 @@ miscellaneous commas, e.g. ``--diagnose=files,permissions``. Specify ``thorough`` to run all checks. +--conf=FILE Read the configuration from *FILE*. See + **luaotfload.conf**\(%) for documentation + concerning the format and available options. +--dumpconf Print the currently active configuration; the + output can be saved to a file and used for + bootstrapping a custom configuration files. + FILES ======================================================================= @@ -297,7 +306,7 @@ them with the next run of *LuaTeX*. SEE ALSO ======================================================================= -**luatex** (1), **lua** (1) +**luaotfload.conf**\(5), **luatex**\(1), **lua**\(1) * ``texdoc luaotfload`` to display the manual for the *Luaotfload* package diff --git a/doc/luaotfload.conf.rst b/doc/luaotfload.conf.rst index 774095b..b0d19d9 100644 --- a/doc/luaotfload.conf.rst +++ b/doc/luaotfload.conf.rst @@ -55,7 +55,14 @@ along with lots of other information. To observe the difference in behavior, save above snippet to ``./luaotfload.conf`` and update the font index: :: - luaotfload --update --force + luaotfload-tool --update --force + +The current configuration can be written to disk using +**luaotfload-tool**: :: + + luaotfload-tool --dumpconf > luaotfload.conf + +The result can itself be used as a configuration file. SYNTAX -- cgit v1.2.3 From b8dcba5de882bd04b27472a3fdc3a562c55d1ad8 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 24 Jul 2014 22:51:06 +0200 Subject: [conf] dump default features along with config --- src/luaotfload-configuration.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index 10e791a..0b2da64 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -494,6 +494,25 @@ local format_boolean = function (var, val) return stringformat (indent .. "%s = %s", var, val == true and "true" or "false") end +local format_keyval = function (var, val) + local list = { } + local keys = table.sortedkeys (val) + for i = 1, #keys do + local key = keys[i] + local subval = val[key] + if subval == true then + list[#list + 1] = stringformat ("%s", key) + else + list[#list + 1] = stringformat ("%s=%s", key, val[key]) + end + end + if next (list) then + return stringformat (indent .. "%s = %s", + var, + tableconcat (list, ",")) + end +end + local format_section = function (title) return stringformat ("[%s]", title) end @@ -543,6 +562,9 @@ local formatters = { strip = { false, format_boolean }, update_live = { false, format_boolean }, }, + default_features = { + __default = { true, format_keyval }, + }, misc = { bisect = { false, format_boolean }, statistics = { false, format_boolean }, @@ -792,6 +814,10 @@ local dump = function () local var = varnames[j] local val = vars[var] local comment, sformat = unpack (sformats[var] or { }) + if not sformat then + comment, sformat = unpack (sformats.__default or { }) + end + if sformat then local dashedvar = dashed (var) if comment then @@ -800,6 +826,7 @@ local dump = function () confdata[#confdata + 1] = sformat (dashedvar, val) end end + end confdata[#confdata + 1] = "" end -- cgit v1.2.3