From 34d9f5c80a871394b2396ab486222e4e6f4b75d6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 14 May 2013 17:50:30 +0200 Subject: add diablindall.ttf to blacklist --- luaotfload-blacklist.cnf | 2 ++ luaotfload-features.lua | 2 +- luaotfload-tool.lua | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/luaotfload-blacklist.cnf b/luaotfload-blacklist.cnf index 943d347..2a21091 100644 --- a/luaotfload-blacklist.cnf +++ b/luaotfload-blacklist.cnf @@ -2,4 +2,6 @@ LastResort.ttf % a MacOSX font, but also available for free from unicode.org % Segfaults under LuaTeX 0.76 lingoes.ttf +% http://tug.org/pipermail/luatex/2013-May/004239.html +Diablindall.ttf diff --git a/luaotfload-features.lua b/luaotfload-features.lua index 39d4a88..f541964 100644 --- a/luaotfload-features.lua +++ b/luaotfload-features.lua @@ -1050,7 +1050,7 @@ local extract_subfont do local eof = P(-1) local digit = R"09" - --- Theoretically a valid subfont address can be up to seven + --- Theoretically a valid subfont address can be up to ten --- digits long. local sub_expr = P"(" * C(digit^1) * P")" * eof local full_path = C(P(1 - sub_expr)^1) diff --git a/luaotfload-tool.lua b/luaotfload-tool.lua index 352697c..721e3cf 100755 --- a/luaotfload-tool.lua +++ b/luaotfload-tool.lua @@ -347,7 +347,7 @@ actions.query = function (job) lookup = "name", specification = "name:" .. query, optsize = 0, - } + } local foundname, subfont, success = fonts.names.resolve(nil, nil, tmpspec) -- cgit v1.2.3 From 7dd61da118b86f7e0cbf23e509f854fd692aedee Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 14 May 2013 18:41:03 +0200 Subject: add font name matching functionality --- luaotfload-auxiliary.lua | 68 +++++++++++++++++++++++++++++++++++++----------- luaotfload-colors.lua | 4 +++ 2 files changed, 57 insertions(+), 15 deletions(-) diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua index a41520c..fd04c80 100644 --- a/luaotfload-auxiliary.lua +++ b/luaotfload-auxiliary.lua @@ -479,27 +479,65 @@ aux.sprint_math_dimension = sprint_math_dimension --- extra database functions ----------------------------------------------------------------------- +local namesresolve = fonts.names.resolve +local namesscan_dir = fonts.names.scan_dir + --- migrated from luaotfload-database.lua --- https://github.com/lualatex/luaotfload/pull/61#issuecomment-17776975 ---- string -> (int, int) +--- string -> (int * int) local scan_external_dir = function (dir) - local old_names, new_names = names.data - if not old_names then - old_names = load_names() - end - new_names = tablecopy(old_names) - local n_scanned, n_new = fonts.names.scan_dir(dir, old_names, - new_names) - --- FIXME - --- This doesn’t seem right. If a db update is triggered after this - --- point, then the added fonts will be saved along with it -- - --- which is not as “temporarily” as it should be. (This should be - --- addressed during a refactoring of names_resolve().) - names.data = new_names - return n_scanned, n_new + local old_names, new_names = names.data + if not old_names then + old_names = load_names() + end + new_names = tablecopy(old_names) + local n_scanned, n_new = scan_dir(dir, old_names, new_names) + --- FIXME + --- This doesn’t seem right. If a db update is triggered after this + --- point, then the added fonts will be saved along with it -- + --- which is not as “temporarily” as it should be. (This should be + --- addressed during a refactoring of names_resolve().) + names.data = new_names + return n_scanned, n_new end aux.scan_external_dir = scan_external_dir +--- https://github.com/lualatex/luaotfload/issues/74 +--- string -> (string * int) +local resolve_fontname = function (name) + local foundname, subfont, success = namesresolve(nil, nil, { + name = name, + lookup = "name", + optsize = 0, + specification = "name:" .. name, + }) + if success then + return foundname, subfont + end + return false, false +end + +aux.resolve_fontname = resolve_fontname + +--- string list -> (string * int) +local resolve_fontlist +resolve_fontlist = function (names, n) + if not n then + return resolve_fontlist(names, 1) + end + local this = names[n] + if this then + local foundname, subfont = resolve_fontname(this) + if foundname then + return foundname, subfont + end + return resolve_fontlist(names, n+1) + end + return false, false +end + +aux.resolve_fontlist = resolve_fontlist + -- vim:tw=71:sw=2:ts=2:expandtab diff --git a/luaotfload-colors.lua b/luaotfload-colors.lua index ec076c2..7bd5c1f 100644 --- a/luaotfload-colors.lua +++ b/luaotfload-colors.lua @@ -7,12 +7,16 @@ if not modules then modules = { } end modules ['luaotfload-colors'] = { } --[[doc-- + buggy coloring with the pre_output_filter when expansion is enabled · tfmdata for different expansion values is split over different objects · in ``initializeexpansion()``, chr.expansion_factor is set, and only those characters that have it are affected · in constructors.scale: chr.expansion_factor = ve*1000 if commented out makes the bug vanish + +explanation: http://tug.org/pipermail/luatex/2013-May/004305.html + --doc]]-- -- cgit v1.2.3 From d72c2e6c04aad687e32e4829f22732ad519a5290 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 14 May 2013 19:22:18 +0200 Subject: restore fallback features table --- luaotfload-auxiliary.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/luaotfload-auxiliary.lua b/luaotfload-auxiliary.lua index fd04c80..dde5686 100644 --- a/luaotfload-auxiliary.lua +++ b/luaotfload-auxiliary.lua @@ -76,16 +76,18 @@ local add_fontdata_fallbacks = function (fontdata) metadata = { ascent = metadata.ascent }, } --- for microtype and fontspec - local fake_features = { } -- wrong: table.copy(resources.features) + --local fake_features = { } + local fake_features = table.copy(resources.features) setmetatable(fake_features, { __index = function (tab, idx) - warning("some package (probably fontspec) is outdated") - warning( - "attempt to index " .. - "tfmdata.shared.otfdata.luatex.features (%s)", - idx) - --os.exit(1) - return nil --- empty anyways - end}) + warning("some package (probably fontspec) is outdated") + warning( + "attempt to index " .. + "tfmdata.shared.otfdata.luatex.features (%s)", + idx) + --os.exit(1) + return tab[idx] + end, + }) fontdata.shared.otfdata.luatex = { unicodes = resources.unicodes, features = fake_features, -- cgit v1.2.3 From 102e7b58a429ee43d3724adc1c3c8ab2c749bb56 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 14 May 2013 19:27:14 +0200 Subject: rename ``make_names()`` -> ``make_savenames()`` --- luaotfload-database.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/luaotfload-database.lua b/luaotfload-database.lua index f4c6fdc..0e46874 100644 --- a/luaotfload-database.lua +++ b/luaotfload-database.lua @@ -202,8 +202,10 @@ local fontnames_init = function (keep_cache) --- returns dbobj } end -local make_name = function (path) - return filereplacesuffix(path, "lua"), filereplacesuffix(path, "luc") +--- string -> (string * string) +local make_savenames = function (path) + return filereplacesuffix(path, "lua"), + filereplacesuffix(path, "luc") end --- When loading a lua file we try its binary complement first, which @@ -1493,7 +1495,7 @@ save_lookups = function ( ) local lookups = names.lookups local path = ensure_names_path() if fileiswritable(path) then - local luaname, lucname = make_name(names.path.lookup_path) + local luaname, lucname = make_savenames(names.path.lookup_path) if luaname then tabletofile(luaname, lookups, true) if lucname and type(caches.compile) == "function" then @@ -1514,7 +1516,7 @@ save_names = function (fontnames) if not fontnames then fontnames = names.data end local path = ensure_names_path() if fileiswritable(path) then - local luaname, lucname = make_name(names.path.path) + local luaname, lucname = make_savenames(names.path.path) if luaname then --tabletofile(luaname, fontnames, true, { reduce=true }) tabletofile(luaname, fontnames, true) -- cgit v1.2.3 From 4b259fe1b191794764a97949c1bc31c01fa2816d Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 15 May 2013 10:41:13 +0200 Subject: sync with Context as of 2013-05-15 --- luaotfload-merged.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/luaotfload-merged.lua b/luaotfload-merged.lua index f814bdb..14667bd 100644 --- a/luaotfload-merged.lua +++ b/luaotfload-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/12/13 22:16:22 +-- merge date : 05/14/13 23:14:52 do -- begin closure to overcome local limits and interference @@ -2046,7 +2046,11 @@ function file.splitname(str,splitdrive) end end function file.splitbase(str) - return str and lpegmatch(pattern_d,str) + if str then + return lpegmatch(pattern_d,str) + else + return "",str + end end function file.nametotable(str,splitdrive) if str then -- cgit v1.2.3 From 52f6ea217175fd1a39e6f80ea7a0f98fbf1364f6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 15 May 2013 11:40:39 +0200 Subject: remove duplicate luaotfload-[legacy-]tool.lua from tds tree --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7eb2fe5..fce2e70 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ MAN = $(MANPAGE) COMPILED = $(DOC) UNPACKED = luaotfload.sty luaotfload.lua GENERATED = $(GRAPHED) $(UNPACKED) $(COMPILED) $(GLYPHS) $(MAN) -SOURCE = $(DTX) $(MANSOURCE) $(OTFL) README Makefile NEWS $(SCRIPT) $(OLDSCRIPT) $(GLYPHSCRIPT) +SOURCE = $(DTX) $(MANSOURCE) $(OTFL) README Makefile NEWS $(GLYPHSCRIPT) # test files TESTDIR = tests @@ -35,7 +35,7 @@ TESTFILES_TL = $(filter-out $(TESTFILES_SYS), $(TESTFILES)) # Files grouped by installation location SCRIPTFILES = $(SCRIPT) $(OLDSCRIPT) $(GLYPHSCRIPT) -RUNFILES = $(UNPACKED) $(OTFL) +RUNFILES = $(UNPACKED) $(filter-out $(SCRIPTFILES),$(OTFL)) DOCFILES = $(DOC) $(DOTPDF) README NEWS MANFILES = $(MANPAGE) SRCFILES = $(DTX) Makefile -- cgit v1.2.3