summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-met.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-07-14 21:22:10 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-07-14 21:22:10 +0200
commit23b495f46b4d2e9264d54095f43774ef47d3a656 (patch)
tree1b0131b93d92d4aa7e15b55c50ad1dfa3573a7e1 /tex/context/base/mkiv/node-met.lua
parent6ae40572e7643edcc29f8d5b071221dd1e04bdf3 (diff)
downloadcontext-23b495f46b4d2e9264d54095f43774ef47d3a656.tar.gz
2017-07-14 19:41:00
Diffstat (limited to 'tex/context/base/mkiv/node-met.lua')
-rw-r--r--tex/context/base/mkiv/node-met.lua46
1 files changed, 45 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/node-met.lua b/tex/context/base/mkiv/node-met.lua
index e6d0f4689..2686aa990 100644
--- a/tex/context/base/mkiv/node-met.lua
+++ b/tex/context/base/mkiv/node-met.lua
@@ -110,8 +110,9 @@ nodes.set_attribute = node.set_attribute
nodes.find_attribute = node.find_attribute
nodes.unset_attribute = node.unset_attribute
-nodes.protect_glyphs = node.protect_glyphs
nodes.protect_glyph = node.protect_glyph
+nodes.protect_glyphs = node.protect_glyphs
+nodes.unprotect_glyph = node.unprotect_glyph
nodes.unprotect_glyphs = node.unprotect_glyphs
nodes.kerning = node.kerning
nodes.ligaturing = node.ligaturing
@@ -669,3 +670,46 @@ end
nodes.keys = keys -- [id][subtype]
nodes.fields = nodefields -- (n)
+
+-- for the moment (pre 6380)
+
+if not nodes.unprotect_glyph then
+
+ local protect_glyph = nodes.protect_glyph
+ local protect_glyphs = nodes.protect_glyphs
+ local unprotect_glyph = nodes.unprotect_glyph
+ local unprotect_glyphs = nodes.unprotect_glyphs
+
+ local getnext = nodes.getnext
+ local setnext = nodes.setnext
+
+ function nodes.protectglyphs(first,last)
+ if first == last then
+ return protect_glyph(first)
+ elseif last then
+ local nxt = getnext(last)
+ setnext(last)
+ local f, b = protect_glyphs(first)
+ setnext(last,nxt)
+ return f, b
+ else
+ return protect_glyphs(first)
+ end
+ end
+
+ function nodes.unprotectglyphs(first,last)
+ if first == last then
+ return unprotect_glyph(first)
+ elseif last then
+ local nxt = getnext(last)
+ setnext(last)
+ local f, b = unprotect_glyphs(first)
+ setnext(last,nxt)
+ return f, b
+ else
+ return unprotect_glyphs(first)
+ end
+ end
+
+end
+