summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlisle <d.p.carlisle@gmail.com>2015-07-28 18:39:05 +0100
committerDavid Carlisle <d.p.carlisle@gmail.com>2015-10-03 13:16:06 +0100
commit2985566f7f478d5f0ac8eb9c9ec7330f6e9a10c2 (patch)
tree69ef61d217db324ff6d80d874787c2290bba2585
parent7baac9244235ce00255a0f61c5931585aa99163c (diff)
downloadluaotfload-2985566f7f478d5f0ac8eb9c9ec7330f6e9a10c2.tar.gz
Patch to not assume luatexbase needs to be loaded
The ltluatex code being trialed at https://github.com/josephwright/ltluatex includes a luatexbase emulation package that allows luaotfload to run without change but the core code that is intended to be included in future latex formats requires two small changes and also would require that luaotfload detect that luatex support is already provided and so not load luatexbase. \RequireLuaModule is not defined by default in TeX and luatexbase.reset_callback is not defined by default in lua in the core ltluatex code.
-rw-r--r--src/luaotfload-main.lua4
-rw-r--r--src/luaotfload.sty12
2 files changed, 13 insertions, 3 deletions
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua
index b633ed7..919e343 100644
--- a/src/luaotfload-main.lua
+++ b/src/luaotfload-main.lua
@@ -249,7 +249,9 @@ do
definers.info_generic = mk_info "generic"
end
-reset_callback "define_font"
+if not reset_callback == nil then
+ reset_callback "define_font"
+end
--[[doc--
diff --git a/src/luaotfload.sty b/src/luaotfload.sty
index c9c9864..825a3a5 100644
--- a/src/luaotfload.sty
+++ b/src/luaotfload.sty
@@ -35,14 +35,22 @@
\let\ifluaotfloadloaded\endinput
\bgroup\expandafter\expandafter\expandafter\egroup
\expandafter\ifx\csname selectfont\endcsname\relax
+ \ifdefined\newluafunction\else
\input luatexbase.sty
+ \fi
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luaotfload}%
%% FIXME The date is meaningless, we need to find a way to
%% use the git revision instead.
[2015/03/29 v2.6 OpenType layout system]
- \RequirePackage{luatexbase}
+ \ifdefined\newluafunction\else
+ \RequirePackage{luatexbase}
+ \fi
+\fi
+\ifdefined \RequireLuaModule
+ \RequireLuaModule{luaotfload-main}
+\else
+ \directlua{require("luaotfload-main")}
\fi
-\RequireLuaModule{luaotfload-main}