summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-05-18 08:50:21 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-05-18 08:50:21 +0200
commitd7fc0762b087bcfae22823dc77844db89009a563 (patch)
tree289c9968c13d16ea195a705db1701b62a4731274 /src
parentd435ea827827dcb4494ddff8583e5b15d27625b4 (diff)
downloadluaotfload-d7fc0762b087bcfae22823dc77844db89009a563.tar.gz
[fontloader] sync with Context as of 2014-05-18
Diffstat (limited to 'src')
-rw-r--r--src/luaotfload-basics-gen.lua25
-rw-r--r--src/luaotfload-basics-nod.lua15
-rw-r--r--src/luaotfload-fontloader.lua11
3 files changed, 48 insertions, 3 deletions
diff --git a/src/luaotfload-basics-gen.lua b/src/luaotfload-basics-gen.lua
index 9cf5b93..c19a49a 100644
--- a/src/luaotfload-basics-gen.lua
+++ b/src/luaotfload-basics-gen.lua
@@ -254,6 +254,18 @@ function caches.loaddata(paths,name)
for i=1,#paths do
local data = false
local luaname, lucname = makefullname(paths[i],name)
+ if lucname and not lfs.isfile(lucname) and type(caches.compile) == "function" then
+ -- in case we used luatex and luajittex mixed ... lub or luc file
+ texio.write(string.format("(compiling luc: %s)",lucname))
+ data = loadfile(luaname)
+ if data then
+ data = data()
+ end
+ if data then
+ caches.compile(data,luaname,lucname)
+ return data
+ end
+ end
if lucname and lfs.isfile(lucname) then -- maybe also check for size
texio.write(string.format("(load luc: %s)",lucname))
data = loadfile(lucname)
@@ -341,3 +353,16 @@ end
function table.setmetatableindex(t,f)
setmetatable(t,{ __index = f })
end
+
+-- helper for plain:
+
+arguments = { }
+
+if arg then
+ for i=1,#arg do
+ local k, v = string.match(arg[i],"^%-%-([^=]+)=?(.-)$")
+ if k and v then
+ arguments[k] = v
+ end
+ end
+end
diff --git a/src/luaotfload-basics-nod.lua b/src/luaotfload-basics-nod.lua
index 50a1e86..373dab5 100644
--- a/src/luaotfload-basics-nod.lua
+++ b/src/luaotfload-basics-nod.lua
@@ -54,22 +54,33 @@ nodes.handlers = { }
local nodecodes = { } for k,v in next, node.types () do nodecodes[string.gsub(v,"_","")] = k end
local whatcodes = { } for k,v in next, node.whatsits() do whatcodes[string.gsub(v,"_","")] = k end
local glyphcodes = { [0] = "character", "glyph", "ligature", "ghost", "left", "right" }
+local disccodes = { [0] = "discretionary", "explicit", "automatic", "regular", "first", "second" }
nodes.nodecodes = nodecodes
nodes.whatcodes = whatcodes
nodes.whatsitcodes = whatcodes
nodes.glyphcodes = glyphcodes
+nodes.disccodes = disccodes
local free_node = node.free
local remove_node = node.remove
local new_node = node.new
local traverse_id = node.traverse_id
-local math_code = nodecodes.math
-
nodes.handlers.protectglyphs = node.protect_glyphs
nodes.handlers.unprotectglyphs = node.unprotect_glyphs
+local math_code = nodecodes.math
+local end_of_math = node.end_of_math
+
+function node.end_of_math(n)
+ if n.id == math_code and n.subtype == 1 then
+ return n
+ else
+ return end_of_math(n)
+ end
+end
+
function nodes.remove(head, current, free_too)
local t = current
head, current = remove_node(head,current)
diff --git a/src/luaotfload-fontloader.lua b/src/luaotfload-fontloader.lua
index 51d861a..f7801ea 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 : 05/15/14 19:52:15
+-- merge date : 05/17/14 23:46:22
do -- begin closure to overcome local limits and interference
@@ -3460,6 +3460,15 @@ end
function table.setmetatableindex(t,f)
setmetatable(t,{ __index=f })
end
+arguments={}
+if arg then
+ for i=1,#arg do
+ local k,v=string.match(arg[i],"^%-%-([^=]+)=?(.-)$")
+ if k and v then
+ arguments[k]=v
+ end
+ end
+end
end -- closure