From 0c8c0abc6c1dafa129ccac2beca02b3c4afbccbf Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sun, 13 Jul 2014 14:36:42 +0200 Subject: [color] set color callback according to configuration --- src/luaotfload-colors.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/luaotfload-colors.lua b/src/luaotfload-colors.lua index 476826e..67041fe 100644 --- a/src/luaotfload-colors.lua +++ b/src/luaotfload-colors.lua @@ -20,14 +20,6 @@ explanation: http://tug.org/pipermail/luatex/2013-May/004305.html --doc]]-- -local color_callback = config.luaotfload.run.color_callback -if not color_callback then - --- maybe this would be better as a method: "early" | "late" - color_callback = "pre_linebreak_filter" --- color_callback = "pre_output_filter" --- old behavior, breaks expansion -end - - local newnode = node.new local nodetype = node.id local traverse_nodes = node.traverse @@ -307,6 +299,11 @@ local color_callback_activated = 0 --- unit -> unit add_color_callback = function ( ) + local color_callback = config.luaotfload.run.color_callback + if not color_callback then + color_callback = "pre_linebreak_filter" + end + if color_callback_activated == 0 then luatexbase.add_to_callback(color_callback, color_handler, -- cgit v1.2.3