[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: use post_mlist_to_hlist_filter (a05f631)

Dohyun Kim nomosnomos at gmail.com
Tue Mar 3 22:58:50 CET 2020


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/a05f631b598c350b69fd7b4d6c1c58d8593fddcf

>---------------------------------------------------------------

commit a05f631b598c350b69fd7b4d6c1c58d8593fddcf
Author: Dohyun Kim <nomosnomos at gmail.com>
Date:   Wed Mar 4 06:58:50 2020 +0900

    use post_mlist_to_hlist_filter


>---------------------------------------------------------------

a05f631b598c350b69fd7b4d6c1c58d8593fddcf
 src/luaotfload-colors.lua | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/src/luaotfload-colors.lua b/src/luaotfload-colors.lua
index 6488e1b..6db32ae 100644
--- a/src/luaotfload-colors.lua
+++ b/src/luaotfload-colors.lua
@@ -126,7 +126,6 @@ local vlist_t           = nodetype("vlist")
 local whatsit_t         = nodetype("whatsit")
 local disc_t            = nodetype("disc")
 local colorstack_t      = node.subtype("pdf_colorstack")
-local mlist_to_hlist    = node.mlist_to_hlist
 
 local color_callback
 local color_attr        = luatexbase.new_attribute("luaotfload_color_attribute")
@@ -228,9 +227,9 @@ local function node_colorize (head, toplevel, current_color, current_transparent
     end
 
     if toplevel then
-        local nn = nodetail(n_list)
+        local nn = nodetail(head)
         head, nn, current_color = color_whatsit(head, nn, color_stack, current_color, nil, true)
-        head, nn, current_transparent = color_whatsit(head, nn, transparent_stack, current_color, nil, true)
+        head, nn, current_transparent = color_whatsit(head, nn, transparent_stack, current_transparent, nil, true)
     end
 
     setattribute(head, color_attr, 1)
@@ -287,12 +286,6 @@ local color_callback_name      = "luaotfload.color_handler"
 local color_callback_activated = 0
 local add_to_callback          = luatexbase.add_to_callback
 
---- unit -> bool
-local function mlist_to_hlist_initial ()
-    local cdesc = luatexbase.callback_descriptions "mlist_to_hlist"
-    return cdesc and cdesc[1] == color_callback_name
-end
-
 --- unit -> unit
 add_color_callback = function ( )
     color_callback = config.luaotfload.run.color_callback
@@ -314,11 +307,8 @@ add_color_callback = function ( )
                             return head
                         end,
                         color_callback_name)
-        add_to_callback("mlist_to_hlist",
-                        function (head, display_type, need_penalties)
-                            if mlist_to_hlist_initial () then
-                                head = mlist_to_hlist(head, display_type, need_penalties)
-                            end
+        add_to_callback("post_mlist_to_hlist_filter",
+                        function (head, display_type)
                             if display_type == "text" then
                                 return head
                             end





More information about the latex3-commits mailing list.