[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Fix issue when color starts in a discretionary (d2188db)

Marcel Fabian Krüger tex at 2krueger.de
Fri Jan 10 15:24:35 CET 2020


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

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

commit d2188db0a920229601b40cf15b16f9c0d9d6c6f5
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Fri Jan 10 15:24:35 2020 +0100

    Fix issue when color starts in a discretionary


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

d2188db0a920229601b40cf15b16f9c0d9d6c6f5
 src/luaotfload-colors.lua | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/luaotfload-colors.lua b/src/luaotfload-colors.lua
index 4700e07..c93447c 100644
--- a/src/luaotfload-colors.lua
+++ b/src/luaotfload-colors.lua
@@ -40,10 +40,13 @@ local insert_node_after     = nodedirect.insert_after
 local todirect              = nodedirect.todirect
 local tonode                = nodedirect.tonode
 local setfield              = nodedirect.setfield
+local setdisc               = nodedirect.setdisc
+local setreplace            = nodedirect.setreplace
 local getid                 = nodedirect.getid
 local getfont               = nodedirect.getfont
 local getchar               = nodedirect.getchar
 local getlist               = nodedirect.getlist
+local getdisc               = nodedirect.getdisc
 local getsubtype            = nodedirect.getsubtype
 local getnext               = nodedirect.getnext
 local nodetail              = nodedirect.tail
@@ -237,6 +240,11 @@ node_colorize = function (head, toplevel, current_color)
                 setfield(n, "head", n_list)
             end
 
+        elseif n_id == disc_t then
+            local n_pre, n_post, n_replace = getdisc(n)
+            n_replace, current_color = node_colorize(n_replace, false, current_color)
+            setdisc(n, n_pre, n_post, n_replace)
+
         elseif n_id == glyph_t then
             --- colorization is restricted to those fonts
             --- that received the “color” property upon





More information about the latex3-commits mailing list