From 2c79c7d38d6dcb41f52eb7f44fb744771408ec39 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 13 May 2013 20:42:38 +0200 Subject: work around unsupported full paths in anon lookups windows only: http://tug.org/pipermail/lualatex-dev/2013-May/001519.html --- luaotfload-features.lua | 2 +- luaotfload.dtx | 40 +++++++++++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/luaotfload-features.lua b/luaotfload-features.lua index e732ed9..33b529f 100644 --- a/luaotfload-features.lua +++ b/luaotfload-features.lua @@ -1053,7 +1053,7 @@ local handle_request = function (specification) specification.specification) report("log", 0, "load", "use square bracket syntax or consult the documentation.") specification.name = specification.specification - specification.lookup = "file" + specification.lookup = "path" return specification end local lookup, name = select_lookup(request) diff --git a/luaotfload.dtx b/luaotfload.dtx index e576112..16f7bf6 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -1832,13 +1832,13 @@ local resolvefile = fonts.names.crude_file_lookup --local resolvefile = fonts.names.crude_file_lookup_verbose function request_resolvers.file(specification) - local name=resolvefile(specification.name) - local suffix=file.suffix(name) + local name = resolvefile(specification.name) + local suffix = file.suffix(name) if formats[suffix] then - specification.forced=suffix - specification.name=file.removesuffix(name) + specification.forced = suffix + specification.name = file.removesuffix(name) else - specification.name=name + specification.name = name end end @@ -1869,6 +1869,7 @@ end % For this reason, we introduce an extra check with an early return. % % \begin{macrocode} + local type1_formats = { "tfm", "ofm", } request_resolvers.anon = function (specification) @@ -1880,6 +1881,20 @@ request_resolvers.anon = function (specification) return end end + --- under some weird circumstances absolute paths get + --- passed to the definer; we have to catch them + --- before the name: resolver misinterprets them. + name = specification.specification + local exists, _ = lfsisfile(name) + if exists then --- garbage; we do this because we are nice, + --- not because it is correct + logs.names_report("log", 1, "load", "file “%s” exists", name) + logs.names_report("log", 1, "load", + "... overriding borked anon: lookup with path: lookup") + specification.name = name + request_resolvers.path(specification) + return + end request_resolvers.name(specification) end @@ -1892,9 +1907,21 @@ end % % \begin{macrocode} request_resolvers.path = function (specification) - local exists, _ = lfsisfile(specification.name) + local name = specification.name + local exists, _ = lfsisfile(name) if not exists then -- resort to file: lookup + logs.names_report("log", 1, "load", + "path lookup of “%s” unsuccessful, falling back to file:", + name) request_resolvers.file(specification) + else + local suffix = file.suffix(name) + if formats[suffix] then + specification.forced = suffix + specification.name = file.removesuffix(name) + else + specification.name = name + end end end @@ -1956,7 +1983,6 @@ loadmodule"auxiliary.lua" --- additionaly high-level functionality (new) -- vim:tw=71:sw=4:ts=4:expandtab - % \end{macrocode} % % \iffalse -- cgit v1.2.3 From bd8bb3ee7f8ff1d97cb487ac6b8ff282945fcdca Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 13 May 2013 20:48:06 +0200 Subject: run rst2man instead of rst2man2 on manpage --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c1e98f6..7eb2fe5 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ DO_TEX = luatex --interaction=batchmode $< >/dev/null DO_LATEX = latexmk -pdf -e '$$pdflatex = q(lualatex %O %S)' -silent $< >/dev/null DO_GRAPHVIZ = dot -Tpdf -o $@ $< > /dev/null DO_GLYPHLIST = texlua ./mkglyphlist > /dev/null -DO_DOCUTILS = rst2man2 $< >$@ 2>/dev/null +DO_DOCUTILS = rst2man $< >$@ 2>/dev/null all: $(GENERATED) graph: $(GRAPHED) -- cgit v1.2.3 From deee6a29cb7ef11e15d1f9376d5f56516b46d726 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 13 May 2013 21:31:27 +0200 Subject: remove dead code from ``luaotfload-features.lua`` --- luaotfload-features.lua | 51 +++++++++++++++---------------------------------- 1 file changed, 15 insertions(+), 36 deletions(-) diff --git a/luaotfload-features.lua b/luaotfload-features.lua index 33b529f..1c85dd7 100644 --- a/luaotfload-features.lua +++ b/luaotfload-features.lua @@ -873,8 +873,14 @@ local toboolean = function (s) return stringlower(s) end ---- dirty test if a file: request is actually a path: lookup; don’t ---- ask! +--[[doc-- + + Dirty test if a file: request is actually a path: lookup; don’t + ask! Note this fails on Windows-style absolute paths. These will + *really* have to use the correct request. + +--doc]]-- + local check_garbage = function (_,i, garbage) if stringfind(garbage, "/") then report("log", 0, "load", --- ffs use path! @@ -1388,9 +1394,13 @@ local anum_specification = { }, } ---- below the specifications as given in the removed font-otc.lua ---- the rest was identical to what this file had from the beginning ---- both make the “anum.tex” test pass anyways +--[[doc-- + + Below the specifications as given in the removed font-otc.lua. + The rest was identical to what this file had from the beginning. + Both make the “anum.tex” test pass anyways. + +--doc]]-- otf.addfeature("anum",anum_specification) @@ -1399,35 +1409,4 @@ registerotffeature { description = 'arabic digits', } -if characters.combined then - - local tcom = { } - - local function initialize() - characters.initialize() - for first, seconds in next, characters.combined do - for second, combination in next, seconds do - tcom[combination] = { first, second } - end - end - -- return false - end - - local tcom_specification = { - type = "ligature", - features = everywhere, - data = tcom, - flags = noflags, - initialize = initialize, - } - - otf.addfeature("tcom",tcom_specification) - - registerotffeature { - name = 'tcom', - description = 'tex combinations', - } - -end - -- vim:tw=71:sw=4:ts=4:expandtab -- cgit v1.2.3 From 60d61d05ea89cc9e9f6a97fa4a807d649c70c3d3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 13 May 2013 21:33:52 +0200 Subject: silence glyphlist loader --- luaotfload-override.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/luaotfload-override.lua b/luaotfload-override.lua index 6c44f35..51d2749 100644 --- a/luaotfload-override.lua +++ b/luaotfload-override.lua @@ -147,10 +147,11 @@ if fonts then --- need to be running TeX if k == "unicodes" then local glyphlist = resolvers.findfile"luaotfload-glyphlist.lua" if glyphlist then - names_report("both", 0, "load", "loading the Adobe glyph list") + names_report("log", 1, "load", "loading the Adobe glyph list") else glyphlist = resolvers.findfile"font-age.lua" - names_report("both", 0, "load", "loading the extended glyph list from ConTeXt") + names_report("both", 0, "load", + "loading the extended glyph list from ConTeXt") end local unicodes = dofile(glyphlist) fonts.encodings.agl = { unicodes = unicodes } -- cgit v1.2.3 From 646092976d0686a566554039b3f426a55b4f1266 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 13 May 2013 21:50:20 +0200 Subject: add note about loggers --- luaotfload-override.lua | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/luaotfload-override.lua b/luaotfload-override.lua index 51d2749..5e642e4 100644 --- a/luaotfload-override.lua +++ b/luaotfload-override.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['luat-ovr'] = { license = "GNU GPL v2" } -local module_name = "luaotfload" +local module_name = "luaotfload" local texiowrite_nl = texio.write_nl local stringformat = string.format @@ -75,6 +75,32 @@ end --- at default (zero), we aim to be quiet local level_ids = { common = 1, loading = 2, search = 3 } +--[[doc-- + + The names_report logger is used more or less all over luaotfload. + Its requirements are twofold: + + 1) Provide two logging channels, the terminal and the log file; + 2) Allow for control over verbosity levels. + + The first part is addressed by specifying the log *mode* as the + first argument that can be either “log”, meaning the log file, or + “both”: log file and stdout. Anything else is taken as referring to + stdout only. + + Verbosity levels, though not as fine-grained as e.g. Context’s + system of tracers, allow keeping the logging spam caused by + different subsystems manageable. By default, luaotfload will not + emit anything if things are running smoothly on level zero. Only + warning messages are relayed, while the other messages are skipped + over. (This is a little sub-optimal performance-wise since the + function calls to the logger are executed regardless.) The log + level during a Luatex run can be adjusted by setting the “loglevel” + field in config.luaotfload, or by calling logs.set_loglevel() as + defined above. + +--doc]]-- + local names_report = function (mode, lvl, ...) if type(lvl) == "string" then lvl = level_ids[lvl] -- cgit v1.2.3