From 34405de988dcb334247e90e550964a65c6fb0103 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 27 Nov 2015 23:52:19 +0100 Subject: [mkstatus] update file list --- scripts/mkstatus | 116 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 88 insertions(+), 28 deletions(-) diff --git a/scripts/mkstatus b/scripts/mkstatus index 809d4af..f27d571 100755 --- a/scripts/mkstatus +++ b/scripts/mkstatus @@ -35,35 +35,95 @@ local stringmatch = string.match local verbose = false local filelist = "./build/luaotfload-status.lua" --- result +local srcdir = "src" +local builddir = "build" +local scriptdir = "scripts" +local loaderdir = "src/fontloader" +local rtdir = "src/fontloader/runtime" +local miscdir = "src/fontloader/misc" + local names = { - --- only the runtime files and scripts - { "src", "luaotfload-auxiliary.lua", }, - { "src/fontloader/runtime", "fontloader-basics-gen.lua", }, - --{ "src/fontloader", "fontloader-basics-nod.lua", }, - { "build", "luaotfload-characters.lua", }, - { "src", "luaotfload-colors.lua", }, - { "src", "luaotfload-database.lua", }, - { "src", "luaotfload-diagnostics.lua", }, - { "src", "luaotfload-features.lua", }, - --{ "src/fontloader", "fontloader-fonts-cbk.lua", }, - --{ "src/fontloader", "fontloader-fonts-def.lua", }, - --{ "src/fontloader", "fontloader-fonts-enc.lua", }, - --{ "src/fontloader", "fontloader-fonts-ext.lua", }, - --{ "src/fontloader", "fontloader-fonts-lua.lua", }, - --{ "src/fontloader", "fontloader-fonts-tfm.lua", }, - { "build", "luaotfload-glyphlist.lua", }, - { "src", "luaotfload-letterspace.lua", }, - { "src", "luaotfload-loaders.lua", }, - { "src", "luaotfload-log.lua", }, - { "src", "luaotfload-main.lua", }, - { "src/fontloader/runtime", "fontloader-reference.lua", }, - --{ "src", "luaotfload-override.lua", }, --> part of init now - { "src", "luaotfload-parsers.lua", }, - { "src", "luaotfload-tool.lua", }, - { "scripts", "mkcharacters", }, - { "scripts", "mkglyphlist", }, - { "scripts", "mkstatus", }, -} + + --- Luaotfload runtime files + { srcdir, "luaotfload-auxiliary.lua", }, + { srcdir, "luaotfload-colors.lua", }, + { srcdir, "luaotfload-configuration.lua", }, + { srcdir, "luaotfload-database.lua", }, + { srcdir, "luaotfload-diagnostics.lua", }, + { srcdir, "luaotfload-features.lua", }, + { srcdir, "luaotfload-init.lua", }, + { srcdir, "luaotfload-letterspace.lua", }, + { srcdir, "luaotfload-loaders.lua", }, + { srcdir, "luaotfload-log.lua", }, + { srcdir, "luaotfload-main.lua", }, + { srcdir, "luaotfload-parsers.lua", }, + { srcdir, "luaotfload-resolvers.lua", }, + { srcdir, "luaotfload-tool.lua", }, + + --- generated files + { builddir, "luaotfload-characters.lua", }, + { builddir, "luaotfload-glyphlist.lua", }, + + --- scripts + { scriptdir, "mkcharacters", }, + { scriptdir, "mkglyphlist", }, + { scriptdir, "mkimport", }, + { scriptdir, "mkstatus", }, + { scriptdir, "mktests", }, + + --- merge script + { loaderdir, "luaotfload-package.lua", }, + + --- fontloader runtimes + { rtdir, "fontloader-basics-gen.lua", }, + { rtdir, "fontloader-reference.lua", }, + { rtdir, "fontloader-tl2014.lua", }, + + --- fontloader constituents + { miscdir, "fontloader-basics-nod.lua", }, + { miscdir, "fontloader-data-con.lua", }, + { miscdir, "fontloader-font-afk.lua", }, + { miscdir, "fontloader-font-afm.lua", }, + { miscdir, "fontloader-font-cid.lua", }, + { miscdir, "fontloader-font-con.lua", }, + { miscdir, "fontloader-font-def.lua", }, + { miscdir, "fontloader-font-ini.lua", }, + { miscdir, "fontloader-font-map.lua", }, + { miscdir, "fontloader-font-otb.lua", }, + { miscdir, "fontloader-font-otf.lua", }, + { miscdir, "fontloader-font-oti.lua", }, + { miscdir, "fontloader-font-otp.lua", }, + { miscdir, "fontloader-fonts-cbk.lua", }, + { miscdir, "fontloader-fonts-def.lua", }, + { miscdir, "fontloader-fonts-demo-vf-1.lua", }, + { miscdir, "fontloader-fonts-enc.lua", }, + { miscdir, "fontloader-fonts-ext.lua", }, + { miscdir, "fontloader-fonts-inj.lua", }, + { miscdir, "fontloader-fonts.lua", }, + { miscdir, "fontloader-fonts-lua.lua", }, + { miscdir, "fontloader-fonts-ota.lua", }, + { miscdir, "fontloader-fonts-otn.lua", }, + { miscdir, "fontloader-fonts-syn.lua", }, + { miscdir, "fontloader-fonts-tfm.lua", }, + { miscdir, "fontloader-font-tfm.lua", }, + { miscdir, "fontloader-languages.lua", }, + { miscdir, "fontloader-l-boolean.lua", }, + { miscdir, "fontloader-l-file.lua", }, + { miscdir, "fontloader-l-function.lua", }, + { miscdir, "fontloader-l-io.lua", }, + { miscdir, "fontloader-l-lpeg.lua", }, + { miscdir, "fontloader-l-lua.lua", }, + { miscdir, "fontloader-l-math.lua", }, + { miscdir, "fontloader-l-string.lua", }, + { miscdir, "fontloader-l-table.lua", }, + { miscdir, "fontloader-math.lua", }, + { miscdir, "fontloader-mplib.lua", }, + { miscdir, "fontloader-preprocessor.lua", }, + { miscdir, "fontloader-swiglib.lua", }, + { miscdir, "fontloader-swiglib-test.lua", }, + { miscdir, "fontloader-util-str.lua", }, + +} --[[local names]] ----------------------------------------------------------------------- -- helpers -- cgit v1.2.3 From 36c87427e9bba1b3ca1dc58a0d6f914ca21bc9a6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Nov 2015 00:08:20 +0100 Subject: [doc,init] clarify default/reference distinction * default: our package (without lualibs) * reference: the package from upstream --- doc/filegraph.dot | 2 +- doc/luaotfload-main.tex | 27 +++++++++++++++++++-------- src/luaotfload-init.lua | 11 ++++++++++- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/doc/filegraph.dot b/doc/filegraph.dot index af3c8ad..9773ebd 100644 --- a/doc/filegraph.dot +++ b/doc/filegraph.dot @@ -204,7 +204,7 @@ strict digraph luaotfload_files { //looks weird with circo ... style = "filled,rounded", penwidth=2] - fontloader [label = "fontloader-reference.lua", + fontloader [label = "fontloader-YY-MM-DD.lua", shape = rect, width = "3.2cm", height = "1.2cm", diff --git a/doc/luaotfload-main.tex b/doc/luaotfload-main.tex index 28f92f7..ad38eb6 100644 --- a/doc/luaotfload-main.tex +++ b/doc/luaotfload-main.tex @@ -1105,6 +1105,7 @@ Below is a commented list of the files distributed with See figure \ref{file-graph} on page \pageref{file-graph} for a graphical representation of the dependencies. % +\label{package}% Through the script \fileent{luaotfload-package.lua} the \CONTEXT utility \fileent{mtx-package} is invoked to create the \identifier{luaotfload} fontloader as a merged (amalgamated) source @@ -1120,14 +1121,24 @@ file.\footnote{% \fileent{util-mrg.lua} that is part of \CONTEXT. } % -This file constitutes the “reference fontloader” and is part of the -\identifier{luaotfload} package as \fileent{fontloader-reference.lua}. +This file constitutes the “default fontloader” and is part of the +\identifier{luaotfload} package as \fileent{fontloader-YY-MM-DD.lua}, +where the uppercase letters are placeholders for the build date. +% A companion to it, \fileent{luatex-basics-gen.lua} must be loaded beforehand to set up parts of the environment required by the \CONTEXT libraries. % During a \TEX\ run, the fontloader initialization and injection happens in the module \fileent{luaotfload-init.lua}. +% +Additionally, the “reference fontloader” as imported from \LUATEX-Fonts +is provided as the file \fileent{fontloader-reference.lua}. +% +This file is self-contained in that it packages all the auxiliary \LUA +libraries too, as Luaotfload did up to the 2.5 series; since that job +has been offloaded to the \identifier{Lualibs} package, loading this +fontloader introduces a certain code duplication. A number of \emphasis{\LUA utility libraries} are not part of the \identifier{luaotfload} fontloader, contrary to its equivalent in @@ -1273,14 +1284,15 @@ files not contained in the merge. Some of these have no equivalent in \beginsubsection {Packaging} +\label{sec:pkg}% The fontloader code is integrated as an isolated component that can be switched out on demand. To specify the fontloader you wish to use, the configuration file (described in section \ref{sec:conf}) provides the option \inlinecode{fontloader}. Its value can be one of the identifiers \inlinecode{default} or -\inlinecode{reference} or the name of a file somewhere in the search -path of \LUATEX. +\inlinecode{reference} (see above, section \ref{package}) or the name +of a file somewhere in the search path of \LUATEX. % This will make \identifier {Luaotfload} locate the \CONTEXT source by means of \identifier{kpathsea} lookups and use those instead of the @@ -1298,10 +1310,9 @@ The parameter may be extended with a path to the \CONTEXT standalone distribution or a source repository -- outside the current \TEX distribution. -Like the \identifier{Lualibs} package, the reference fontloader is -deployed as a \emphasis{merged package} containing a series of \LUA -files joined together in their expected order and stripped of -non-significant parts. +Like the \identifier{Lualibs} package, the fontloader is deployed as a +\emphasis{merged package} containing a series of \LUA files joined +together in their expected order and stripped of non-significant parts. % The \fileent{mkimport} utility assists in pulling the files from a \CONTEXT tree and packaging them for use with \identifier{Luaotfload}.% diff --git a/src/luaotfload-init.lua b/src/luaotfload-init.lua index 0f7464a..28fe4b5 100644 --- a/src/luaotfload-init.lua +++ b/src/luaotfload-init.lua @@ -292,10 +292,19 @@ local init_main = function () or "reference" fontloader = tostring (fontloader) - if fontloader == "reference" or fontloader == "default" then + if fontloader == "reference" then logreport ("log", 4, "init", "Using reference fontloader.") load_fontloader_module (luaotfload.fontloader_package) + elseif fontloader == "default" then + --- Same as above but loader name not correctly replaced by the file name + --- of our fontloader package. Perhaps something’s wrong with the status + --- file which contains the datestamped filename? In any case, it can’t + --- hurt reporting it as a bug. + logreport ("both", 0, "init", "Fontloader substitution failed, got “default”.") + logreport ("log", 4, "init", "Falling back to reference fontloader.") + load_fontloader_module (luaotfload.fontloader_package) + elseif fontloader == "unpackaged" then logreport ("both", 4, "init", "Loading fontloader components individually.") -- cgit v1.2.3 From 4e24e6d3f5c152ab1dc49339561da4b7a80dc736 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Nov 2015 00:29:24 +0100 Subject: [build] include import and package targets in build info --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index bd0021b..5bed5b2 100644 --- a/Makefile +++ b/Makefile @@ -237,6 +237,9 @@ showtargets: @echo " chars import char-def.lua as luaotfload-characters.lua" @echo " status create repository info (luaotfload-status.lua)" @echo + @echo " import grab files from upstream" + @echo " package package fontloader" + @echo @echo " tds package a zipball according to the TDS" @echo " ctan package a zipball for uploading to CTAN" @echo " sign sign zipball" -- cgit v1.2.3 From 2ccf33b69115034605e0623a5e5d70c0bed11bff Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Nov 2015 00:35:10 +0100 Subject: [doc] explain usual packaging commands --- doc/luaotfload-main.tex | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/doc/luaotfload-main.tex b/doc/luaotfload-main.tex index ad38eb6..26d7314 100644 --- a/doc/luaotfload-main.tex +++ b/doc/luaotfload-main.tex @@ -1287,9 +1287,11 @@ files not contained in the merge. Some of these have no equivalent in \label{sec:pkg}% The fontloader code is integrated as an isolated component that can be switched out on demand. +% To specify the fontloader you wish to use, the configuration file (described in section \ref{sec:conf}) provides the option \inlinecode{fontloader}. +% Its value can be one of the identifiers \inlinecode{default} or \inlinecode{reference} (see above, section \ref{package}) or the name of a file somewhere in the search path of \LUATEX. @@ -1316,11 +1318,6 @@ together in their expected order and stripped of non-significant parts. % The \fileent{mkimport} utility assists in pulling the files from a \CONTEXT tree and packaging them for use with \identifier{Luaotfload}.% -\footnote{% - These tasks are performed, respectively, by the build targets - \inlinecode{import} and \inlinecode{package} of the - \identifier{Luaotfload} makefile. -} % The state of the files currently in \identifier{Luaotfload}’s repository can be queried: @@ -1340,6 +1337,21 @@ Whereas the command for packaging requires a path to the ./scripts/mkimport package ./src/fontloader/luaotfload-package.lua fontloader-custom.lua \endlisting +From the toplevel makefile, the targets \inlinecode{import} and +\inlinecode{package} provide easy access to the commands as invoked during +the \identifier{Luaotfload} build process.\footnote{% + \emphasis{Hint for those interested in the packaging process}: issue + \inlinecode{make show} for a list of available build routines. +} +These will call \inlinecode{mkimport} script with the correct +parameters to generate a datestamped package. +% +Whether files have been updated in the upstream distribution can be +queried by \inlinecode{./scripts/mkimport news}. +% +This will compare the imported files with their counterparts in the +\CONTEXT distribution and report changes. + \endsubsection \endsection -- cgit v1.2.3 From 43bc97f988e1e307720768bb6cb127ee05360e2e Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Nov 2015 00:50:11 +0100 Subject: [build] kill off install target MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A while back we had one confused user who apparently had a borked install due to this. Since it hasn’t been tested, we replace the original instructions with a help message. The target may be reintroduced at some point (build TDS, then extract to local tree), but for now it’s not worth the hassle. --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5bed5b2..bda7fbc 100644 --- a/Makefile +++ b/Makefile @@ -194,10 +194,14 @@ sign: $(CTAN_ZIPSIG) .PHONY: install manifest clean mrproper show showtargets check import news -install: $(ALL_STATUS) - @echo "Installing in '$(TEXMFROOT)'." - $(run-install-docs) - $(run-install) +install: + @echo " ××××××××××××××××××××××××××××××××" + @echo " There is no “install” target." + @echo " ××××××××××××××××××××××××××××××××" + @echo " Compile a TDS zipball (make tds)" + @echo " and extract that into your local" + @echo " TEXMF instead." + @echo " ××××××××××××××××××××××××××××××××" manifest: @echo "Source files:" -- cgit v1.2.3 From e4f9dfc0ddff0700767bbc769e59dc429e127857 Mon Sep 17 00:00:00 2001 From: Dohyun Kim Date: Fri, 27 Nov 2015 17:14:25 +0900 Subject: [colors] support pgf transparency in luatex v0.85 With tex.scantoks provided by luatex v0.85, now we can support color transparency in harmony with beamer/pgf/tikz. No hacking needed at tex macro level, all done in lua code. --- src/luaotfload-colors.lua | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/luaotfload-colors.lua b/src/luaotfload-colors.lua index ca5a067..572c9fc 100644 --- a/src/luaotfload-colors.lua +++ b/src/luaotfload-colors.lua @@ -37,11 +37,6 @@ local nodetail = nodedirect.tail local getattribute = nodedirect.has_attribute local setattribute = nodedirect.set_attribute -local texset = tex.set -local texget = tex.get -local texsettoks = tex.settoks -local texgettoks = tex.gettoks - local stringformat = string.format local identifiers = fonts.hashes.identifiers @@ -274,6 +269,12 @@ node_colorize = function (head, toplevel, current_color) return head, current_color end +local getpageres = pdf.getpageresources or function() return pdf.pageresources end +local setpageres = pdf.setpageresources or function(s) pdf.pageresources = s end +local catat11 = luatexbase.registernumber("catcodetable@atletter") +local gettoks, scantoks = tex.gettoks, tex.scantoks +local pgf = { bye = "pgfutil@everybye", extgs = "\\pgf@sys@addpdfresource@extgs@plain" } + --- node -> node local color_handler = function (head) head = todirect(head) @@ -283,12 +284,11 @@ local color_handler = function (head) -- now append our page resources if res then res["1"] = true - local tpr = texget("pdfpageresources") - local no_extgs = not tpr:find("/ExtGState<<.*>>") - local pgf_loaded = no_extgs and luaotfload.pgf_loaded - if pgf_loaded then - tpr = texgettoks(pgf_loaded) + if scantoks and pgf.bye and not pgf.loaded then + pgf.loaded = token.create(pgf.bye).cmdname == "assign_toks" + pgf.bye = pgf.loaded and pgf.bye end + local tpr = pgf.loaded and gettoks(pgf.bye) or getpageres() or "" local t = "" for k in pairs(res) do @@ -298,14 +298,14 @@ local color_handler = function (head) end end if t ~= "" then - if pgf_loaded then - texsettoks("global", pgf_loaded, tpr..t) + if pgf.loaded then + scantoks("global", pgf.bye, catat11, stringformat("%s{%s}%s", pgf.extgs, t, tpr)) else - if no_extgs then - tpr = tpr .. "/ExtGState<<>>" + local tpr, n = tpr:gsub("/ExtGState<<", "%1"..t) + if n == 0 then + tpr = stringformat("%s/ExtGState<<%s>>", tpr, t) end - tpr = tpr:gsub("/ExtGState<<", "%1"..t) - texset("global", "pdfpageresources", tpr) + setpageres(tpr) end end res = nil -- reset res -- cgit v1.2.3 From 91ae11f974db282b675e8582fab2c1bd5eb1f13b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Nov 2015 00:59:43 +0100 Subject: [doc] clarify fontloader options in luaotfload.conf(5) --- doc/luaotfload.conf.rst | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/doc/luaotfload.conf.rst b/doc/luaotfload.conf.rst index 12dd887..958ecee 100644 --- a/doc/luaotfload.conf.rst +++ b/doc/luaotfload.conf.rst @@ -297,27 +297,29 @@ break tools like Fontspect that rely on the ``patch_font`` callback provided by Luaotfload to perform important corrections on font data. The fontloader backend can be selected by setting the value of -``fontloader``. Other than the default, which selects the packaged -``reference`` loader as shipped with Luaotfload, a file name accessible -by kpathsea can be specified. Alternatively, the individual files that -constitute the fontloader can be loaded directly. While less efficient, -this greatly aids debugging since error messages will reference the -actual line numbers of the source files and explanatory comments are -not stripped. Currently, three distinct loading strategies are -available: ``unpackaged`` will load the batch that is part of -Luaotfload. These contain the identical source code that the reference -fontloader has been compiled from. Another option, ``context`` will -attempt to load the same files by their names in the Context format -from the search path. Consequently this option allows to use the -version of Context that comes with the TeX distribution. Distros tend -to prefer the stable version (“current” in Context jargon) of those -files so certain bugs encountered in the more bleeding edge Luaotfload -can be avoided this way. A third option is to use ``context`` with a -colon to specify a directory prefix where the *TEXMF* is located that -the files should be loaded from, e. g. ``context:~/context/tex/texmf-context``. -This can be used when referencing another distribution like the Context -minimals that is installed under a different path not indexed by -kpathsea. +``fontloader``. The most important choices are ``default``, which will +load the dedicated Luaotfload fontloader, and ``reference``, the +upstream package as shipped with Luaotfload. Other than those, a file +name accessible via kpathsea can be specified. + +Alternatively, the individual files that constitute the fontloader can +be loaded directly. While less efficient, this greatly aids debugging +since error messages will reference the actual line numbers of the +source files and explanatory comments are not stripped. Currently, +three distinct loading strategies are available: ``unpackaged`` will +load the batch that is part of Luaotfload. These contain the identical +source code that the reference fontloader has been compiled from. +Another option, ``context`` will attempt to load the same files by +their names in the Context format from the search path. Consequently +this option allows to use the version of Context that comes with the +TeX distribution. Distros tend to prefer the stable version (“current” +in Context jargon) of those files so certain bugs encountered in the +more bleeding edge Luaotfload can be avoided this way. A third option +is to use ``context`` with a colon to specify a directory prefix where +the *TEXMF* is located that the files should be loaded from, e. g. +``context:~/context/tex/texmf-context``. This can be used when +referencing another distribution like the Context minimals that is +installed under a different path not indexed by kpathsea. The value of ``log-level`` sets the default verbosity of messages printed by Luaotfload. Only messages defined with a verbosity of less -- cgit v1.2.3 From 78a1273715f8681fe8cb013b9699df11bfa56eaa Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Nov 2015 14:58:19 +0100 Subject: [diagnose] adapt invocation of getwritablepath() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some upstream API change (possibly in file.join()) caused that function to emit relative paths. file.join("/foo", "bar") --> good file.join("/foo", "" ) --> good file.join("/foo" ) --> wtf‽ --- src/luaotfload-diagnostics.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/luaotfload-diagnostics.lua b/src/luaotfload-diagnostics.lua index 582105a..cd5082c 100644 --- a/src/luaotfload-diagnostics.lua +++ b/src/luaotfload-diagnostics.lua @@ -171,6 +171,11 @@ local get_permissions = function (t, location) location = lpegmatch (stripslashes, location) end local attributes = lfsattributes (location) + if not attributes then + print"" + print("attr", location, attributes) + os.exit() + end if not attributes and t == "f" then attributes = get_tentative_attributes (location) @@ -238,12 +243,10 @@ local check_conformance = function (spec, permissions, errcnt) return errcnt end -local desired_permissions local init_desired_permissions = function () - inspect(config.luaotfload.paths) local paths = config.luaotfload.paths - desired_permissions = { - { "d", {"r","w"}, function () return caches.getwritablepath () end }, + return { + { "d", {"r","w"}, function () return caches.getwritablepath ("", "") end }, { "d", {"r","w"}, paths.prefix }, { "f", {"r","w"}, paths.index_path_lua .. ".gz" }, { "f", {"r","w"}, paths.index_path_luc }, @@ -254,7 +257,7 @@ end local check_permissions = function (errcnt) out [[=============== file permissions ==============]] - if not desired_permissions then init_desired_permissions () end + local desired_permissions = init_desired_permissions () for i = 1, #desired_permissions do local t, spec, path = unpack (desired_permissions[i]) if type (path) == "function" then -- cgit v1.2.3 From e0c25f5fce650835da6316287164408476152b45 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Nov 2015 15:00:41 +0100 Subject: [tool,db] make cache directives work again These were rendered unusable due to the suspended initialization. Creating the directives mapping on the fly is just as good. --- src/luaotfload-database.lua | 2 +- src/luaotfload-tool.lua | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua index 35450b5..881cfe8 100644 --- a/src/luaotfload-database.lua +++ b/src/luaotfload-database.lua @@ -3414,7 +3414,7 @@ end local getwritablecachepath = function ( ) --- fonts.handlers.otf doesn’t exist outside a Luatex run, --- so we have to improvise - local writable = getwritablepath (config.luaotfload.paths.cache_dir) + local writable = getwritablepath (config.luaotfload.paths.cache_dir, "") if writable then return writable end diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua index ab025b3..ab495a9 100755 --- a/src/luaotfload-tool.lua +++ b/src/luaotfload-tool.lua @@ -858,7 +858,7 @@ end --- bisect mode ------------------------------------------------------------------------------- -local bisect_status_path = caches.getwritablepath "bisect" +local bisect_status_path = caches.getwritablepath ("bisect", "") local bisect_status_file = bisect_status_path .."/" .. "luaotfload-bisect-status.lua" local bisect_status_fmt = [[ --[==[------------------------------------------------------------------------- @@ -1174,14 +1174,17 @@ actions.flush = function (job) return false, false end -local cache_directives = { - ["purge"] = fonts.names.purge_cache, - ["erase"] = fonts.names.erase_cache, - ["show"] = fonts.names.show_cache, -} +local cache_directives = function () + --- These exist only after initialization. + return { + ["purge"] = fonts.names.purge_cache, + ["erase"] = fonts.names.erase_cache, + ["show"] = fonts.names.show_cache, + } +end actions.cache = function (job) - local directive = cache_directives[job.cache] + local directive = cache_directives()[job.cache] if not directive or type(directive) ~= "function" then logreport ("info", 2, "cache", "Invalid font cache directive %s.", job.cache) -- cgit v1.2.3 From 64efae348057cedf3c6cebe0edc92952f0d51b81 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 28 Nov 2015 23:00:04 +0100 Subject: [main] remove locals for provides_module() return values As of ltluatex, provides_module() has no return value any longer. --- src/luaotfload-main.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index 17d06d4..6fe49e2 100644 --- a/src/luaotfload-main.lua +++ b/src/luaotfload-main.lua @@ -62,8 +62,7 @@ local luatexbase = luatexbase local require = require local type = type -local _error, _warning, _info, _log = - luatexbase.provides_module(luaotfload.module) +luatexbase.provides_module (luaotfload.module) --[[doc-- -- cgit v1.2.3 From fb41f30dd8120532307f6ca1c227cd4807d4f719 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Nov 2015 21:41:23 +0100 Subject: [aux] fix typo in function name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Doesn’t seem like anyone is using these since this would’ve exploded immediately … --- src/luaotfload-auxiliary.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/luaotfload-auxiliary.lua b/src/luaotfload-auxiliary.lua index 15541af..c50e0cd 100644 --- a/src/luaotfload-auxiliary.lua +++ b/src/luaotfload-auxiliary.lua @@ -63,7 +63,7 @@ aux.start_rewrite_fontname = start_rewrite_fontname local stop_rewrite_fontname = function () if rewriting == true then - luatexbase.remove_fromt_callback + luatexbase.remove_from_callback ("luaotfload.patch_font", "luaotfload.rewrite_fontname") rewriting = false report ("log", 1, "aux", -- cgit v1.2.3 From f7f541616aaf77c5f2ecb40a50f72b2e94575675 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Nov 2015 22:04:00 +0100 Subject: [loaders] customize define_font reset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function needn’t be as general for this kind of callback. The new implementation is simpler but also complains about irregularities like multiple registered functions. --- src/luaotfload-loaders.lua | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/luaotfload-loaders.lua b/src/luaotfload-loaders.lua index 715aa8a..0ae281e 100644 --- a/src/luaotfload-loaders.lua +++ b/src/luaotfload-loaders.lua @@ -110,13 +110,22 @@ end --doc]]-- -local function reset_callback(name,make_false) - for _,v in pairs(luatexbase.callback_descriptions(name)) - do - luatexbase.remove_from_callback(name,v) - end - if make_false == true then - luatexbase.disable_callback(name) +local purge_define_font = function () + local cdesc = luatexbase.callback_descriptions "define_font" + --- define_font is an “exclusive” callback, meaning that there can + --- only ever be one entry. Everything beyond that would indicate + --- that something is broken. + local _, d = next (cdesc) + if d then + local i, d2 = next (cdesc, 1) + if d2 then --> issue warning + logreport ("both", 0, "loaders", + "Callback table for define_font contains multiple entries: \z + { [%d] = “%s” } -- seems fishy.", i, d2) + end + logreport ("log", 0, "loaders", + "Entry ``%s`` present in define_font callback; overriding.", d) + luatexbase.remove_from_callback ("define_font", d) end end @@ -125,7 +134,7 @@ local install_callbacks = function () local dummy_function = function () end create_callback ("luaotfload.patch_font", "simple", dummy_function) create_callback ("luaotfload.patch_font_unsafe", "simple", dummy_function) - reset_callback "define_font" + purge_define_font () local definer = config.luaotfload.run.definer luatexbase.add_to_callback ("define_font", definers[definer or "patch"], -- cgit v1.2.3 From e8c12e905db79d0a7cc716ae6d6d02663cbd085e Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Nov 2015 22:26:45 +0100 Subject: [conf] ensure correct fontloader is loaded without config file --- src/luaotfload-configuration.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index 57311dc..0be7c14 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -126,8 +126,12 @@ local feature_presets = { --doc]]-- +local default_fontloader = function () + return luaotfloadstatus and luaotfloadstatus.notes.loader or "reference" +end + local registered_loaders = { - default = luaotfloadstatus and luaotfloadstatus.notes.loader or "reference", + default = default_fontloader (), reference = "reference", unpackaged = "unpackaged", context = "context", @@ -198,7 +202,7 @@ local default_config = { definer = "patch", log_level = 0, color_callback = "post_linebreak_filter", - fontloader = "default", + fontloader = default_fontloader (), }, misc = { bisect = false, -- cgit v1.2.3 From c27353ac580901c2afe392a473b2cc53ffcf394e Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Nov 2015 22:35:33 +0100 Subject: [main] refine very early logging This kludge dumps the input arguments on one line each -- fix this by defining a dumb imitation of our real logger that is installed later on. --- src/luaotfload-main.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index 6fe49e2..dd94b1e 100644 --- a/src/luaotfload-main.lua +++ b/src/luaotfload-main.lua @@ -98,7 +98,13 @@ end local make_loader_name = function (prefix, name) local msg = luaotfload.log and luaotfload.log.report - or function (...) texio.write_nl ("log", ...) end + or function (stream, lvl, cat, ...) + if lvl > 1 then --[[not pressing]] return end + texio.write_nl ("log", + string.format ("luaotfload | %s : ", + tostring (cat))) + texio.write (string.format (...)) + end if not name then msg ("both", 0, "load", "Fatal error: make_loader_name (“%s”, “%s”).", -- cgit v1.2.3 From 9ceba217e323ab5572ab32708af1f4e1934397a7 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 29 Nov 2015 22:46:38 +0100 Subject: [*] tidy up headers, attributions --- src/luaotfload-colors.lua | 2 +- src/luaotfload-configuration.lua | 2 +- src/luaotfload-diagnostics.lua | 2 +- src/luaotfload-init.lua | 2 +- src/luaotfload-loaders.lua | 5 +++-- src/luaotfload-main.lua | 2 +- src/luaotfload.sty | 1 + 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/luaotfload-colors.lua b/src/luaotfload-colors.lua index 572c9fc..c75696a 100644 --- a/src/luaotfload-colors.lua +++ b/src/luaotfload-colors.lua @@ -1,7 +1,7 @@ if not modules then modules = { } end modules ['luaotfload-colors'] = { version = "2.6", comment = "companion to luaotfload-main.lua (font color)", - author = "Khaled Hosny, Elie Roux, Philipp Gesang, Dohyun Kim", + author = "Khaled Hosny, Elie Roux, Philipp Gesang, Dohyun Kim, David Carlisle", copyright = "Luaotfload Development Team", license = "GNU GPL v2.0" } diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua index 0be7c14..5e2800d 100644 --- a/src/luaotfload-configuration.lua +++ b/src/luaotfload-configuration.lua @@ -3,7 +3,7 @@ -- FILE: luaotfload-configuration.lua -- DESCRIPTION: config file reader -- REQUIREMENTS: Luaotfload 2.6 or above --- AUTHOR: Philipp Gesang (Phg), +-- AUTHOR: Philipp Gesang, -- AUTHOR: Dohyun Kim ------------------------------------------------------------------------------- -- diff --git a/src/luaotfload-diagnostics.lua b/src/luaotfload-diagnostics.lua index cd5082c..a3a1841 100644 --- a/src/luaotfload-diagnostics.lua +++ b/src/luaotfload-diagnostics.lua @@ -3,7 +3,7 @@ -- FILE: luaotfload-diagnostics.lua -- DESCRIPTION: functionality accessible by the --diagnose option -- REQUIREMENTS: luaotfload-tool.lua --- AUTHOR: Philipp Gesang (Phg), +-- AUTHOR: Philipp Gesang ----------------------------------------------------------------------- -- local names = fonts.names diff --git a/src/luaotfload-init.lua b/src/luaotfload-init.lua index 28fe4b5..a8fc77b 100644 --- a/src/luaotfload-init.lua +++ b/src/luaotfload-init.lua @@ -2,7 +2,7 @@ ----------------------------------------------------------------------- -- FILE: luaotfload-init.lua -- DESCRIPTION: Luaotfload font loader initialization --- REQUIREMENTS: luatex v.0.80 or later; packages lualibs, luatexbase +-- REQUIREMENTS: luatex v.0.80 or later; packages lualibs -- AUTHOR: Philipp Gesang (Phg), ----------------------------------------------------------------------- -- diff --git a/src/luaotfload-loaders.lua b/src/luaotfload-loaders.lua index 0ae281e..0f22f46 100644 --- a/src/luaotfload-loaders.lua +++ b/src/luaotfload-loaders.lua @@ -2,8 +2,9 @@ ----------------------------------------------------------------------- -- FILE: luaotfload-loaders.lua -- DESCRIPTION: Luaotfload callback handling --- REQUIREMENTS: luatex v.0.80 or later; packages lualibs, luatexbase --- AUTHOR: Philipp Gesang (Phg), , Hans Hagen, Khaled Hosny, Elie Roux +-- REQUIREMENTS: luatex v.0.80 or later; package lualibs +-- AUTHOR: Philipp Gesang +-- AUTHOR: Hans Hagen, Khaled Hosny, Elie Roux, David Carlisle ----------------------------------------------------------------------- -- --- Contains parts of the earlier main script. diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua index dd94b1e..b8050e4 100644 --- a/src/luaotfload-main.lua +++ b/src/luaotfload-main.lua @@ -1,7 +1,7 @@ ----------------------------------------------------------------------- -- FILE: luaotfload-main.lua -- DESCRIPTION: Luaotfload entry point --- REQUIREMENTS: luatex v.0.80 or later; packages lualibs, luatexbase +-- REQUIREMENTS: luatex v.0.80 or later; packages lualibs -- AUTHOR: Élie Roux, Khaled Hosny, Philipp Gesang ----------------------------------------------------------------------- -- diff --git a/src/luaotfload.sty b/src/luaotfload.sty index ad4ef2d..c674ab0 100644 --- a/src/luaotfload.sty +++ b/src/luaotfload.sty @@ -4,6 +4,7 @@ %% and Khaled Hosny %% and Philipp Gesang %% and Dohyun Kim +%% and David Carlisle %% %% This file is part of Luaotfload. %% -- cgit v1.2.3