summaryrefslogtreecommitdiff
path: root/src/luaotfload-main.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-05-04 22:06:50 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-05-04 22:06:50 +0200
commit17fbf1d1c26047f1e0e80fc6e5f3331f6183a795 (patch)
tree8c4c0641243ae492381efdb5c67313b30eb5dc7f /src/luaotfload-main.lua
parentc038e2135c2b312e0f882f2e5130736781d64dc0 (diff)
parent0ba71246a7445204a457602806f9cc80c0cbe354 (diff)
downloadluaotfload-17fbf1d1c26047f1e0e80fc6e5f3331f6183a795.tar.gz
Merge pull request #355 from phi-gamma/master
bugfixes, part 2
Diffstat (limited to 'src/luaotfload-main.lua')
-rw-r--r--src/luaotfload-main.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/luaotfload-main.lua b/src/luaotfload-main.lua
index 9e8d088..25be3db 100644
--- a/src/luaotfload-main.lua
+++ b/src/luaotfload-main.lua
@@ -13,9 +13,30 @@ local luaotfload = luaotfload
luaotfload.log = luaotfload.log or { }
luaotfload.version = "2.7"
luaotfload.loaders = { }
-luaotfload.min_luatex_version = 95 --- i. e. 0.95
+luaotfload.min_luatex_version = { 0, 95, 0 } --- i. e. 0.95.0
luaotfload.fontloader_package = "reference" --- default: from current Context
+if not tex or not tex.luatexversion then
+ error "this program must be run in TeX mode" --- or call tex.initialize() =)
+else
+ --- version check
+ local major = tex.luatexversion / 100
+ local minor = tex.luatexversion % 100
+ local revision = tex.luatexrevision --[[ : string ]]
+ local revno = tonumber (revision)
+ local minimum = luaotfload.min_luatex_version
+ if major < minimum [1] or minor < minimum [2]
+ or revno and revno < minimum [3]
+ then
+ texio.write_nl ("term and log",
+ string.format ("\tFATAL ERROR\n\z
+ \tLuaotfload requires a Luatex version >= %d.%d.%d.\n\z
+ \tPlease update your TeX distribution!\n\n",
+ (unpack or table.unpack) (minimum)))
+ error "version check failed"
+ end
+end
+
local authors = "\z
Hans Hagen,\z
Khaled Hosny,\z