summaryrefslogtreecommitdiff
path: root/src/luaotfload-init.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2015-06-13 00:40:45 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2015-06-13 00:40:45 +0200
commit90f398e1c9d2896b2d30d0b66f9c8a88255511a8 (patch)
tree88459ad0c6986a6648c969726081248cd5c8d74e /src/luaotfload-init.lua
parentc4c4901173b0f4284534db1b6a3cfe865b05e15c (diff)
parentb271e253b40cd0af97f6d50f0461f87ad1ed5314 (diff)
downloadluaotfload-90f398e1c9d2896b2d30d0b66f9c8a88255511a8.tar.gz
Merge pull request #274 from phi-gamma/master
pull in current state of affairs
Diffstat (limited to 'src/luaotfload-init.lua')
-rw-r--r--src/luaotfload-init.lua59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/luaotfload-init.lua b/src/luaotfload-init.lua
new file mode 100644
index 0000000..4968877
--- /dev/null
+++ b/src/luaotfload-init.lua
@@ -0,0 +1,59 @@
+#!/usr/bin/env texlua
+-----------------------------------------------------------------------
+-- FILE: luaotfload-init.lua
+-- DESCRIPTION: Luaotfload font loader initialization
+-- REQUIREMENTS: luatex v.0.80 or later; packages lualibs, luatexbase
+-- AUTHOR: Philipp Gesang (Phg), <phg@phi-gamma.net>
+-- VERSION: 1.0
+-- CREATED: 2015-05-26 07:50:54+0200
+-----------------------------------------------------------------------
+--
+
+--[[doc--
+
+ Initialization phases:
+
+ - Load Lualibs from package
+ - Set up the logger routines
+ - Load Fontloader
+ - as package specified in configuration
+ - from Context install
+ - (optional: from raw unpackaged files distributed with
+ Luaotfload)
+
+ The initialization of the Lualibs may be made configurable in the
+ future as well allowing to load both the files and the merged package
+ depending on a configuration setting. However, this would require
+ separating out the configuration parser into a self-contained
+ package, which might be problematic due to its current dependency on
+ the Lualibs itself.
+
+--doc]]--
+
+config = config or { }
+local config = config
+config.luaotfload = config.luaotfload or { }
+
+config.lualibs = config.lualibs or { }
+config.lualibs.verbose = false
+config.lualibs.prefer_merged = true
+config.lualibs.load_extended = true
+
+require "lualibs"
+
+if not lualibs then error("this module requires Luaotfload") end
+if not luaotfload then error("this module requires Luaotfload") end
+
+local load_luaotfload_module = luaotfload.loaders.luaotfload
+local load_fontloader_module = luaotfload.loaders.fontloader
+
+--[[doc--
+
+ The logger needs to be in place prior to loading the fontloader due
+ to order of initialization being crucial for the logger functions
+ that are swapped.
+
+--doc]]--
+
+load_luaotfload_module "log"
+