summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--luaotfload-basics-gen.lua48
-rw-r--r--luaotfload.dtx2
2 files changed, 32 insertions, 18 deletions
diff --git a/luaotfload-basics-gen.lua b/luaotfload-basics-gen.lua
index 727086e..61f3910 100644
--- a/luaotfload-basics-gen.lua
+++ b/luaotfload-basics-gen.lua
@@ -130,7 +130,9 @@ end
caches = { }
-local writable, readables = nil, { }
+local writable = nil
+local readables = { }
+local usingjit = jit
if not caches.namespace or caches.namespace == "" or caches.namespace == "context" then
caches.namespace = 'generic'
@@ -204,7 +206,7 @@ end
local function makefullname(path,name)
if path and path ~= "" then
name = "temp-" .. name -- clash prevention
- return file.addsuffix(file.join(path,name),"lua"), file.addsuffix(file.join(path,name),"luc")
+ return file.addsuffix(file.join(path,name),"lua"), file.addsuffix(file.join(path,name),usingjit and "lub" or "luc")
end
end
@@ -265,26 +267,36 @@ end
-- this) in which case one should limit the method to luac and enable support
-- for execution.
-caches.compilemethod = "both"
+-- function caches.compile(data,luaname,lucname)
+-- local d = io.loaddata(luaname)
+-- if not d or d == "" then
+-- d = table.serialize(data,true) -- slow
+-- end
+-- if d and d ~= "" then
+-- local f = io.open(lucname,'w')
+-- if f then
+-- local s = loadstring(d)
+-- if s then
+-- f:write(string.dump(s,true))
+-- end
+-- f:close()
+-- end
+-- end
+-- end
function caches.compile(data,luaname,lucname)
- local done = false
- if caches.compilemethod == "luac" or caches.compilemethod == "both" then
- done = os.spawn("texluac -o " .. string.quoted(lucname) .. " -s " .. string.quoted(luaname)) == 0
+ local d = io.loaddata(luaname)
+ if not d or d == "" then
+ d = table.serialize(data,true) -- slow
end
- if not done and (caches.compilemethod == "dump" or caches.compilemethod == "both") then
- local d = io.loaddata(luaname)
- if not d or d == "" then
- d = table.serialize(data,true) -- slow
- end
- if d and d ~= "" then
- local f = io.open(lucname,'w')
- if f then
- local s
- if _G["loadstring"] then s=loadstring(d) else s=load(d) end
- f:write(string.dump(s))
- f:close()
+ if d and d ~= "" then
+ local f = io.open(lucname,'w')
+ if f then
+ local s = loadstring(d)
+ if s then
+ f:write(string.dump(s,true))
end
+ f:close()
end
end
end
diff --git a/luaotfload.dtx b/luaotfload.dtx
index 58fb9e1..e265389 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -870,6 +870,7 @@ and the derived files
% \incitem{font-otf.lua} \incitem{font-otb.lua}
% \incitem{node-inj.lua} \incitem{font-ota.lua}
% \incitem{font-otn.lua} \incitem{font-def.lua}
+% \incitem{font-otp.lua}
% \end{itemize}
% \end{multicols}
% \end{itemize}
@@ -1273,6 +1274,7 @@ else--- the loading sequence is known to change, so this might have to
loadmodule('node-inj.lua')
loadmodule('font-ota.lua')
loadmodule('font-otn.lua')
+ loadmodule('font-otp.lua')--- since 2013-04-23
loadmodule('luatex-fonts-lua.lua')
loadmodule('font-def.lua')
loadmodule('luatex-fonts-def.lua')