summaryrefslogtreecommitdiff
path: root/tex/generic/context/luatex/luatex-basics-nod.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-03-26 13:38:18 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-03-26 13:38:18 +0100
commit788487819ccf38a8478cc2afd88e0c0b088d0ec1 (patch)
tree215addbe3b9e293c2958227e7fc8923880b2e71f /tex/generic/context/luatex/luatex-basics-nod.lua
parentadfe72d5a0c9d7bdc1bd7bc8faabb4d05e21d70a (diff)
downloadcontext-788487819ccf38a8478cc2afd88e0c0b088d0ec1.tar.gz
2016-03-26 13:07:00
Diffstat (limited to 'tex/generic/context/luatex/luatex-basics-nod.lua')
-rw-r--r--tex/generic/context/luatex/luatex-basics-nod.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/tex/generic/context/luatex/luatex-basics-nod.lua b/tex/generic/context/luatex/luatex-basics-nod.lua
index 78f1b172a..e7b5ab24f 100644
--- a/tex/generic/context/luatex/luatex-basics-nod.lua
+++ b/tex/generic/context/luatex/luatex-basics-nod.lua
@@ -211,6 +211,44 @@ nuts.setlist = direct.setlist or function(n,l) setfield(n,"list",
nuts.getleader = direct.getleader
nuts.setleader = direct.setleader or function(n,l) setfield(n,"leader",l) end
+if not direct.is_glyph then
+ local getchar = direct.getchar
+ local getid = direct.getid
+ local getfont = direct.getfont
+ local glyph_code = nodes.nodecodes.glyph
+ function direct.is_glyph(n,f)
+ local id = getid(n)
+ if id == glyph_code then
+ if f and getfont(n) == f then
+ return getchar(n)
+ else
+ return false
+ end
+ else
+ return nil, id
+ end
+ end
+ function direct.is_char(n,f)
+ local id = getid(n)
+ if id == glyph_code then
+ if getsubtype(n) >= 256 then
+ return false
+ elseif f and getfont(n) == f then
+ return getchar(n)
+ else
+ return false
+ end
+ else
+ return nil, id
+ end
+ end
+end
+
+nuts.ischar = direct.is_char
+nuts.is_char = direct.is_char
+nuts.isglyph = direct.is_glyph
+nuts.is_glyph = direct.is_glyph
+
nuts.insert_before = direct.insert_before
nuts.insert_after = direct.insert_after
nuts.delete = direct.delete