summaryrefslogtreecommitdiff
path: root/src/luaotfload-configuration.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-configuration.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-configuration.lua')
-rw-r--r--src/luaotfload-configuration.lua43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/luaotfload-configuration.lua b/src/luaotfload-configuration.lua
index b198697..e9393c5 100644
--- a/src/luaotfload-configuration.lua
+++ b/src/luaotfload-configuration.lua
@@ -2,17 +2,18 @@
-------------------------------------------------------------------------------
-- FILE: luaotfload-configuration.lua
-- DESCRIPTION: config file reader
--- REQUIREMENTS: Luaotfload 2.5 or above
+-- REQUIREMENTS: Luaotfload 2.6 or above
-- AUTHOR: Philipp Gesang (Phg), <phg42.2a@gmail.com>
+-- AUTHOR: Dohyun Kim <nomosnomos@gmail.com>
-- VERSION: same as Luaotfload
--- MODIFIED: 2015-03-16 07:48:58+0100
+-- MODIFIED: 2015-05-05
-------------------------------------------------------------------------------
--
if not modules then modules = { } end modules ["luaotfload-configuration"] = {
- version = "2.5",
+ version = "2.6",
comment = "part of Luaotfload",
- author = "Philipp Gesang",
+ author = "Philipp Gesang, Dohyun Kim",
copyright = "Luaotfload Development Team",
license = "GNU GPL v2.0"
}
@@ -144,6 +145,23 @@ local registered_loaders = {
tl2013 = "tl2013",
}
+--[[doc--
+
+ The ``post_linebreak_filter`` has been made the default callback for
+ hooking the colorizer into. This helps with the linebreaking whose
+ inserted hyphens would remain unaffected by the coloring otherwise.
+
+ http://tex.stackexchange.com/q/238539/14066
+
+--doc]]--
+
+local permissible_color_callbacks = {
+ default = "post_linebreak_filter",
+ pre_linebreak_filter = "pre_linebreak_filter",
+ post_linebreak_filter = "post_linebreak_filter",
+ pre_output_filter = "pre_output_filter",
+}
+
-------------------------------------------------------------------------------
--- DEFAULTS
@@ -163,7 +181,7 @@ local default_config = {
resolver = "cached",
definer = "patch",
log_level = 0,
- color_callback = "pre_linebreak_filter",
+ color_callback = "post_linebreak_filter",
live = true,
},
misc = {
@@ -479,9 +497,20 @@ local option_spec = {
color_callback = {
in_t = string_t,
out_t = string_t,
- transform = function (cb)
+ transform = function (cb_spec)
--- These are the two that make sense.
- return cb == "pre_output_filter" and cb or "pre_linebreak_filter"
+ local cb = permissible_color_callbacks[cb_spec]
+ if cb then
+ logreport ("log", 3, "conf",
+ "Using callback \"%s\" for font colorization.",
+ cb)
+ return cb
+ end
+ logreport ("log", 0, "conf",
+ "Requested callback identifier \"%s\" invalid, "
+ .. "falling back to default.",
+ cb_spec)
+ return permissible_color_callbacks.default
end,
},
},