summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-07-29 07:04:57 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-07-29 07:04:57 +0200
commit4aecc2d439c857b6021c3d3b1450bb619553ca2f (patch)
treefa33d366c43e8cc9f64fd9dda423fa2f266fca24
parent11e08634285978b21fc1f1a03060f5a0c3bd7e7c (diff)
parent964389257aafe081b09798b8d8976f6450ca97b0 (diff)
downloadluaotfload-4aecc2d439c857b6021c3d3b1450bb619553ca2f.tar.gz
Merge pull request #241 from phi-gamma/master
fix issue #237
-rw-r--r--src/luaotfload-configuration.lua2
-rw-r--r--src/luaotfload-database.lua6
-rw-r--r--src/luaotfload-fontloader.lua49
-rwxr-xr-xsrc/luaotfload-tool.lua2
4 files changed, 38 insertions, 21 deletions
diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua
index 0b2da64..bf841f7 100644
--- a/src/luaotfload-configuration.lua
+++ b/src/luaotfload-configuration.lua
@@ -151,6 +151,7 @@ local default_config = {
definer = "patch",
log_level = 0,
color_callback = "pre_linebreak_filter",
+ live = true,
},
misc = {
bisect = false,
@@ -422,6 +423,7 @@ local option_spec = {
},
},
run = {
+ live = { in_t = boolean_t, }, --- false for the tool, true for TeX run
resolver = {
in_t = string_t,
out_t = string_t,
diff --git a/src/luaotfload-database.lua b/src/luaotfload-database.lua
index 4c5522e..099c256 100644
--- a/src/luaotfload-database.lua
+++ b/src/luaotfload-database.lua
@@ -3091,9 +3091,9 @@ end
update_names = function (currentnames, force, dry_run)
local targetnames
- if config.luaotfload.db.update_live == false then
- report ("info", 2, "db",
- "Skipping database update.")
+ local conf = config.luaotfload
+ if conf.run.live ~= false and conf.db.update_live == false then
+ report ("info", 2, "db", "Skipping database update.")
--- skip all db updates
return currentnames or name_index
end
diff --git a/src/luaotfload-fontloader.lua b/src/luaotfload-fontloader.lua
index 293a319..660524e 100644
--- a/src/luaotfload-fontloader.lua
+++ b/src/luaotfload-fontloader.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 07/18/14 14:12:32
+-- merge date : 07/29/14 00:30:11
do -- begin closure to overcome local limits and interference
@@ -2377,28 +2377,30 @@ local isroot=fwslash^1*-1
local hasroot=fwslash^1
local reslasher=lpeg.replacer(S("\\/"),"/")
local deslasher=lpeg.replacer(S("\\/")^1,"/")
-function file.join(...)
- local lst={... }
- local one=lst[1]
+function file.join(one,two,three,...)
+ if not two then
+ return one=="" and one or lpegmatch(stripper,one)
+ end
+ if one=="" then
+ return lpegmatch(stripper,three and concat({ two,three,... },"/") or two)
+ end
if lpegmatch(isnetwork,one) then
local one=lpegmatch(reslasher,one)
- local two=lpegmatch(deslasher,concat(lst,"/",2))
+ local two=lpegmatch(deslasher,three and concat({ two,three,... },"/") or two)
if lpegmatch(hasroot,two) then
return one..two
else
return one.."/"..two
end
elseif lpegmatch(isroot,one) then
- local two=lpegmatch(deslasher,concat(lst,"/",2))
+ local two=lpegmatch(deslasher,three and concat({ two,three,... },"/") or two)
if lpegmatch(hasroot,two) then
return two
else
return "/"..two
end
- elseif one=="" then
- return lpegmatch(stripper,concat(lst,"/",2))
else
- return lpegmatch(deslasher,concat(lst,"/"))
+ return lpegmatch(deslasher,concat({ one,two,three,... },"/"))
end
end
local drivespec=R("az","AZ")^1*colon
@@ -2460,6 +2462,18 @@ function file.collapsepath(str,anchor)
end
end
end
+local tricky=S("/\\")*P(-1)
+local attributes=lfs.attributes
+function lfs.isdir(name)
+ if lpegmatch(tricky,name) then
+ return attributes(name,"mode")=="directory"
+ else
+ return attributes(name.."/.","mode")=="directory"
+ end
+end
+function lfs.isfile(name)
+ return attributes(name,"mode")=="file"
+end
local validchars=R("az","09","AZ","--","..")
local pattern_a=lpeg.replacer(1-validchars)
local pattern_a=Cs((validchars+P(1)/"-")^1)
@@ -8842,7 +8856,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
local lookuphash=resources.lookuphash
local lookuptypes=resources.lookuptypes
local ligatures={}
- local alternate=tonumber(value)
+ local alternate=tonumber(value) or true and 1
local defaultalt=otf.defaultbasealternate
local trace_singles=trace_baseinit and trace_singles
local trace_alternatives=trace_baseinit and trace_alternatives
@@ -9033,7 +9047,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
local lookuphash=resources.lookuphash
local lookuptypes=resources.lookuptypes
local ligatures={}
- local alternate=tonumber(value)
+ local alternate=tonumber(value) or true and 1
local defaultalt=otf.defaultbasealternate
local trace_singles=trace_baseinit and trace_singles
local trace_alternatives=trace_baseinit and trace_alternatives
@@ -9049,7 +9063,7 @@ local function preparesubstitutions(tfmdata,feature,value,validlookups,lookuplis
end
changed[unicode]=data
elseif lookuptype=="alternate" then
- local replacement=data[alternate]
+ local replacement=data[alternate]
if replacement then
changed[unicode]=replacement
if trace_alternatives then
@@ -9142,7 +9156,7 @@ local function featuresinitializer(tfmdata,value)
if true then
local starttime=trace_preparing and os.clock()
local features=tfmdata.shared.features
- local fullname=trace_preparing and tfmdata.properties.fullname
+ local fullname=tfmdata.properties.fullname or "?"
if features then
applybasemethod("initializehashes",tfmdata)
local collectlookups=otf.collectlookups
@@ -9162,20 +9176,21 @@ local function featuresinitializer(tfmdata,value)
if order then
for i=1,#order do
local feature=order[i]
- if features[feature] then
+ local value=features[feature]
+ if value then
local validlookups,lookuplist=collectlookups(rawdata,feature,script,language)
if not validlookups then
elseif basesubstitutions and basesubstitutions[feature] then
if trace_preparing then
- report_prepare("filtering base feature %a for %a",feature,fullname)
+ report_prepare("filtering base %s feature %a for %a with value %a","sub",feature,fullname,value)
end
applybasemethod("preparesubstitutions",tfmdata,feature,value,validlookups,lookuplist)
registerbasefeature(feature,value)
elseif basepositionings and basepositionings[feature] then
if trace_preparing then
- report_prepare("filtering base feature %a for %a",feature,fullname)
+ report_prepare("filtering base %a feature %a for %a with value %a","pos",feature,fullname,value)
end
- applybasemethod("preparepositionings",tfmdata,feature,features[feature],validlookups,lookuplist)
+ applybasemethod("preparepositionings",tfmdata,feature,value,validlookups,lookuplist)
registerbasefeature(feature,value)
end
end
diff --git a/src/luaotfload-tool.lua b/src/luaotfload-tool.lua
index 02c5a45..2330aee 100755
--- a/src/luaotfload-tool.lua
+++ b/src/luaotfload-tool.lua
@@ -1411,7 +1411,7 @@ local process_cmdline = function ( ) -- unit -> jobspec
query = "",
log_level = nil,
bisect = nil,
- config = { db = { }, misc = { }, run = { }, paths = { } },
+ config = { db = { }, misc = { }, run = { live = false }, paths = { } },
}
local long_options = {